Skip to content

Commit 746c7da

Browse files
sphenrywestey-mCopilot
authored
Revise agent examples in README.md (#5067)
* Revise agent examples in README.md Updated examples for creating agents using OpenAI and Azure AI, and updated Important notice * Update README.md Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Update README.md Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Update README.md Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Update README.md Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update README.md Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Update README.md Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Update README.md Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> --------- Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d30103f commit 746c7da

1 file changed

Lines changed: 27 additions & 22 deletions

File tree

README.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,42 +120,42 @@ if __name__ == "__main__":
120120
```
121121

122122
### Basic Agent - .NET
123-
124-
Create a simple Agent, using OpenAI Responses, that writes a haiku about the Microsoft Agent Framework
125-
126-
```c#
127-
// dotnet add package Microsoft.Agents.AI.OpenAI --prerelease
128-
using Microsoft.Agents.AI;
129-
using OpenAI;
130-
using OpenAI.Responses;
131-
132-
// Replace the <apikey> with your OpenAI API key.
133-
var agent = new OpenAIClient("<apikey>")
134-
.GetResponsesClient("gpt-4o-mini")
135-
.AsAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
136-
137-
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));
138-
```
139-
140123
Create a simple Agent, using Microsoft Foundry with token-based auth, that writes a haiku about the Microsoft Agent Framework
141124

142125
```c#
143-
// dotnet add package Microsoft.Agents.AI.AzureAI --prerelease
144-
// dotnet add package Azure.Identity
126+
// dotnet add package Microsoft.Agents.AI.Foundry
145127
// Use `az login` to authenticate with Azure CLI
146128
using Azure.AI.Projects;
147129
using Azure.Identity;
148-
using Microsoft.Agents.AI;
130+
using System;
131+
using Azure.AI.Projects;
132+
using Azure.Identity;
149133

150134
var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set.");
151-
var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
135+
var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-5.4-mini";
152136

153137
var agent = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
154138
.AsAIAgent(model: deploymentName, name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
155139

156140
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));
157141
```
158142

143+
Create a simple Agent, using OpenAI Responses, that writes a haiku about the Microsoft Agent Framework
144+
145+
```c#
146+
// dotnet add package Microsoft.Agents.AI.OpenAI
147+
using System;
148+
using OpenAI;
149+
using OpenAI.Responses;
150+
151+
// Replace the <apikey> with your OpenAI API key.
152+
var agent = new OpenAIClient("<apikey>")
153+
.GetResponsesClient()
154+
.AsAIAgent(model: "gpt-5.4-mini", name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");
155+
156+
Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));
157+
```
158+
159159
## More Examples & Samples
160160

161161
### Python
@@ -207,4 +207,9 @@ The samples typically read configuration from environment variables. Common requ
207207

208208
## Important Notes
209209

210-
If you use the Microsoft Agent Framework to build applications that operate with third-party servers or agents, you do so at your own risk. We recommend reviewing all data being shared with third-party servers or agents and being cognizant of third-party practices for retention and location of data. It is your responsibility to manage whether your data will flow outside of your organization's Azure compliance and geographic boundaries and any related implications.
210+
> [!IMPORTANT]
211+
> If you use Microsoft Agent Framework to build applications that operate with any third-party servers, agents, code, or non-Azure Direct models (“Third-Party Systems”), you do so at your own risk. Third-Party Systems are Non-Microsoft Products under the Microsoft Product Terms and are governed by their own third-party license terms. You are responsible for any usage and associated costs.
212+
>
213+
>We recommend reviewing all data being shared with and received from Third-Party Systems and being cognizant of third-party practices for handling, sharing, retention and location of data. It is your responsibility to manage whether your data will flow outside of your organization’s Azure compliance and geographic boundaries and any related implications, and that appropriate permissions, boundaries and approvals are provisioned.
214+
>
215+
>You are responsible for carefully reviewing and testing applications you build using Microsoft Agent Framework in the context of your specific use cases, and making all appropriate decisions and customizations. This includes implementing your own responsible AI mitigations such as metaprompt, content filters, or other safety systems, and ensuring your applications meet appropriate quality, reliability, security, and trustworthiness standards. See also: [Transparency FAQ](./TRANSPARENCY_FAQ.md)

0 commit comments

Comments
 (0)