

文档 AWS SDK 示例 GitHub 存储库中还有更多 [S AWS DK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Amazon Bedrock Runtime 的代码示例 AWS SDKs
<a name="bedrock-runtime_code_examples"></a>

以下代码示例向您展示了如何将 Amazon Bedrock Runtime 与 AWS 软件开发套件 (SDK) 一起使用。

*场景*是向您展示如何通过在一个服务中调用多个函数或与其他 AWS 服务服务结合来完成特定任务的代码示例。

**更多资源**
+  **[Amazon Bedrock 运行时系统用户指南](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html)**——有关 Amazon Bedrock 运行时系统的更多信息。
+ **[Amazon Bedrock 运行时系统 API 参考](https://docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html)**——有关所有可用的 Amazon Bedrock 运行时系统操作的详细信息。
+ **[AWS 开发者中心](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23bedrock)** — 您可以按类别或全文搜索筛选的代码示例。
+ **[AWS SDK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)** — 包含首选语言完整代码的 GitHub 存储库。包括有关设置和运行代码的说明。

**Contents**
+ [基本功能](bedrock-runtime_code_examples_basics.md)
  + [开始使用 Amazon Bedrock](bedrock-runtime_example_bedrock-runtime_Hello_section.md)
+ [场景](bedrock-runtime_code_examples_scenarios.md)
  + [创建用于与 Amazon Bedrock 基础模型进行交互的平台应用程序](bedrock-runtime_example_cross_FMPlayground_section.md)
  + [创建并调用托管式提示](bedrock-runtime_example_bedrock-agent_GettingStartedWithBedrockPrompts_section.md)
  + [使用 Amazon Bedrock 根据文本提示生成视频](bedrock-runtime_example_bedrock-runtime_Scenario_GenerateVideos_NovaReel_section.md)
  + [在 Amazon Bedrock 上调用多个基础模型](bedrock-runtime_example_bedrock-runtime_Scenario_InvokeModels_section.md)
  + [使用 Step Functions 编排生成式人工智能应用程序](bedrock-runtime_example_cross_ServerlessPromptChaining_section.md)
  + [将工具与 Converse API 结合使用](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUse_section.md)
+ [Amazon Nova](bedrock-runtime_code_examples_amazon_nova.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_AmazonNovaText_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_AmazonNovaText_section.md)
  + [文档理解](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_AmazonNova_section.md)
  + [场景：将工具与 Converse API 搭配使用](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_AmazonNova_section.md)
+ [Amazon Nova Canvas](bedrock-runtime_code_examples_amazon_nova_canvas.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_AmazonNovaImageGeneration_section.md)
+ [Amazon Nova Reel](bedrock-runtime_code_examples_amazon_nova_reel.md)
  + [T ext-to-video](bedrock-runtime_example_bedrock-runtime_Scenario_AmazonNova_TextToVideo_section.md)
+ [Amazon Titan 图像生成器](bedrock-runtime_code_examples_amazon_titan_image_generator.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_TitanImageGenerator_section.md)
+ [Amazon Titan Text](bedrock-runtime_code_examples_amazon_titan_text.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_TitanText_section.md)
+ [Amazon Titan 文本嵌入](bedrock-runtime_code_examples_amazon_titan_text_embeddings.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_TitanTextEmbeddings_section.md)
+ [Anthropic Claude](bedrock-runtime_code_examples_anthropic_claude.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_AnthropicClaude_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_AnthropicClaude_section.md)
  + [文档理解](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_AnthropicClaude_section.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_AnthropicClaude_section.md)
  + [InvokeModelWithResponseStream](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_AnthropicClaude_section.md)
  + [推理](bedrock-runtime_example_bedrock-runtime_Converse_AnthropicClaudeReasoning_section.md)
  + [使用流式响应进行推理](bedrock-runtime_example_bedrock-runtime_ConverseStream_AnthropicClaudeReasoning_section.md)
  + [场景：将工具与 Converse API 搭配使用](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_AnthropicClaude_section.md)
+ [Cohere Command](bedrock-runtime_code_examples_cohere_command.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_CohereCommand_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_CohereCommand_section.md)
  + [文档理解](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_CohereCommand_section.md)
  + [InvokeModel: 命令 R 和 R\+](bedrock-runtime_example_bedrock-runtime_InvokeModel_CohereCommandR_section.md)
  + [InvokeModelWithResponseStream: 命令 R 和 R\+](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_CohereCommandR_section.md)
  + [场景：将工具与 Converse API 搭配使用](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_CohereCommand_section.md)
+ [DeepSeek](bedrock-runtime_code_examples_deepseek.md)
  + [文档理解](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_DeepSeek_section.md)
+ [Meta Llama](bedrock-runtime_code_examples_meta_llama.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_MetaLlama_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_MetaLlama_section.md)
  + [文档理解](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_MetaLlama_section.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_MetaLlama3_section.md)
  + [InvokeModelWithResponseStream](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_MetaLlama3_section.md)
+ [Mistral AI](bedrock-runtime_code_examples_mistral_ai.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_Mistral_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_Mistral_section.md)
  + [文档理解](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_Mistral_section.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_MistralAi_section.md)
  + [InvokeModelWithResponseStream](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_MistralAi_section.md)
+ [Stable Diffusion](bedrock-runtime_code_examples_stable_diffusion.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_StableDiffusion_section.md)