gaunt-sloth-assistant
Version:
[](https://github.com/Galvanized-Pukeko/gaunt-sloth-assistant/actions/workflows/unit-tests.yml) [ {
const { ChatXAI } = await import('@langchain/xai');
// Use config value if available, otherwise use the environment variable
const apiKey = llmConfig.apiKey || env.XAI_API_KEY;
return new ChatXAI({
...llmConfig,
apiKey,
model: llmConfig.model || 'grok-4-0709',
});
}
const jsonContent = `{
"llm": {
"type": "xai",
"model": "grok-4-0709"
}
}`;
export function init(configFileName) {
// Determine which content to use based on file extension
if (!configFileName.endsWith('.json')) {
throw new Error('Only JSON config is supported.');
}
writeFileIfNotExistsWithMessages(configFileName, jsonContent);
displayWarning(`You need to update your ${configFileName} to add your xAI API key, ` +
'or define XAI_API_KEY environment variable.');
}
//# sourceMappingURL=xai.js.map