首页/AI/RAG 与向量库速查/Cohere Embed 与 input_type
Embedding 与检索50 条

Cohere Embed 与 input_type

Cohere 托管 embedding 接口区分 input_type(search_document / search_query 等):入库文档与检索查询要使用对应类型,类型错配会损失效果。

RAG 与向量库速查AI更新于 2026-10-12

查询与文档分别调用

查询与文档分别调用
import cohere

co = cohere.Client()
resp = co.embed(
    texts=["超时配置说明…"],
    model="embed-multilingual-v3.0",
    input_type="search_document",     # 查询侧改为 search_query
)
print(len(resp.embeddings[0]))
批量上限与计费口径以官方文档为准;大批量请求分批发送更稳妥。

易错点

  • 查询与文档侧 input_type 混用,检索质量下降
  • 不控制批量大小,大量小请求拉高延迟与成本

数据来源与参考

  • Cohere 官方文档(Embed API)
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