MCPcopy Create free account
hub / github.com/anomalyco/opencode / model

Function model

packages/core/test/session-runner-model.test.ts:25–42  ·  view source on GitHub ↗
(api: Api, variants: ModelV2.Info["variants"] = [])

Source from the content-addressed store, hash-verified

23 | { readonly type: "native"; readonly url?: string; readonly settings: Record<string, unknown> }
24
25const model = (api: Api, variants: ModelV2.Info["variants"] = []) =>
26 ModelV2.Info.make({
27 id: ModelV2.ID.make("test-model"),
28 providerID: ProviderV2.ID.make("test-provider"),
29 name: "Test model",
30 api: { id: ModelV2.ID.make("api-test-model"), ...api },
31 capabilities: { tools: true, input: ["text"], output: ["text"] },
32 request: {
33 headers: { "x-test": "header" },
34 body: { apiKey: "secret", custom_extension: { enabled: true } },
35 },
36 variants,
37 time: { released: 0 },
38 cost: [],
39 status: "active",
40 enabled: true,
41 limit: { context: 100, output: 20 },
42 })
43
44describe("SessionRunnerModel", () => {
45 it.effect("maps catalog OpenAI AI SDK models into native Responses routes", () =>

Callers 1

Calls 1

makeMethod · 0.45

Tested by

no test coverage detected