Merge branch 'main' into main

This commit is contained in:
Sweaterdog 2025-02-08 22:59:58 -08:00 committed by GitHub
commit 0fe7d11618
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -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;
}

View file

@ -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) {

View file

@ -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.