Conversation
|
Hi @dhicks , thank you for this PR. I'm wondering if |
|
I'm not tied to any particular implementation — this was the result of me playing around with the package to see if it would work for my needs — so It did occur to me a couple weeks ago, though, that structured outputs would provide a better way of controlling output throughout the whole package. IIRC currently invalid responses are detected after they're returned and converted to (Sorry for just dumping that; it's finals week here and I need to finish my grading!) |
This PR provides a minimal implementation of the approach to structured outputs I sketched in #39. Here's a not-quite-minimal working example of using structured outputs:
Text outputs appear to be working as before. Four tests fail, three due to small differences in a code snapshot, eg, order of arguments:
The fourth test appears to relate to the number of objects in Ollama's cache:
actualis 61.0 vs.expected59.0)Since I'm not sure how these tests work, at this time I'm not going to update the snapshots or make other changes to the tests themselves. I'm also not adding a test for the structured output use case. It seems like it would be desirable to define functions
llm_structuredandllm_structured_vecspecifically for vectored output, and then write tests for those.