Mistral AI Embeddings
Spring AI 支持 Mistral AI 的文本 embeddings 模型。 Embeddings 是文本的向量表示,通过它们在高维向量空间中的位置捕获段落的语义含义。Mistral AI Embeddings API 提供最先进的文本 embeddings,可用于许多 NLP 任务。
可用模型
Mistral AI 提供两个 embedding 模型,每个都针对不同的用例进行了优化:
| Model | Dimensions | Use Case | Description |
|---|---|---|---|
mistral-embed | 1024 | General text | 适用于语义搜索、聚类和文本相似性任务的通用 embedding 模型。适合自然语言内容。 |
codestral-embed | 1536 | Code | 专门针对代码相似性、代码搜索和代码仓库的检索增强生成 (RAG) 进行优化的 embedding 模型。提供专门为理解代码语义而设计的高维 embeddings。 |
选择模型时:
- 对于一般文本内容(如文档、文章或用户查询),使用
mistral-embed - 在处理代码、技术文档或构建代码感知的 RAG 系统时,使用
codestral-embed