fix(llm): add community-registry api (#24131)

This commit is contained in:
Zexi Li
2026-01-28 14:30:53 +08:00
committed by GitHub
parent 3efe11450c
commit 86a47f9e86
3 changed files with 16 additions and 0 deletions
+1
View File
@@ -22,4 +22,5 @@ func init() {
cmd.Perform("public", new(commonoptions.BasePublicOptions))
cmd.Perform("private", new(commonoptions.BaseIdOptions))
cmd.PerformClass("import", new(options.LLMInstantModelImportOptions))
cmd.GetProperty(new(options.LLMInstantModelCommunityRegistryOptions))
}
+4
View File
@@ -962,3 +962,7 @@ func (model *SInstantModel) CleanupImportTmpDir(ctx context.Context, userCred mc
func (man *SInstantModelManager) GetOllamaRegistryYAML() string {
return apis.OLLAMA_REGISTRY_YAML
}
func (man *SInstantModelManager) GetPropertyCommunityRegistry(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error) {
return jsonutils.Marshal(apis.OllamaRegistry), nil
}
+11
View File
@@ -76,3 +76,14 @@ func (o *LLMInstantModelImportOptions) Params() (jsonutils.JSONObject, error) {
}
return jsonutils.Marshal(input), nil
}
type LLMInstantModelCommunityRegistryOptions struct {
}
func (o *LLMInstantModelCommunityRegistryOptions) Params() (jsonutils.JSONObject, error) {
return nil, nil
}
func (o *LLMInstantModelCommunityRegistryOptions) Property() string {
return "community-registry"
}