UNPKG

hataraku

Version:

An autonomous coding agent for building AI-powered development tools. The name "Hataraku" (働く) means "to work" in Japanese.

30 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createAnthropicProvider = createAnthropicProvider; exports.createAnthropicModel = createAnthropicModel; const anthropic_1 = require("@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 */ async function createAnthropicProvider(apiKey) { const key = apiKey || process.env.ANTHROPIC_API_KEY; if (!apiKey) { throw new Error('ANTHROPIC_API_KEY is not set'); } return (0, anthropic_1.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 */ async function createAnthropicModel(model = 'claude-3-5-sonnet-20240620', apiKey) { const anthropic = await createAnthropicProvider(apiKey); return anthropic(model); } //# sourceMappingURL=anthropic.js.map