This commit is contained in:
Andrew Pareles
2024-11-17 02:09:39 -08:00
parent c27b55f1d4
commit 23f39e5d26
4 changed files with 255 additions and 10141 deletions
+250 -10131
View File
File diff suppressed because it is too large Load Diff
+1 -3
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"
}
}
+3 -6
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);
}
@@ -21,7 +21,7 @@ const configString = (description: string, defaultVal: string) => {
export const configFields = [
'anthropic',
'openAI',
'groq',//groq modle
'groq',
'gemini',
'greptile',
'ollama',