-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structured Output #85
Comments
I have this working locally, but PR: #92 |
to get it working locally, in
Then, in
and run the script Now you can use an object representation of the schema for the For example, here's the test I wrote for the feature:
You can use NewtonSoft.Json.Schema to generate the schema from the response type automatically, or just manually build it (as I do in the test above). |
Unfortunately, it seems that there is an issue with using both tools & structured output together in the ollama api itself: ollama/ollama#8095 |
Unfortunately it seems like this is currently the expected behaviour from the Ollama API, as per the latest update on that issue. |
Can someone please provide an example how to use ResponseFormat correctly. I tried different things in C#, none of them work, some even throw 500 internal server error from ollama. I have tried also above example from Dustin using curl, and that worked completely fine, but with nuget I'm having issue. |
You can try using OllamaSharp or Microsoft.Extensions.AI.Ollama, both of which support structured output. |
What would you like to be added:
Access to the new structured outputs (JSON response formatting): https://ollama.com/blog/structured-outputs
Why is this needed:
The current JSON formatting doesn't ensure the response follows a certain schema.
The text was updated successfully, but these errors were encountered: