@anvia/anthropic
v0.1.10
Published
Anthropic provider adapter for Anvia.
Readme
@anvia/anthropic
Anthropic provider adapter for Anvia.
Use this package when you want Anvia agents, extractors, or pipelines to run on Claude models through Anthropic's SDK, or through an Anthropic-compatible API endpoint.
Installation
pnpm add @anvia/anthropic @anvia/coreIn this monorepo, the package is available through the workspace:
pnpm --filter @anvia/anthropic buildUsage
import { AgentBuilder } from "@anvia/core";
import { AnthropicClient } from "@anvia/anthropic";
const client = new AnthropicClient({
apiKey,
});
const model = client.completionModel("claude-sonnet-4-20250514");
const agent = new AgentBuilder("assistant", model)
.instructions("Answer clearly and concisely.")
.build();
const response = await agent.prompt("Summarize Anvia in one sentence.").send();
console.log(response.output);Anthropic-Compatible APIs
For APIs that expose an Anthropic-compatible surface, pass a custom baseUrl:
import { AnthropicClient } from "@anvia/anthropic";
const client = new AnthropicClient({
apiKey,
baseUrl,
});
const model = client.completionModel("provider/model-name");Exports
AnthropicClientAnthropicCompletionModelanthropic
Development
pnpm --filter @anvia/anthropic typecheck
pnpm --filter @anvia/anthropic test
pnpm --filter @anvia/anthropic build