Skip to content
Discussion options

You must be logged in to vote

@EVENFLOW212 Since type of Metadata is IReadOnlyDictionary<string, object?>?, I'm not sure it will be possible to handle all deserialization cases, because it can hold any type. But ChatResponseMessage.FunctionToolCalls is our predefined metadata key, so maybe we can provide some default deserialization logic. Meanwhile, you can implement your own JsonConverter<IReadOnlyDictionary<string, object?>> and handle deserialization on your side in a way you need.

Here is a code example how to handle ChatResponseMessage.FunctionToolCalls deserialization:

public class MyMetadataConverter : JsonConverter<IReadOnlyDictionary<string, object?>>
{
    public override IReadOnlyDictionary<string, object?>? 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@westdavidr
Comment options

@dmytrostruk
Comment options

Answer selected by sophialagerkranspandey
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants