

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

# Exemples de code pour Amazon Bedrock utilisant AWS SDKs
<a name="service_code_examples"></a>

Les exemples de code suivants montrent comment utiliser Amazon Bedrock avec un kit de développement AWS logiciel (SDK). 

Pour obtenir la liste complète des guides de développement du AWS SDK et des exemples de code, consultez[Utilisation d'Amazon Bedrock avec un SDK AWS](sdk-general-information-section.md). Cette rubrique comprend également des informations sur le démarrage et sur les versions précédentes du kit de développement logiciel (SDK).

**Contents**
+ [Amazon Bedrock](service_code_examples_bedrock.md)
  + [Principes de base](service_code_examples_bedrock_basics.md)
    + [Bonjour Amazon Bedrock](bedrock_example_bedrock_Hello_section.md)
    + [Actions](service_code_examples_bedrock_actions.md)
      + [`GetFoundationModel`](bedrock_example_bedrock_GetFoundationModel_section.md)
      + [`ListFoundationModels`](bedrock_example_bedrock_ListFoundationModels_section.md)
  + [Scénarios](service_code_examples_bedrock_scenarios.md)
    + [Orchestration des applications d’IA génératives avec Step Functions](bedrock_example_cross_ServerlessPromptChaining_section.md)
+ [Exécution d’Amazon Bedrock](service_code_examples_bedrock-runtime.md)
  + [Principes de base](service_code_examples_bedrock-runtime_basics.md)
    + [Bonjour Amazon Bedrock](bedrock-runtime_example_bedrock-runtime_Hello_section.md)
  + [Scénarios](service_code_examples_bedrock-runtime_scenarios.md)
    + [Création d’une application de terrain de jeu pour interagir avec les modèles de fondation Amazon Bedrock](bedrock-runtime_example_cross_FMPlayground_section.md)
    + [Création et invocation d’une invite gérée](bedrock-runtime_example_bedrock-agent_GettingStartedWithBedrockPrompts_section.md)
    + [Génération de vidéos à partir d’invites textuelles avec Amazon Bedrock](bedrock-runtime_example_bedrock-runtime_Scenario_GenerateVideos_NovaReel_section.md)
    + [Invocation de plusieurs modèles de fondation sur Amazon Bedrock](bedrock-runtime_example_bedrock-runtime_Scenario_InvokeModels_section.md)
    + [Orchestration des applications d’IA génératives avec Step Functions](bedrock-runtime_example_cross_ServerlessPromptChaining_section.md)
    + [Utilisation de l’outil avec l’API Converse](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUse_section.md)
  + [Amazon Nova](service_code_examples_bedrock-runtime_amazon_nova.md)
    + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_AmazonNovaText_section.md)
    + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_AmazonNovaText_section.md)
    + [Compréhension des documents](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_AmazonNova_section.md)
    + [Scénario : utilisation de l’outil avec l’API Converse](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_AmazonNova_section.md)
  + [Amazon Nova Canvas](service_code_examples_bedrock-runtime_amazon_nova_canvas.md)
    + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_AmazonNovaImageGeneration_section.md)
  + [Amazon Nova Reel](service_code_examples_bedrock-runtime_amazon_nova_reel.md)
    + [T ext-to-video](bedrock-runtime_example_bedrock-runtime_Scenario_AmazonNova_TextToVideo_section.md)
  + [Générateur d’images Amazon Titan](service_code_examples_bedrock-runtime_amazon_titan_image_generator.md)
    + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_TitanImageGenerator_section.md)
  + [Amazon Titan Text](service_code_examples_bedrock-runtime_amazon_titan_text.md)
    + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_TitanText_section.md)
  + [Plongement lexical Amazon Titan](service_code_examples_bedrock-runtime_amazon_titan_text_embeddings.md)
    + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_TitanTextEmbeddings_section.md)
  + [Anthropic Claude](service_code_examples_bedrock-runtime_anthropic_claude.md)
    + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_AnthropicClaude_section.md)
    + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_AnthropicClaude_section.md)
    + [Compréhension des documents](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)
    + [Raisonnement](bedrock-runtime_example_bedrock-runtime_Converse_AnthropicClaudeReasoning_section.md)
    + [Raisonnement avec une réponse en streaming](bedrock-runtime_example_bedrock-runtime_ConverseStream_AnthropicClaudeReasoning_section.md)
    + [Scénario : utilisation de l’outil avec l’API Converse](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_AnthropicClaude_section.md)
  + [Cohere Command](service_code_examples_bedrock-runtime_cohere_command.md)
    + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_CohereCommand_section.md)
    + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_CohereCommand_section.md)
    + [Compréhension des documents](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_CohereCommand_section.md)
    + [InvokeModel: Command R et R\+](bedrock-runtime_example_bedrock-runtime_InvokeModel_CohereCommandR_section.md)
    + [InvokeModelWithResponseStream: Command R et R\+](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_CohereCommandR_section.md)
    + [Scénario : utilisation de l’outil avec l’API Converse](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_CohereCommand_section.md)
  + [DeepSeek](service_code_examples_bedrock-runtime_deepseek.md)
    + [Compréhension des documents](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_DeepSeek_section.md)
  + [Meta Llama](service_code_examples_bedrock-runtime_meta_llama.md)
    + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_MetaLlama_section.md)
    + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_MetaLlama_section.md)
    + [Compréhension des documents](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](service_code_examples_bedrock-runtime_mistral_ai.md)
    + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_Mistral_section.md)
    + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_Mistral_section.md)
    + [Compréhension des documents](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](service_code_examples_bedrock-runtime_stable_diffusion.md)
    + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_StableDiffusion_section.md)
