mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-29 09:16:36 +00:00
fix: rm exclusion of ai-sdk/azure in transform.ts, when we migrated to v6 the ai sdk changed the key for ai-sdk/azure so the exclusion is no longer needed (#20326)
This commit is contained in:
@@ -1557,6 +1557,35 @@ describe("ProviderTransform.message - providerOptions key remapping", () => {
|
||||
expect(result[0].providerOptions?.openai).toBeUndefined()
|
||||
})
|
||||
|
||||
test("azure cognitive services remaps providerID to 'azure' key", () => {
|
||||
const model = createModel("azure-cognitive-services", "@ai-sdk/azure")
|
||||
const msgs = [
|
||||
{
|
||||
role: "user",
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: "Hello",
|
||||
providerOptions: {
|
||||
"azure-cognitive-services": { part: true },
|
||||
},
|
||||
},
|
||||
],
|
||||
providerOptions: {
|
||||
"azure-cognitive-services": { someOption: "value" },
|
||||
},
|
||||
},
|
||||
] as any[]
|
||||
|
||||
const result = ProviderTransform.message(msgs, model, {}) as any[]
|
||||
const part = result[0].content[0] as any
|
||||
|
||||
expect(result[0].providerOptions?.azure).toEqual({ someOption: "value" })
|
||||
expect(result[0].providerOptions?.["azure-cognitive-services"]).toBeUndefined()
|
||||
expect(part.providerOptions?.azure).toEqual({ part: true })
|
||||
expect(part.providerOptions?.["azure-cognitive-services"]).toBeUndefined()
|
||||
})
|
||||
|
||||
test("copilot remaps providerID to 'copilot' key", () => {
|
||||
const model = createModel("github-copilot", "@ai-sdk/github-copilot")
|
||||
const msgs = [
|
||||
|
||||
Reference in New Issue
Block a user