mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-12-28 02:35:56 +08:00
feat: add embedding-2 support for zhipu (#1273)
* 增加对智谱embedding-2模型的支持 * fix: fix usage & ratio --------- Co-authored-by: yangfei <yangfei@xuyao.info> Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
@@ -44,3 +44,21 @@ type tokenData struct {
|
||||
Token string
|
||||
ExpiryTime time.Time
|
||||
}
|
||||
|
||||
type EmbeddingRequest struct {
|
||||
Model string `json:"model"`
|
||||
Input string `json:"input"`
|
||||
}
|
||||
|
||||
type EmbeddingRespone struct {
|
||||
Model string `json:"model"`
|
||||
Object string `json:"object"`
|
||||
Embeddings []EmbeddingData `json:"data"`
|
||||
model.Usage `json:"usage"`
|
||||
}
|
||||
|
||||
type EmbeddingData struct {
|
||||
Index int `json:"index"`
|
||||
Object string `json:"object"`
|
||||
Embedding []float64 `json:"embedding"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user