主题
Cohere
Maven 依赖
xml
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-cohere</artifactId>
<version>1.22.0-beta32</version>
</dependency>1
2
3
4
5
2
3
4
5
API
CohereEmbeddingModel
能力
- 多模态(
embed-v4.0):将文本和图像嵌入到共享的向量空间;交错的文本 + 图像会融合为单个嵌入。在EmbeddingRequest中以ImageContent(URL 或 base64)提供图像输入。 - 逐次调用参数:
input_type—— 对查询和文档采用不同的嵌入方式 (EmbeddingInputType.QUERY/DOCUMENT,映射到 Cohere 的search_query/search_document)。 - 监听器:通过
CohereEmbeddingModel.builder().listeners(...)配置。
关于请求/响应 API 及多模态用法,参见嵌入模型。