File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -128,17 +128,19 @@ func (i *imlProviderModelModule) DeleteProviderModel(ctx *gin.Context, provider
128128 if err := i .providerModelService .Delete (ctx , id ); err != nil {
129129 return err
130130 }
131- err = i .syncGateway (ctx , cluster .DefaultClusterID , []* gateway.DynamicRelease {
132- {
133- BasicItem : & gateway.BasicItem {
134- ID : fmt .Sprintf ("%s#%s" , provider , modelInfo .Name ),
135- Resource : "ai-model" ,
131+ if p .GetModelConfig ().AccessConfigurationStatus {
132+ err = i .syncGateway (ctx , cluster .DefaultClusterID , []* gateway.DynamicRelease {
133+ {
134+ BasicItem : & gateway.BasicItem {
135+ ID : fmt .Sprintf ("%s$%s" , provider , modelInfo .Name ),
136+ Resource : "ai-model" ,
137+ },
138+ Attr : nil ,
136139 },
137- Attr : nil ,
138- },
139- }, false )
140- if err != nil {
141- return err
140+ }, false )
141+ if err != nil {
142+ return err
143+ }
142144 }
143145
144146 p .RemoveModel (id )
@@ -200,7 +202,9 @@ func (i *imlProviderModelModule) AddProviderModel(ctx *gin.Context, provider str
200202}
201203
202204func newModel (provider string , model string , config string ) * gateway.DynamicRelease {
203-
205+ if config == "" {
206+ config = "{}"
207+ }
204208 return & gateway.DynamicRelease {
205209 BasicItem : & gateway.BasicItem {
206210 ID : fmt .Sprintf ("%s$%s" , provider , model ),
You can’t perform that action at this time.
0 commit comments