Skip to content

Commit dce347c

Browse files
committed
Add post on using Amazon Bedrock models with Microsoft Agent Framework
1 parent 84ef844 commit dce347c

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Using Amazon Bedrock models with Microsoft Agent Framework
3+
date: 2025-11-13 00:00:00 +1000
4+
categories: AWS
5+
description:
6+
tagline:
7+
tags:
8+
- AWS
9+
- Amazon Bedrock
10+
- Microsoft Agent Framework
11+
- AI
12+
- LLM
13+
excerpt_separator: <!--more-->
14+
# header:
15+
# overlay_image: ./assets/images/Angry-Blue-Tit-2025-Robert-de-Veen.jpg
16+
# caption: "Photo credit: [**Robert de Veen**](https://www.robertdeveen.com)"
17+
# show_overlay_excerpt: false
18+
---
19+
20+
With the [Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/overview/agent-framework-overview) you can create AI Agents on my favorite programming language .NET but also in Python. The SDK provide various types of agents with, off-course, the out-of-the-box support for Azure AI Foundry. In the successor [Symantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/overview/) there was a [specific agent](https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-types/bedrock-agent?pivots=programming-language-csharp) type for Amazon Bedrock’s Agent service. But in the new Microsoft Agent Framework, this specific agent type is not yet available.
21+
22+
<!--more-->
23+
24+
The Microsoft Agent Framework support creating agents thats uses the generic [OpenAI Chat Completion](https://platform.openai.com/docs/api-reference/chat/create) services. This means that you can use the Microsoft Agent Framework to create agents that uses Amazon Bedrock models by using the [OpenAI compatible API provided by Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-chat-completions.html).
25+
26+
## Creating a Bedrock Agent with Microsoft Agent Framework
27+
28+
To create a Bedrock Agent with the Microsoft Agent Framework, you need to configure the `OpenAIClient` to use the Bedrock endpoint and provide the necessary Api Key. Below is an example of how to set up a Bedrock Agent using C#:
29+
30+
```csharp
31+
#:package Microsoft.Agents.AI.OpenAI@1.0.0-preview.251110.2
32+
33+
using System.ClientModel;
34+
using OpenAI;
35+
using OpenAI.Chat;
36+
37+
OpenAIClient client = new(
38+
new ApiKeyCredential("<your_aws_bedrock_api_key>"),
39+
new OpenAIClientOptions()
40+
{
41+
Endpoint = new Uri("https://bedrock-runtime.<your_aws_region>.amazonaws.com/openai/v1"),
42+
});
43+
44+
var chatCompletionClient = client.GetChatClient("openai.gpt-oss-120b-1:0");
45+
46+
ChatCompletion chatCompletion = await chatCompletionClient.CompleteChatAsync("Hello, how can I use AWS Bedrock with Microsoft Agent Framework?");
47+
48+
Console.WriteLine(chatCompletion.Content[0].Text.Trim());
49+
```
50+
51+
Happy building! 🚀

0 commit comments

Comments
 (0)