Skip to content

JsonSerializationOptions is inaccessible due to its protection level #150

@ThierryBachmann

Description

@ThierryBachmann

hello
The default JsonSerializationOptions in OpenAIClient is defined as internal. So it's not possible to DeserializeObject correctly in some case (example: content="\n") return null for content.

I have modified the ContractResolver by DefaultContractResolver and it works.
internal static JsonSerializerSettings JsonSerializationOptions { get; } = new JsonSerializerSettings
{
.......
ContractResolver = new DefaultContractResolver() //TBN EmptyToNullStringContractResolver()
};

That would be better if we could change the JsonSerializationOptions from the OpenAIClient (or I didn't find how to?)

Additional context

Thanks for this awesome package. I'm so impressed by the code quality and documentation. Bravo!

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions