File tree Expand file tree Collapse file tree
packages/core/test/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments