> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-docs-zh.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# BedrockEmbeddings 集成

> 使用 LangChain Python 集成 BedrockEmbeddings 嵌入模型。

> [Amazon Bedrock](https://aws.amazon.com/bedrock/) 是一个完全托管的服务，提供来自 `AI21 Labs`、`Anthropic`、`Cohere`、`Meta`、`Stability AI` 和 `Amazon` 等领先 AI 公司的高性能基础模型（FMs）的单一 API，并附带构建生成式 AI 应用所需的广泛功能，涵盖安全、隐私和负责任 AI。通过 `Amazon Bedrock`，您可以轻松实验并评估适用于业务场景的顶尖 FMs，利用您的数据进行私有化定制（如通过微调和 `Retrieval Augmented Generation`（`RAG`）），并构建能够执行任务、调用企业系统和数据源的智能体。由于 `Amazon Bedrock` 是无服务架构，您无需管理任何基础设施，并可通过已熟悉的 AWS 服务安全集成和部署生成式 AI 功能到您的应用程序中。

```python theme={null}
pip install -qU  boto3
```

```python theme={null}
from langchain_aws import BedrockEmbeddings

embeddings = BedrockEmbeddings(
    credentials_profile_name="bedrock-admin", region_name="us-east-1"
)
```

```python theme={null}
embeddings.embed_query("This is a content of the document")
```

```python theme={null}
embeddings.embed_documents(
    ["This is a content of the document", "This is another document"]
)
```

```python theme={null}
# async embed query
await embeddings.aembed_query("This is a content of the document")
```

```python theme={null}
# async embed documents
await embeddings.aembed_documents(
    ["This is a content of the document", "This is another document"]
)
```

***

> 官方原文：[src/oss/python/integrations/embeddings/bedrock.mdx](https://github.com/langchain-ai/docs/blob/main/src/oss/python/integrations/embeddings/bedrock.mdx) · 非官方翻译，译文由 AI 生成，以英文原文为准。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.