MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / FromEntity

Function FromEntity

service/ai-api/model.go:59–83  ·  view source on GitHub ↗
(e *api.AiAPIInfo)

Source from the content-addressed store, hash-verified

57}
58
59func FromEntity(e *api.AiAPIInfo) *API {
60 cfg := make(map[string]interface{})
61 if e.AdditionalConfig != "" {
62 _ = json.Unmarshal([]byte(e.AdditionalConfig), &cfg)
63 }
64 return &API{
65 ID: e.Uuid,
66 Name: e.Name,
67 Service: e.Service,
68 Path: e.Path,
69 Description: e.Description,
70 Timeout: e.Timeout,
71 Retry: e.Retry,
72 Model: e.Model,
73 CreateAt: e.CreateAt,
74 UpdateAt: e.UpdateAt,
75 Creator: e.Creator,
76 Updater: e.Updater,
77 Disable: e.Disable,
78 UseToken: e.UseToken,
79 Provider: e.Provider,
80 Type: e.Type,
81 AdditionalConfig: cfg,
82 }
83}
84
85type APIUse struct {
86 API string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected