Update to M.E.AI 10.3.0 (#3822)

Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
This commit is contained in:
Stephen Toub
2026-02-11 17:02:07 +00:00
committed by GitHub
co-authored by Roger Barreto
parent a427af91a9
commit b52136952f
7 changed files with 73 additions and 62 deletions
@@ -5,7 +5,6 @@
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;
using OpenAI;
using OpenAI.Responses;
var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set.");
var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-5";
@@ -15,14 +14,10 @@ var client = new OpenAIClient(apiKey)
.AsIChatClient().AsBuilder()
.ConfigureOptions(o =>
{
o.RawRepresentationFactory = _ => new CreateResponseOptions()
o.Reasoning = new()
{
ReasoningOptions = new()
{
ReasoningEffortLevel = ResponseReasoningEffortLevel.Medium,
// Verbosity requires OpenAI verified Organization
ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity.Detailed
}
Effort = ReasoningEffort.Medium,
Output = ReasoningOutput.Full,
};
}).Build();
@@ -21,7 +21,7 @@ AIAgent agent = await aiProjectClient.CreateAIAgentAsync(name: VisionName, model
ChatMessage message = new(ChatRole.User, [
new TextContent("What do you see in this image?"),
new DataContent(File.ReadAllBytes("assets/walkway.jpg"), "image/jpeg")
await DataContent.LoadFromAsync("assets/walkway.jpg"),
]);
AgentSession session = await agent.CreateSessionAsync();