gaunt-sloth-assistant
Version:
[](https://github.com/Galvanized-Pukeko/gaunt-sloth-assistant/actions/workflows/unit-tests.yml) [ {
const anthropic = await import('@langchain/anthropic');
// Use config value if available, otherwise use the environment variable
const anthropicApiKey = llmConfig.apiKey || env.ANTHROPIC_API_KEY;
return new anthropic.ChatAnthropic({
...llmConfig,
apiKey: anthropicApiKey,
model: llmConfig.model || 'claude-sonnet-4-20250514',
});
}
const jsonContent = `{
"llm": {
"type": "anthropic",
"model": "claude-sonnet-4-20250514"
}
}`;
// noinspection JSUnusedGlobalSymbols
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 Anthropic API key, ` +
'or define ANTHROPIC_API_KEY environment variable.');
}
//# sourceMappingURL=anthropic.js.map