mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
* feat(aiproxy): expose catalog context window on AI models Populate known 1M+ context windows in catalog seed data and return context_window in AI model list/detail API responses. * feat(aiproxy): add instance test-connectivity and set-models actions Add provider instance test-connectivity using stored ai_key secrets, and set-models to import selected catalog models while skipping existing model_key rows. Register corresponding climc perform commands.
36 lines
1.4 KiB
Go
36 lines
1.4 KiB
Go
// Copyright 2019 Yunion
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package aiproxy
|
|
|
|
import (
|
|
"yunion.io/x/onecloud/cmd/climc/shell"
|
|
apmodules "yunion.io/x/onecloud/pkg/mcclient/modules/aiproxy"
|
|
"yunion.io/x/onecloud/pkg/mcclient/options"
|
|
apoptions "yunion.io/x/onecloud/pkg/mcclient/options/aiproxy"
|
|
)
|
|
|
|
func init() {
|
|
cmd := shell.NewResourceCmd(&apmodules.AiProviders)
|
|
cmd.Create(new(apoptions.AiProviderCreateOptions))
|
|
cmd.List(new(apoptions.AiProviderListOptions))
|
|
cmd.Show(new(apoptions.AiProviderShowOptions))
|
|
cmd.Update(new(apoptions.AiProviderUpdateOptions))
|
|
cmd.Delete(new(apoptions.AiProviderDeleteOptions))
|
|
cmd.PerformClass("test-connectivity", new(apoptions.AiProviderTestConnectivityOptions))
|
|
cmd.Perform("test-connectivity", new(options.BaseIdOptions))
|
|
cmd.Perform("set-models", new(apoptions.AiProviderSetModelsOptions))
|
|
registerEnableDisable(cmd)
|
|
}
|