mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-01 21:05:31 +02:00
Update groq.js
Fixed issue with groq.js
This commit is contained in:
parent
ea61c3a916
commit
64b284c0f2
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
import Groq from 'groq-sdk';
|
||||
import Groq from 'groq-sdk'
|
||||
import fs from "fs";
|
||||
import { getKey } from '../utils/keys.js';
|
||||
|
||||
|
@ -72,6 +72,7 @@ export class GroqCloudAPI {
|
|||
} catch (err) {
|
||||
console.log(err);
|
||||
res = "My brain just kinda stopped working. Try again.";
|
||||
}
|
||||
|
||||
// Check for <think> tag issues
|
||||
const hasOpenTag = res.includes("<think>");
|
||||
|
@ -82,8 +83,7 @@ export class GroqCloudAPI {
|
|||
console.warn("Partial <think> block detected. Re-generating Groq request...");
|
||||
continue; // This will skip the rest of the loop and try again
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// If only the closing tag is present, prepend an opening tag
|
||||
if (hasCloseTag && !hasOpenTag) {
|
||||
res = '<think>' + res;
|
||||
|
|
Loading…
Add table
Reference in a new issue