.Net: Add Structured output ChatClientAgent samples (#250)

* WIP

* Structured Output sample

* Update dotnet/samples/GettingStarted/Steps/Step06_ChatClientAgent_StructuredOutputs.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Address xml and comment targeting the Structured Output context

* Update with proposed fix for Persistent ChatClient

* Address PR feedback

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
This commit is contained in:
Roger Barreto
2025-07-31 11:35:29 +00:00
committed by GitHub
co-authored by Copilot Chris
parent caee8bfa90
commit 139f033b05
5 changed files with 112 additions and 13 deletions
@@ -879,7 +879,9 @@ public class ChatClientAgentThreadTests
public void VerifyJsonDeserialization_HandlesMalformedJson()
{
// Arrange - Invalid JSON structure
#pragma warning disable JSON001 // Invalid JSON pattern
string invalidJson = "{ invalid json";
#pragma warning restore JSON001 // Invalid JSON pattern
// Act & Assert
Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<ChatClientAgentThread>(invalidJson));