Closed CyrusOfEden closed 1 week ago
This is AWESOME, thanks a lot @CyrusOfEden !!
Are you using a linter that's more opinionated than the default linting behavior in the library? I think a large fraction of the 24 edited files are just edited for style and that makes review / history a bit more complex than it needs to be for this PR.
Relatedly, there are some outdated ReAct tests that were commented out, we can keep them commented out until they're updated.
tl;dr
with dspy.context
calls. Alternatively, I'm fine disallowing any .context and .configure calls in async programs as long as it throws an error, so people don't forget.I think a large fraction of the 24 edited files are just edited for style
Only files that have had changes have had the formatting applied, so there's no superfluous formatting included in the PR.
My editor should've picked up the formatting rules, I can check in the afternoon today.
Edit: See latest push
Hi how can I use this, is this merged?
Closing this in favour of #1806
š„ the long awaited async implementation for DSPy š„
All dspy.predict.* programs can now be used async!
All programs are now awaitable:
Custom programs must implement the
aforward
method, which has the same method signature asforward
. Developers must take care not to block the event loop with synchronous function calls.Notable Changes
dspy.settings.configure(request_cache=LMRequestLRUCache(maxsize: int = ...)
. This prevents unbounded memory growth.Minor Changes
Notes
It looks like the ReAct tests are broken in main, and they're broken here too.
Acknowledgements
Kudos to @isaacbmiller for his prototype in #1729, this wouldn't have been possible without him!