

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 AWS SDKs的 Amazon Bedrock 執行期程式碼範例
<a name="bedrock-runtime_code_examples"></a>

下列程式碼範例示範如何搭配 AWS 軟體開發套件 (SDK) 使用 Amazon Bedrock 執行期。

*案例*是向您展示如何呼叫服務中的多個函數或與其他 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)
  + [Hello 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 協調生成式 AI 應用程式](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)
  + [Text-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：Command R 和 R\+](bedrock-runtime_example_bedrock-runtime_InvokeModel_CohereCommandR_section.md)
  + [InvokeModelWithResponseStream：Command 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)