mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 10:14:35 +08:00
Go CLI: update list supported models (#15845)
### What problem does this PR solve? Now list supported models will show more info. ``` RAGFlow(api/default)> list supported models from 'gitee' 'test'; +-----------+------------+-------------+----------------------------------------------------------+---------------------------------------------+ | dimension | max_tokens | model_types | name | thinking | +-----------+------------+-------------+----------------------------------------------------------+---------------------------------------------+ | | | | Wan2.7 | | | | | | HappyHorse-1.0 | | | | | | Qwen3.6-27B@Qwen | | | | | | Qwen3.6-35B-A3B@Qwen | | | | 1048576 | [chat] | DeepSeek-V4-Flash@deepseek-ai | map[clear_thinking:true default_value:true] | | | 1048576 | [chat] | DeepSeek-V4-Pro@deepseek-ai | map[clear_thinking:true default_value:true] | +-----------+------------+-------------+----------------------------------------------------------+---------------------------------------------+ ``` ### Type of change - [x] New Feature (non-breaking change which adds functionality) Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -115,7 +115,7 @@ func (b *BuiltinModel) Embed(modelName *string, texts []string, apiConfig *APICo
|
||||
for i, emb := range embeddings {
|
||||
result[i] = EmbeddingData{
|
||||
Embedding: emb,
|
||||
Index: i,
|
||||
Index: i,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,8 +150,12 @@ func (b *BuiltinModel) ParseFile(modelName *string, content []byte, url *string,
|
||||
return nil, fmt.Errorf("builtin model does not support parse file")
|
||||
}
|
||||
|
||||
func (b *BuiltinModel) ListModels(apiConfig *APIConfig) ([]string, error) {
|
||||
return []string{b.model}, nil
|
||||
func (b *BuiltinModel) ListModels(apiConfig *APIConfig) ([]ListModelResponse, error) {
|
||||
return []ListModelResponse{
|
||||
{
|
||||
Name: b.model,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (b *BuiltinModel) Balance(apiConfig *APIConfig) (map[string]interface{}, error) {
|
||||
@@ -189,4 +193,4 @@ func getEnv(key, defaultValue string) string {
|
||||
return value
|
||||
}
|
||||
return defaultValue
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user