Skip to content

Conversation

@marknhenry
Copy link

Updated deserialization example for PersonInfo class.

Updated deserialization example for PersonInfo class.
@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 89149c5:

✅ Validation status: passed

File Status Preview URL Details
agent-framework/tutorials/agents/structured-output.md ✅Succeeded

For more details, please refer to the build report.

The agent response can then be deserialized into the `PersonInfo` class using the `Deserialize<T>` method on the response object.

```csharp
var personInfo = response.Deserialize<PersonInfo>(JsonSerializerOptions.Web);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marknhenry, this code looks correct to me. Isn't AgentRunResponse.Deserialize working for you?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's not running for me. The issue is in JsonSerializerOptions.Web.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the failure you are seeing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants