fix(core): lower OpenAI text verbosity
This commit is contained in:
parent
f4afb2c0a5
commit
25c6abc31a
2 changed files with 21 additions and 3 deletions
|
|
@ -40,7 +40,14 @@ const openai: Lowerer = {
|
|||
settings: omit(options, ["apiKey", "baseURL", "organization", "project", "headers", "body"]),
|
||||
}
|
||||
},
|
||||
request: snake,
|
||||
request(options) {
|
||||
const result = snake(options)
|
||||
if (options.textVerbosity !== undefined) {
|
||||
result.text = { ...(isRecord(result.text) ? result.text : {}), verbosity: options.textVerbosity }
|
||||
delete result.text_verbosity
|
||||
}
|
||||
return result
|
||||
},
|
||||
}
|
||||
|
||||
const anthropic: Lowerer = {
|
||||
|
|
|
|||
|
|
@ -39,8 +39,16 @@ describe("ConfigProviderOptionsV1", () => {
|
|||
body: { store: true },
|
||||
settings: { timeout: 1000 },
|
||||
})
|
||||
expect(lowerer.request({ reasoningEffort: "high", nestedValue: { camelCase: true } })).toEqual({
|
||||
expect(
|
||||
lowerer.request({
|
||||
reasoningEffort: "high",
|
||||
textVerbosity: "low",
|
||||
text: { outputFormat: "plain" },
|
||||
nestedValue: { camelCase: true },
|
||||
}),
|
||||
).toEqual({
|
||||
reasoning_effort: "high",
|
||||
text: { output_format: "plain", verbosity: "low" },
|
||||
nested_value: { camel_case: true },
|
||||
})
|
||||
})
|
||||
|
|
@ -130,7 +138,10 @@ describe("ConfigProviderOptionsV1", () => {
|
|||
body: { trace: true },
|
||||
settings: { resourceName: "resource" },
|
||||
})
|
||||
expect(lowerer.request({ reasoningEffort: "high" })).toEqual({ reasoning_effort: "high" })
|
||||
expect(lowerer.request({ reasoningEffort: "high", textVerbosity: "low" })).toEqual({
|
||||
reasoning_effort: "high",
|
||||
text: { verbosity: "low" },
|
||||
})
|
||||
})
|
||||
|
||||
test("lowers Amazon Bedrock provider and request options", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue