概述
集成详情
设置
要访问 AI/ML API embedding 模型,您需要创建一个 账户,获取 API 密钥,并安装langchain-aimlapi 集成包。
凭证
前往 aimlapi.com to sign up 并生成 API 密钥。 完成后设置AIMLAPI_API_KEY 环境变量:
安装
LangChain 的 AI/ML API 集成位于langchain-aimlapi 包中:
实例化
Now we can instantiate our embeddings model and perform embedding operations:索引与检索
向量嵌入模型常用于检索增强生成 (RAG) 流程中. Below is how to index and retrieve data using theembeddings object we initialized above with InMemoryVectorStore.
直接使用
You can directly callembed_query and embed_documents for custom embedding scenarios.
Embed single text
Embed multiple texts
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

