feat: 支持 ollama 的 embedding 接口 (#1221)

* 增加ollama的embedding接口

* chore: fix function name

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
xietong
2024-03-24 21:51:31 +08:00
committed by GitHub
parent e96b173abe
commit c243cd5535
3 changed files with 86 additions and 7 deletions

View File

@@ -35,3 +35,13 @@ type ChatResponse struct {
EvalDuration int `json:"eval_duration,omitempty"`
Error string `json:"error,omitempty"`
}
type EmbeddingRequest struct {
Model string `json:"model"`
Prompt string `json:"prompt"`
}
type EmbeddingResponse struct {
Error string `json:"error,omitempty"`
Embedding []float64 `json:"embedding,omitempty"`
}