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

Function createChatModel

packages/core/src/github-copilot/copilot-provider.ts:68–75  ·  view source on GitHub ↗
(modelId: OpenaiCompatibleModelId)

Source from the content-addressed store, hash-verified

66 const getHeaders = () => withUserAgentSuffix(headers, `ai-sdk/openai-compatible/${VERSION}`)
67
68 const createChatModel = (modelId: OpenaiCompatibleModelId) => {
69 return new OpenAICompatibleChatLanguageModel(modelId, {
70 provider: `${options.name ?? "openai-compatible"}.chat`,
71 headers: getHeaders,
72 url: ({ path }) => `${baseURL}${path}`,
73 fetch: options.fetch,
74 })
75 }
76
77 const createResponsesModel = (modelId: OpenaiCompatibleModelId) => {
78 return new OpenAIResponsesLanguageModel(modelId, {

Callers 2

createLanguageModelFunction · 0.85
providerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected