-
Notifications
You must be signed in to change notification settings - Fork 3
Implement internal synthesis API #519
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
Conversation
|
Questions: Should these evaluation functions take in the |
eb8680
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a bunch of comments below, but one common theme is whether this API is compatible with a metacircular evaluator #503
The expected result type needs to be communicated to the LLM API as well, so I think this data and validation logic probably need to live in the result of |
2e5f0cd to
355c3e3
Compare
355c3e3 to
88c65ee
Compare
eb8680
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
|
awesome, will merge once tests pass! |
* Fresh diff * remove instructionhandler * updated internal interface to make all tests pass * fixed caching tests * updated llm.ipynb * removed unnecessarily defensive validation * updated tool call decoding to use concrete type of tool result instead of annotations * updated completions to fix basic type errors * updated call assistant to handle decoding tool calls * dropped stale comments * moved model and param model back to internals of `completions` * added default encodable instance for Callable * fixed type errors * update to use more structured type for synthesis * updated callable encoding tests * s/TypeError/NotImplementedError * simplified smart constructor * bare callables not allowed * droped synthesis and removed encoding_instructions * fixed imports * fixed imports and tests * added restricted python again * added test for custom policies for restricted python * more specific arguments to RestrictedEvalProvider and made exec more customisable * reverted flags for customizing rglobals, using same rglobals for local and globals for exec, fixing bug * fixed failing tests (env was not being mutated) * updated restricted python to be a llm dependency --------- Co-authored-by: Eli <eli@basis.ai>
Implements an internal synthesis API. This API is implemented as a
Encodable[Callable]instance, which implements decode by calling a series of operations,parse,compile,execfrom anevaluationmodule:For testing, this also adds a
UnsafeEvalProviderwhich provides naive implementations of these by shelling out to the builtin python implementations of each without further checking.