mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-17 12:56:41 +02:00
19 lines
558 B
TypeScript
19 lines
558 B
TypeScript
import type { RouteModelInput } from "../route/client"
|
|
import { Provider } from "../provider"
|
|
import { ProviderID, type ModelID } from "../schema"
|
|
import * as AnthropicMessages from "../protocols/anthropic-messages"
|
|
|
|
export const id = ProviderID.make("anthropic")
|
|
|
|
export const routes = [AnthropicMessages.route]
|
|
|
|
export const model = (
|
|
id: string | ModelID,
|
|
options: Omit<RouteModelInput, "id" | "baseURL"> & { readonly baseURL?: string } = {},
|
|
) => AnthropicMessages.model({ ...options, id })
|
|
|
|
export const provider = Provider.make({
|
|
id,
|
|
model,
|
|
})
|