Fixed any issues with the PR
This commit is contained in:
@@ -7,7 +7,7 @@ export class GrokProvider extends LLMProvider {
|
||||
super(config);
|
||||
this.name = 'grok';
|
||||
this.apiKey = config.apiKey;
|
||||
this.model = config.model || 'grok-3';
|
||||
this.model = config.model || 'grok-4-latest';
|
||||
}
|
||||
|
||||
get isConfigured() {
|
||||
@@ -22,6 +22,7 @@ export class GrokProvider extends LLMProvider {
|
||||
Authorization: `Bearer ${this.apiKey}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
max_tokens: opts.max_tokens || 4096,
|
||||
messages: [
|
||||
{ role: 'system', content: systemPrompt },
|
||||
{ role: 'user', content: userMessage },
|
||||
@@ -39,7 +40,7 @@ export class GrokProvider extends LLMProvider {
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
const text = data.choices?.[0].message?.content || '';
|
||||
const text = data.choices?.[0]?.message?.content || '';
|
||||
|
||||
return {
|
||||
text,
|
||||
|
||||
Reference in New Issue
Block a user