mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-03 22:05:35 +02:00
Merge branch 'main' into main
This commit is contained in:
commit
0fe7d11618
3 changed files with 6 additions and 2 deletions
|
@ -39,7 +39,7 @@ export class Gemini {
|
|||
model: this.model_name || "gemini-1.5-flash",
|
||||
// systemInstruction does not work bc google is trash
|
||||
};
|
||||
|
||||
|
||||
if (this.url) {
|
||||
model = this.genAI.getGenerativeModel(
|
||||
modelConfig,
|
||||
|
@ -55,7 +55,6 @@ export class Gemini {
|
|||
|
||||
console.log('Awaiting Google API response...');
|
||||
|
||||
// Prepend system message and format turns cause why not
|
||||
turns.unshift({ role: 'system', content: systemMessage });
|
||||
turns = strictFormat(turns);
|
||||
let contents = [];
|
||||
|
@ -94,6 +93,7 @@ export class Gemini {
|
|||
}
|
||||
|
||||
console.log('Received.');
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import { getKey } from '../utils/keys.js';
|
|||
|
||||
// Umbrella class for Mixtral, LLama, Gemma...
|
||||
export class GroqCloudAPI {
|
||||
|
||||
constructor(model_name, url, params) {
|
||||
this.model_name = model_name;
|
||||
this.url = url;
|
||||
|
@ -10,6 +11,7 @@ export class GroqCloudAPI {
|
|||
// Groq Cloud does not support custom URLs; warn if provided
|
||||
if (this.url) {
|
||||
console.warn("Groq Cloud has no implementation for custom URLs. Ignoring provided URL.");
|
||||
|
||||
}
|
||||
this.groq = new Groq({ apiKey: getKey('GROQCLOUD_API_KEY') });
|
||||
}
|
||||
|
@ -37,6 +39,7 @@ export class GroqCloudAPI {
|
|||
...(this.params || {})
|
||||
});
|
||||
|
||||
|
||||
let temp_res = "";
|
||||
// Aggregate streamed chunks into a full response
|
||||
for await (const chunk of completion) {
|
||||
|
|
|
@ -43,6 +43,7 @@ export class Local {
|
|||
console.log(err);
|
||||
res = 'My brain disconnected, try again.';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// If the model name includes "deepseek-r1" or "Andy-3.5-reasoning", then handle the <think> block.
|
||||
|
|
Loading…
Add table
Reference in a new issue