MCPcopy
hub / github.com/anomalyco/opencode / modelInfo

Function modelInfo

packages/core/test/plugin/host.ts:280–303  ·  view source on GitHub ↗
(value: ModelV2.Info | ModelV2.MutableInfo)

Source from the content-addressed store, hash-verified

278}
279
280function modelInfo(value: ModelV2.Info | ModelV2.MutableInfo) {
281 return {
282 ...value,
283 api: { ...value.api, settings: value.api.settings && { ...value.api.settings } },
284 capabilities: {
285 ...value.capabilities,
286 input: [...value.capabilities.input],
287 output: [...value.capabilities.output],
288 },
289 request: {
290 ...value.request,
291 headers: { ...value.request.headers },
292 body: { ...value.request.body },
293 },
294 variants: value.variants.map((variant) => ({
295 ...variant,
296 headers: { ...variant.headers },
297 body: { ...variant.body },
298 })),
299 time: { ...value.time },
300 cost: value.cost.map((cost) => ({ ...cost, tier: cost.tier && { ...cost.tier }, cache: { ...cost.cache } })),
301 limit: { ...value.limit },
302 }
303}

Callers 1

catalogHostFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected