MCPcopy Index your code
hub / github.com/anomalyco/opencode / createModel

Function createModel

packages/opencode/test/session/compaction.test.ts:59–87  ·  view source on GitHub ↗
(opts: {
  context: number
  output: number
  input?: number
  cost?: Provider.Model["cost"]
  npm?: string
})

Source from the content-addressed store, hash-verified

57})
58
59function createModel(opts: {
60 context: number
61 output: number
62 input?: number
63 cost?: Provider.Model["cost"]
64 npm?: string
65}): Provider.Model {
66 return {
67 id: "test-model",
68 providerID: "test",
69 name: "Test",
70 limit: {
71 context: opts.context,
72 input: opts.input,
73 output: opts.output,
74 },
75 cost: opts.cost ?? { input: 0, output: 0, cache: { read: 0, write: 0 } },
76 capabilities: {
77 toolcall: true,
78 attachment: false,
79 reasoning: false,
80 temperature: true,
81 input: { text: true, image: false, audio: false, video: false },
82 output: { text: true, image: false, audio: false, video: false },
83 },
84 api: { npm: opts.npm ?? "@ai-sdk/anthropic" },
85 options: {},
86 } as Provider.Model
87}
88
89const wide = () => ProviderTest.fake({ model: createModel({ context: 100_000, output: 32_000 }) })
90

Callers 2

wideFunction · 0.70
compaction.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected