songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
17.71k stars 4.02k forks source link

智谱的embeddings 接口有问题 #1364

Open yc-2503 opened 4 months ago

yc-2503 commented 4 months ago

例行检查

问题描述 OPENAI 的embeddings 接口的input是 数组,而智谱的input 是string 复现步骤 {"model":"embedding-2","input":["My name is Andrea"]} {"error":{"message":"Panic detected, error: interface conversion: interface {} is []interface {}, not string. Please submit an issue with the related log here: https://github.com/songquanpeng/one-api","type":"one_api_panic"}}

预期结果

相关截图 image

RexWzh commented 4 months ago

智谱只支持字符串,不能字符列表:

Ref 智谱文档: https://open.bigmodel.cn/dev/api#text_embedding

image

关联问题: https://github.com/songquanpeng/one-api/issues/1291

gaord commented 4 months ago

使用langchain访问glm embedding-2报一样的错误。oneapi使用v0.6.5。

alex521 commented 4 months ago

同样的问题,换成别家的embedding模型就能正常使用

c121914yu commented 3 months ago

智谱这个就离谱,还说对齐~ @songquanpeng 智谱的单独把数组转字符串?