Skip to content

Commit 1dcaa66

Browse files
vegerotOpenCode
andcommitted
test(provider): guarantee @ai-sdk/openai defaults to responses
Co-authored-by: OpenCode <opencode@users.noreply.github.com>
1 parent 4702cdd commit 1dcaa66

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

packages/core/test/plugin/provider-openai.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,31 @@ describe("OpenAIPlugin", () => {
5555
}),
5656
)
5757

58+
it.effect("defaults @ai-sdk/openai languageModel() to the Responses API", () =>
59+
Effect.gen(function* () {
60+
const plugin = yield* PluginV2.Service
61+
yield* plugin.add(OpenAIPlugin)
62+
63+
const result = yield* plugin.trigger(
64+
"aisdk.sdk",
65+
{
66+
model: model("custom-openai", "alias", {
67+
apiID: ModelV2.ID.make("gpt-5"),
68+
endpoint: {
69+
type: "aisdk",
70+
package: "@ai-sdk/openai",
71+
},
72+
}),
73+
package: "@ai-sdk/openai",
74+
options: { name: "custom-openai", apiKey: "test" },
75+
},
76+
{},
77+
)
78+
79+
expect(result.sdk?.languageModel("gpt-5").provider).toBe("custom-openai.responses")
80+
}),
81+
)
82+
5883
it.effect("ignores non-OpenAI providers", () =>
5984
Effect.gen(function* () {
6085
const plugin = yield* PluginV2.Service

0 commit comments

Comments
 (0)