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

Function request

packages/opencode/src/session/llm/native-request.ts:181–194  ·  view source on GitHub ↗
(input: RequestInput)

Source from the content-addressed store, hash-verified

179}
180
181export const request = (input: RequestInput) => {
182 const converted = messages(input.messages)
183 // This is the only native adapter boundary that should construct canonical
184 // @opencode-ai/llm request objects from opencode's session/AI SDK-shaped data.
185 return LLM.request({
186 model: model(input, input.headers),
187 system: [...(input.system ?? []).map(SystemPart.make), ...converted.system],
188 messages: converted.messages,
189 tools: tools(input.tools),
190 toolChoice: input.toolChoice,
191 generation: generation(input),
192 providerOptions: input.providerOptions,
193 })
194}
195
196export * as LLMNative from "./native-request"

Callers

nothing calls this directly

Calls 5

toolsFunction · 0.85
messagesFunction · 0.70
modelFunction · 0.70
generationFunction · 0.70
requestMethod · 0.45

Tested by

no test coverage detected