File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
packages/opencode/src/provider Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -598,11 +598,14 @@ export namespace Provider {
598598 providerID : provider . id ,
599599 name : model . name ,
600600 family : model . family ,
601- api : {
602- id : model . id ,
603- url : provider . api ! ,
604- npm : model . provider ?. npm ?? provider . npm ?? "@ai-sdk/openai-compatible" ,
605- } ,
601+ api : {
602+ id : model . id ,
603+ url : provider . api ! ,
604+ npm : iife ( ( ) => {
605+ if ( provider . id . startsWith ( "github-copilot" ) ) return "@ai-sdk/github-copilot"
606+ return model . provider ?. npm ?? provider . npm ?? "@ai-sdk/openai-compatible"
607+ } ) ,
608+ } ,
606609 status : model . status ?? "active" ,
607610 headers : model . headers ?? { } ,
608611 options : model . options ?? { } ,
@@ -908,16 +911,6 @@ export namespace Provider {
908911 continue
909912 }
910913
911- if ( providerID === "github-copilot" || providerID === "github-copilot-enterprise" ) {
912- provider . models = mapValues ( provider . models , ( model ) => ( {
913- ...model ,
914- api : {
915- ...model . api ,
916- npm : "@ai-sdk/github-copilot" ,
917- } ,
918- } ) )
919- }
920-
921914 const configProvider = config . provider ?. [ providerID ]
922915
923916 for ( const [ modelID , model ] of Object . entries ( provider . models ) ) {
You can’t perform that action at this time.
0 commit comments