+ [Agents Amazon Bedrock](service_code_examples_bedrock-agent.md)
  + [Principes de base](service_code_examples_bedrock-agent_basics.md)
    + [Bonjour agents Amazon Bedrock](bedrock-agent_example_bedrock-agent_Hello_section.md)
    + [Actions](service_code_examples_bedrock-agent_actions.md)
      + [`CreateAgent`](bedrock-agent_example_bedrock-agent_CreateAgent_section.md)
      + [`CreateAgentActionGroup`](bedrock-agent_example_bedrock-agent_CreateAgentActionGroup_section.md)
      + [`CreateAgentAlias`](bedrock-agent_example_bedrock-agent_CreateAgentAlias_section.md)
      + [`CreateFlow`](bedrock-agent_example_bedrock-agent_CreateFlow_section.md)
      + [`CreateFlowAlias`](bedrock-agent_example_bedrock-agent_CreateFlowAlias_section.md)
      + [`CreateFlowVersion`](bedrock-agent_example_bedrock-agent_CreateFlowVersion_section.md)
      + [`CreateKnowledgeBase`](bedrock-agent_example_bedrock-agent_CreateKnowledgeBase_section.md)
      + [`CreatePrompt`](bedrock-agent_example_bedrock-agent_CreatePrompt_section.md)
      + [`CreatePromptVersion`](bedrock-agent_example_bedrock-agent_CreatePromptVersion_section.md)
      + [`DeleteAgent`](bedrock-agent_example_bedrock-agent_DeleteAgent_section.md)
      + [`DeleteAgentAlias`](bedrock-agent_example_bedrock-agent_DeleteAgentAlias_section.md)
      + [`DeleteFlow`](bedrock-agent_example_bedrock-agent_DeleteFlow_section.md)
      + [`DeleteFlowAlias`](bedrock-agent_example_bedrock-agent_DeleteFlowAlias_section.md)
      + [`DeleteFlowVersion`](bedrock-agent_example_bedrock-agent_DeleteFlowVersion_section.md)
      + [`DeleteKnowledgeBase`](bedrock-agent_example_bedrock-agent_DeleteKnowledgeBase_section.md)
      + [`DeletePrompt`](bedrock-agent_example_bedrock-agent_DeletePrompt_section.md)
      + [`GetAgent`](bedrock-agent_example_bedrock-agent_GetAgent_section.md)
      + [`GetFlow`](bedrock-agent_example_bedrock-agent_GetFlow_section.md)
      + [`GetFlowVersion`](bedrock-agent_example_bedrock-agent_GetFlowVersion_section.md)
      + [`GetKnowledgeBase`](bedrock-agent_example_bedrock-agent_GetKnowledgeBase_section.md)
      + [`GetPrompt`](bedrock-agent_example_bedrock-agent_GetPrompt_section.md)
      + [`ListAgentActionGroups`](bedrock-agent_example_bedrock-agent_ListAgentActionGroups_section.md)
      + [`ListAgentKnowledgeBases`](bedrock-agent_example_bedrock-agent_ListAgentKnowledgeBases_section.md)
      + [`ListAgents`](bedrock-agent_example_bedrock-agent_ListAgents_section.md)
      + [`ListFlowAliases`](bedrock-agent_example_bedrock-agent_ListFlowAliases_section.md)
      + [`ListFlowVersions`](bedrock-agent_example_bedrock-agent_ListFlowVersions_section.md)
      + [`ListFlows`](bedrock-agent_example_bedrock-agent_ListFlows_section.md)
      + [`ListKnowledgeBases`](bedrock-agent_example_bedrock-agent_ListKnowledgeBases_section.md)
      + [`ListPrompts`](bedrock-agent_example_bedrock-agent_ListPrompts_section.md)
      + [`PrepareAgent`](bedrock-agent_example_bedrock-agent_PrepareAgent_section.md)
      + [`PrepareFlow`](bedrock-agent_example_bedrock-agent_PrepareFlow_section.md)
      + [`UpdateFlow`](bedrock-agent_example_bedrock-agent_UpdateFlow_section.md)
      + [`UpdateFlowAlias`](bedrock-agent_example_bedrock-agent_UpdateFlowAlias_section.md)
      + [`UpdateKnowledgeBase`](bedrock-agent_example_bedrock-agent_UpdateKnowledgeBase_section.md)
  + [Scénarios](service_code_examples_bedrock-agent_scenarios.md)
    + [Création et invocation d’un flux](bedrock-agent_example_bedrock-agent_GettingStartedWithBedrockFlows_section.md)
    + [Création et invocation d’une invite gérée](bedrock-agent_example_bedrock-agent_GettingStartedWithBedrockPrompts_section.md)
    + [Créez et invoquez un agent](bedrock-agent_example_bedrock-agent_GettingStartedWithBedrockAgents_section.md)
    + [Orchestration des applications d’IA génératives avec Step Functions](bedrock-agent_example_cross_ServerlessPromptChaining_section.md)
+ [Exécution des agents Amazon Bedrock](service_code_examples_bedrock-agent-runtime.md)
  + [Principes de base](service_code_examples_bedrock-agent-runtime_basics.md)
    + [Principes de base](bedrock-agent-runtime_example_bedrock-agent-runtime_Scenario_ConverseWithFlow_section.md)
    + [Actions](service_code_examples_bedrock-agent-runtime_actions.md)
      + [`InvokeAgent`](bedrock-agent-runtime_example_bedrock-agent-runtime_InvokeAgent_section.md)
      + [`InvokeFlow`](bedrock-agent-runtime_example_bedrock-agent-runtime_InvokeFlow_section.md)
  + [Scénarios](service_code_examples_bedrock-agent-runtime_scenarios.md)
    + [Création et invocation d’un flux](bedrock-agent-runtime_example_bedrock-agent_GettingStartedWithBedrockFlows_section.md)
    + [Orchestration des applications d’IA génératives avec Step Functions](bedrock-agent-runtime_example_cross_ServerlessPromptChaining_section.md)