feat: update Ollama embedding API to latest version with multi-text embedding support (#1715)

This commit is contained in:
SLKun
2024-08-06 23:43:20 +08:00
committed by GitHub
parent 402fcf7f79
commit e7e99e558a
3 changed files with 26 additions and 13 deletions

View File

@@ -24,7 +24,7 @@ func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error) {
// https://github.com/ollama/ollama/blob/main/docs/api.md
fullRequestURL := fmt.Sprintf("%s/api/chat", meta.BaseURL)
if meta.Mode == relaymode.Embeddings {
fullRequestURL = fmt.Sprintf("%s/api/embeddings", meta.BaseURL)
fullRequestURL = fmt.Sprintf("%s/api/embed", meta.BaseURL)
}
return fullRequestURL, nil
}