Created
October 24, 2025 08:45
-
-
Save christianarg/0d78dcfae6b9c0f9ce652ce913d6a483 to your computer and use it in GitHub Desktop.
How to pass reasoning and verbosity parameters to OpenAi Models with Responses api using Microsoft Agent Framework net sdk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var agent = new AzureOpenAIClient( | |
| new Uri(""), // endpoint | |
| new DefaultAzureCredential()) | |
| .GetOpenAIResponseClient("gpt-5") | |
| // configure reasoning https://github.com/microsoft/agent-framework/blob/main/dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs | |
| // verbosity param https://github.com/openai/openai-dotnet/issues/593 | |
| .AsIChatClient().AsBuilder() | |
| .ConfigureOptions(o => | |
| { | |
| o.RawRepresentationFactory = _ => ((IJsonModel<ResponseCreationOptions>)new ResponseCreationOptions()) | |
| .Create(BinaryData.FromObjectAsJson(new | |
| { | |
| reasoning = new { effort = "low" }, | |
| text = new { verbosity = "low" }, | |
| }), ModelReaderWriterOptions.Json); | |
| }).Build() | |
| .CreateAIAgent(instructions: "You're a helpful assistant."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment