WIP: Introduce a new ell.interactive API and example. #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces
ell.interactive()
, a new experimental API helper for bi-directional interaction with an LMP which can be used for various interactive scenarios w/ append-mode contextual history. It uses python's context manager paradigm to provide a session-like object that accumulates all message types (system, user, assistant and tool call/results w/ eager mode execution) - where the user only has to worry about examining the last response and sending the next one rather than managing that themselves.The basic idea is that instead of defining a minimal
@ell.complex
method and calling it repeatedly with an externally managed messages list like in the multi-step tool example to achieve dynamicism, you can just do something like:I haven't thought too much about tracking/versioning nor have I tested it inside
ell studio
yet, but wanted to float the idea eagerly via a WIP PR for feedback/thoughts/guidance on how best to proceed in alignment with the projects goals.Feedback welcome!
btw, I run the demo with uv like so: