refactor(llm): move queryParams off model.native to typed field
Promotes queryParams to a first-class ModelRef field used by Endpoint.baseURL, so deployment-level URL query params (Azure api-version, OpenAI-compatible provider knobs) live in a typed home instead of an opaque `native` bag. Also removes write-only dead fields from `native`: - openaiCompatibleProvider (set by family helper, never read) - opencodeProviderID, opencodeModelID (set by opencode bridge + native session builder, never read) - npm (set by opencode bridge, never read) After this commit `model.native` only carries genuinely provider-specific opaque options that no other adapter cares about (Bedrock's aws_credentials + aws_region for SigV4). Drops the now-dead ProviderShared.queryParams helper. Updates AGENTS.md doc on native is implicit through the new schema JSDoc.
This commit is contained in:
@@ -134,14 +134,9 @@ export const toModelRef = (input: Input): ModelRef | undefined => {
|
||||
baseURL: baseURL(input, resolution, options),
|
||||
apiKey: apiKey(input, resolution, options),
|
||||
headers: headers(input, options),
|
||||
queryParams: resolution.queryParams,
|
||||
capabilities: capabilities(input, resolution),
|
||||
limits: LLM.limits({ context: input.model.limit.context, output: input.model.limit.output }),
|
||||
native: {
|
||||
opencodeProviderID: input.provider.id,
|
||||
opencodeModelID: input.model.id,
|
||||
npm: input.model.api.npm,
|
||||
...(resolution.queryParams ? { queryParams: resolution.queryParams } : {}),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -249,11 +249,7 @@ export const request = Effect.fn("LLMNative.request")(function* (input: RequestI
|
||||
toolChoice: input.toolChoice,
|
||||
generation: input.generation,
|
||||
metadata: input.metadata,
|
||||
native: {
|
||||
opencodeProviderID: input.provider.id,
|
||||
opencodeModelID: input.model.id,
|
||||
...input.native,
|
||||
},
|
||||
native: input.native,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user