MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / editAIService

Method editAIService

controller/service/iml.go:484–503  ·  view source on GitHub ↗
(ctx *gin.Context, id string, input *service_dto.EditService)

Source from the content-addressed store, hash-verified

482}
483
484func (i *imlServiceController) editAIService(ctx *gin.Context, id string, input *service_dto.EditService) (*service_dto.Service, error) {
485
486 if input.Provider == nil {
487 return nil, fmt.Errorf("provider is required")
488 }
489 if *input.Provider != ai_provider_local.ProviderLocal {
490 _, has := model_runtime.GetProvider(*input.Provider)
491 if !has {
492 return nil, fmt.Errorf("provider not found")
493 }
494 }
495
496 info, err := i.module.Edit(ctx, id, input)
497 if err != nil {
498 return nil, err
499 }
500 //_, err = i.upstreamModule.Save(ctx, id, newAIUpstream(id, *input.Provider, p.URI()))
501
502 return info, nil
503}
504
505func (i *imlServiceController) createAIService(ctx *gin.Context, teamID string, input *service_dto.CreateService) (*service_dto.Service, error) {
506 if input.Provider == nil {

Callers 1

EditMethod · 0.95

Calls 1

EditMethod · 0.65

Tested by

no test coverage detected