feat(provider): load catalog request variants
This commit is contained in:
parent
d00d274192
commit
75ab5ceae9
11 changed files with 207 additions and 243 deletions
|
|
@ -55,7 +55,6 @@ const PROTOCOL_BODY_OVERLAY_DENYLIST = new Set([
|
|||
"systemInstruction",
|
||||
"system_instruction",
|
||||
"temperature",
|
||||
"thinking",
|
||||
"toolChoice",
|
||||
"toolConfig",
|
||||
"tool_choice",
|
||||
|
|
|
|||
|
|
@ -156,6 +156,32 @@ describe("request option precedence", () => {
|
|||
}),
|
||||
)
|
||||
|
||||
it.effect("allows provider thinking body overlays", () =>
|
||||
LLMClient.generate(
|
||||
LLM.request({
|
||||
model: OpenAIChat.route
|
||||
.with({
|
||||
endpoint: { baseURL: "https://api.provider.test/v1/" },
|
||||
auth: Auth.bearer("test"),
|
||||
http: { body: { thinking: { type: "adaptive" } } },
|
||||
})
|
||||
.model({ id: "minimax-m3" }),
|
||||
prompt: "Say hello.",
|
||||
}),
|
||||
).pipe(
|
||||
Effect.provide(
|
||||
dynamicResponse((input) => {
|
||||
expect(decodeJson(input.text)).toMatchObject({ thinking: { type: "adaptive" } })
|
||||
return Effect.succeed(
|
||||
input.respond(sseEvents(deltaChunk({}, "stop")), {
|
||||
headers: { "content-type": "text/event-stream" },
|
||||
}),
|
||||
)
|
||||
}),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
it.effect("uses model output limits after route limits and before call maxTokens", () =>
|
||||
Effect.gen(function* () {
|
||||
const route = AnthropicMessages.route.with({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue