mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 10:14:35 +08:00
Refactor model in GO (#14398)
### What problem does this PR solve? Refactor model in GO ### Type of change - [x] Refactoring
This commit is contained in:
@@ -367,6 +367,21 @@ func (z *GiteeModel) EncodeToEmbedding(modelName *string, texts []string, apiCon
|
||||
return nil, fmt.Errorf("%s, no such method", z.Name())
|
||||
}
|
||||
|
||||
// Encode encodes a list of texts into embeddings (convenience method)
|
||||
func (z *GiteeModel) Encode(modelName *string, texts []string, apiConfig *APIConfig) ([][]float64, error) {
|
||||
return nil, fmt.Errorf("%s, Encode not implemented", z.Name())
|
||||
}
|
||||
|
||||
// EncodeQuery encodes a single query string into embedding (convenience method)
|
||||
func (z *GiteeModel) EncodeQuery(modelName *string, query string, apiConfig *APIConfig) ([]float64, error) {
|
||||
return nil, fmt.Errorf("%s, EncodeQuery not implemented", z.Name())
|
||||
}
|
||||
|
||||
// Rerank calculates similarity scores between query and texts
|
||||
func (z *GiteeModel) Rerank(modelName *string, query string, texts []string, apiConfig *APIConfig) ([]float64, error) {
|
||||
return nil, fmt.Errorf("%s, Rerank not implemented", z.Name())
|
||||
}
|
||||
|
||||
func (z *GiteeModel) ListModels(apiConfig *APIConfig) ([]string, error) {
|
||||
var region = "default"
|
||||
if apiConfig.Region != nil {
|
||||
|
||||
Reference in New Issue
Block a user