AnthropicAdapter
Copilot Runtime adapter for Anthropic.
Example
import { CopilotRuntime, AnthropicAdapter } from "@copilotkit/runtime";
import Anthropic from "@anthropic-ai/sdk";
const copilotKit = new CopilotRuntime();
const anthropic = new Anthropic({
apiKey: "<your-api-key>",
});
const serviceAdapter = new AnthropicAdapter({ anthropic });
return copilotKit.streamHttpServerResponse(req, res, serviceAdapter);
Constructor Parameters
anthropicAnthropic
An optional Anthropic instance to use. If not provided, a new instance will be created.
modelstring
The model to use.