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

# BedrockEmbeddings 集成

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

> [Amazon Bedrock](https://aws.amazon.com/bedrock/) 是一项全托管服务，通过单一 API 提供来自领先 AI 公司（如 `AI21 Labs`、`Anthropic`、`Cohere`、`Meta`、`Stability AI` 和 `Amazon`）的高性能基础模型（FMs）选择，并配备构建生成式 AI 应用所需的一系列广泛功能，涵盖安全性、隐私性和负责任 AI。使用 `Amazon Bedrock`，您可以轻松针对您的用例试验和评估顶级 FMs，通过微调和 `检索增强生成`（`RAG`）等技术使用您的数据私密地定制模型，并构建利用您的企业系统和数据源执行任务的智能体。由于 `Amazon Bedrock` 是无服务器的，您无需管理任何基础设施，并且可以使用您已经熟悉的 AWS 服务，安全地将生成式 AI 功能集成并部署到您的应用程序中。

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
pip install -qU  boto3
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_aws import BedrockEmbeddings

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

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
embeddings.embed_query("这是文档的内容")
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
embeddings.embed_documents(
    ["这是文档的内容", "这是另一份文档"]
)
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
# 异步嵌入查询
await embeddings.aembed_query("这是文档的内容")
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
# 异步嵌入文档
await embeddings.aembed_documents(
    ["这是文档的内容", "这是另一份文档"]
)
```

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\oss\python\integrations\embeddings\bedrock.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
