hataraku
Version:
An autonomous coding agent for building AI-powered development tools. The name "Hataraku" (働く) means "to work" in Japanese.
26 lines • 976 B
JavaScript
import { createAnthropic } from '@ai-sdk/anthropic';
/**
* Create an Anthropic provider with the given API key
* @param apiKey Anthropic API key (optional, defaults to ANTHROPIC_API_KEY environment variable)
* @returns Anthropic provider
*/
export async function createAnthropicProvider(apiKey) {
const key = apiKey || process.env.ANTHROPIC_API_KEY;
if (!apiKey) {
throw new Error('ANTHROPIC_API_KEY is not set');
}
return createAnthropic({
apiKey: key
});
}
/**
* Create an Anthropic model with the given model name
* @param model Model name (defaults to claude-3-5-sonnet-20240620)
* @param apiKey Anthropic API key (optional, defaults to ANTHROPIC_API_KEY environment variable)
* @returns Anthropic model
*/
export async function createAnthropicModel(model = 'claude-3-5-sonnet-20240620', apiKey) {
const anthropic = await createAnthropicProvider(apiKey);
return anthropic(model);
}
//# sourceMappingURL=anthropic.js.map