diff --git a/agent-framework/tutorials/agents/structured-output.md b/agent-framework/tutorials/agents/structured-output.md index e4c60490..b4e4e573 100644 --- a/agent-framework/tutorials/agents/structured-output.md +++ b/agent-framework/tutorials/agents/structured-output.md @@ -104,7 +104,7 @@ var response = await agent.RunAsync("Please provide information about John Smith The agent response can then be deserialized into the `PersonInfo` class using the `Deserialize` method on the response object. ```csharp -var personInfo = response.Deserialize(JsonSerializerOptions.Web); +var personInfo = JsonSerializer.Deserialize(response.ToString(), new JsonSerializerOptions(JsonSerializerDefaults.Web)); Console.WriteLine($"Name: {personInfo.Name}, Age: {personInfo.Age}, Occupation: {personInfo.Occupation}"); ```