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
| using System.Diagnostics; | |
| /// <summary> | |
| /// Sets up a DiagnosticListener to log HTTP requests made by HttpClient. | |
| /// Created it with the help of ChatGPT some time ago. | |
| /// I wouldn't enable in production at all, but it's useful for debugging purposes. | |
| /// | |
| /// Used to debug AI Frameworks HTTP calls since of them don't show exactly what is being sent. | |
| /// | |
| /// Usage: |
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()) |
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
| /* | |
| source: https://www.sqlshack.com/import-json-data-into-sql-server/ | |
| sample json | |
| [ | |
| { | |
| "id": "1", | |
| "name": "paco" | |
| }, |