MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / registryModelToPluginModel

Function registryModelToPluginModel

sdk/pluginhost/host.go:229–254  ·  view source on GitHub ↗
(model *internalregistry.ModelInfo)

Source from the content-addressed store, hash-verified

227}
228
229func registryModelToPluginModel(model *internalregistry.ModelInfo) ModelInfo {
230 if model == nil {
231 return ModelInfo{}
232 }
233 return ModelInfo{
234 ID: model.ID,
235 Object: model.Object,
236 Created: model.Created,
237 OwnedBy: model.OwnedBy,
238 Type: model.Type,
239 DisplayName: model.DisplayName,
240 Name: model.Name,
241 Version: model.Version,
242 Description: model.Description,
243 InputTokenLimit: int64(model.InputTokenLimit),
244 OutputTokenLimit: int64(model.OutputTokenLimit),
245 SupportedGenerationMethods: cloneStringSlice(model.SupportedGenerationMethods),
246 ContextLength: int64(model.ContextLength),
247 MaxCompletionTokens: int64(model.MaxCompletionTokens),
248 SupportedParameters: cloneStringSlice(model.SupportedParameters),
249 SupportedInputModalities: cloneStringSlice(model.SupportedInputModalities),
250 SupportedOutputModalities: cloneStringSlice(model.SupportedOutputModalities),
251 Thinking: thinkingSupportToPlugin(model.Thinking),
252 UserDefined: model.UserDefined,
253 }
254}
255
256func thinkingSupportToPlugin(thinking *internalregistry.ThinkingSupport) *ThinkingSupport {
257 if thinking == nil {

Callers 1

Calls 2

thinkingSupportToPluginFunction · 0.85
cloneStringSliceFunction · 0.70

Tested by

no test coverage detected