mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-23 08:56:42 +08:00
fix(go): nil pointer dereference in ZhipuAI Embed method (#17219)
This commit is contained in:
@@ -530,7 +530,7 @@ func (z *ZhipuAIModel) Embed(modelName *string, texts []string, apiConfig *APICo
|
||||
reqBody := map[string]interface{}{}
|
||||
reqBody["model"] = modelName
|
||||
reqBody["input"] = texts
|
||||
if embeddingConfig.Dimension > 0 {
|
||||
if embeddingConfig != nil && embeddingConfig.Dimension > 0 {
|
||||
reqBody["dimensions"] = embeddingConfig.Dimension
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user