Replies: 2 comments 9 replies
-
Union[A, B, C], then you can use pattern matching. |
Beta Was this translation helpful? Give feedback.
-
Jason - have a look at https://github.com/zby/instructor/blob/main/examples/union/run.py Unfortunately I had to get back to checking the type of the returned object instead of using the process methods - because I need to keep state between calls and I don't know how to do that in the previous version. I get a lot of errors of the wrong data structure. They are caught by instructor - but I think there are too many such errors - maybe the structure is too difficult now? Also the messages array at the end does not look right - it seems that instructor does not add the corrected message there - only the wrong one is saved. Here is an example output:
|
Beta Was this translation helpful? Give feedback.
-
Let's say I have the classic pattern of a search and lookup functions - search finds the page, lookup looks up a fragment on that page containing a keyword. The LLM needs to decide if for the next step it wants to search for another page or lookup another part of the current page. How that can be achieved with instructor?
For reference here is the current schema that I pass to the 'tools' parameter:
Beta Was this translation helpful? Give feedback.
All reactions