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