Ernie Embedding v1 是百度以中文优先的 embedding 模型,生成针对简体中文文本优化的 384 维向量。在短查询为主的场景中,它是中文语义搜索和推荐用例的高性价比默认选择。
直接替换OpenAI。只需改base_url和模型。
# Python - pip install openai from openai import OpenAI client = OpenAI( base_url="https://meshtok.com/v1", api_key="sk-your-MeshTok-key", ) resp = client.chat.completions.create( model="baidu/embedding-v1", messages=[{"role":"user","content":"Hello!"}], ) print(resp.choices[0].message.content)
# cURL curl https://meshtok.com/v1/chat/completions \ -H "Authorization: Bearer sk-your-MeshTok-key" \ -H "Content-Type: application/json" \ -d '{"model":"baidu/embedding-v1","messages":[{"role":"user","content":"Hello!"}]}'
你可能考虑的其他模型。
Fast and cost-efficient.
Fast and cost-efficient.
Fast and cost-efficient.
Fast and cost-efficient.