This commit is contained in:
Andrew Pareles 2024-11-17 02:09:39 -08:00
parent cc3a08e1ab
commit 91c65b6060
4 changed files with 255 additions and 10141 deletions

File diff suppressed because it is too large Load diff

View file

@ -139,6 +139,7 @@
"eslint-plugin-react": "^7.35.1",
"eslint-plugin-react-hooks": "^4.6.2",
"globals": "^15.9.0",
"groq-sdk": "^0.8.0",
"lodash": "^4.17.21",
"marked": "^14.1.0",
"ollama": "^0.5.9",
@ -155,8 +156,5 @@
"typescript": "5.5.4",
"typescript-eslint": "^8.3.0",
"uuid": "^10.0.0"
},
"dependencies": {
"groq-sdk": "^0.7.0"
}
}

View file

@ -366,10 +366,7 @@ const sendGroqMsg: SendLLMMessageFnTypeInternal = async ({ messages, onText, onF
didAbort = true;
};
const groq = new Groq({
apiKey: voidConfig.groq.apikey,
dangerouslyAllowBrowser: true
});
const groq = new Groq({ apiKey: voidConfig.groq.apikey, dangerouslyAllowBrowser: true });
try {
const stream = await groq.chat.completions.create({
@ -384,14 +381,14 @@ const sendGroqMsg: SendLLMMessageFnTypeInternal = async ({ messages, onText, onF
if (didAbort) {
break;
}
const newText = chunk.choices[0]?.delta?.content || '';
if (newText) {
fullText += newText;
onText(newText, fullText);
}
}
if (!didAbort) {
onFinalMessage(fullText);
}

View file

@ -21,7 +21,7 @@ const configString = (description: string, defaultVal: string) => {
export const configFields = [
'anthropic',
'openAI',
'groq',//groq modle
'groq',
'gemini',
'greptile',
'ollama',