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:
qinling0210
2026-04-28 12:59:01 +08:00
committed by GitHub
parent 5885691c68
commit effc84a042
28 changed files with 575 additions and 1078 deletions
+15
View File
@@ -401,6 +401,16 @@ func (z *DeepSeekModel) EncodeToEmbedding(modelName *string, texts []string, api
return nil, fmt.Errorf("%s, no such method", z.Name())
}
// Encode encodes a list of texts into embeddings (convenience method)
func (z *DeepSeekModel) 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 *DeepSeekModel) EncodeQuery(modelName *string, query string, apiConfig *APIConfig) ([]float64, error) {
return nil, fmt.Errorf("%s, EncodeQuery not implemented", z.Name())
}
type DSModel struct {
ID string `json:"id"`
Object string `json:"object"`
@@ -476,3 +486,8 @@ func (z *DeepSeekModel) CheckConnection(apiConfig *APIConfig) error {
}
return nil
}
// Rerank calculates similarity scores between query and texts
func (z *DeepSeekModel) Rerank(modelName *string, query string, texts []string, apiConfig *APIConfig) ([]float64, error) {
return nil, fmt.Errorf("%s, Rerank not implemented", z.Name())
}