mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-30 09:23:33 +00:00
feat(ai): type OpenRouter request options (#39508)
This commit is contained in:
parent
9d6af6afa4
commit
5a78a17e49
2 changed files with 14 additions and 1 deletions
|
|
@ -107,7 +107,7 @@ export const configure = (input: ModelOptions = {}) => {
|
|||
const route = configuredRoute(input)
|
||||
return {
|
||||
id,
|
||||
model: (modelID: string | ModelID) => route.model({ id: modelID }),
|
||||
model: (modelID: string | ModelID) => route.model<OpenRouterProviderOptionsInput>({ id: modelID }),
|
||||
configure,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
13
packages/ai/test/provider-options/openrouter.types.ts
Normal file
13
packages/ai/test/provider-options/openrouter.types.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { LLM } from "../../src"
|
||||
import { OpenRouter } from "../../src/providers"
|
||||
|
||||
const model = OpenRouter.provider.model("anthropic/claude-sonnet-4.5")
|
||||
|
||||
LLM.request({ model, prompt: "Hello", providerOptions: { openrouter: { usage: true } } })
|
||||
|
||||
LLM.request({
|
||||
model,
|
||||
prompt: "Hello",
|
||||
// @ts-expect-error OpenRouter usage must be boolean or an option record.
|
||||
providerOptions: { openrouter: { usage: "yes" } },
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue