Fixed types and created tests

This commit is contained in:
3byss
2026-03-20 16:26:30 -06:00
parent 17b8d9ed87
commit cb275759bb
2 changed files with 82 additions and 3 deletions

View File

@@ -10,15 +10,15 @@ export class GrokProvider extends LLMProvider {
this.model = config.model || 'grok-3';
}
getConfigured() {
get isConfigured() {
return !!this.apiKey;
}
async complete(systemPrompt, userMessage, opts = {}) {
const res = await fetch('https://api.x.ai/v1/chat/completions', {
method: POST,
method: 'POST',
headers: {
'Content-type': 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${this.apiKey}`,
},
body: JSON.stringify({