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

Function newModel

module/ai-model/iml.go:204–224  ·  view source on GitHub ↗
(provider string, model string, config string)

Source from the content-addressed store, hash-verified

202}
203
204func newModel(provider string, model string, config string) *gateway.DynamicRelease {
205 if config == "" {
206 config = "{}"
207 }
208 return &gateway.DynamicRelease{
209 BasicItem: &gateway.BasicItem{
210 ID: fmt.Sprintf("%s$%s", provider, model),
211 Description: fmt.Sprintf("auto generated model: %s, provider: %s", model, provider),
212 Resource: "ai-model",
213 Version: time.Now().Format("20060102150405"),
214 MatchLabels: map[string]string{
215 "module": "ai-model",
216 },
217 },
218 Attr: map[string]interface{}{
219 "provider": provider,
220 "model": model,
221 "access_config": config,
222 },
223 }
224}
225
226func (i *imlProviderModelModule) syncGateway(ctx context.Context, clusterId string, releases []*gateway.DynamicRelease, online bool) error {
227 client, err := i.clusterService.GatewayClient(ctx, clusterId)

Callers 2

UpdateProviderModelMethod · 0.85
AddProviderModelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected