Skip to content
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

Better async support #1975

Open
itay1542 opened this issue Dec 22, 2024 · 0 comments · May be fixed by #1988
Open

Better async support #1975

itay1542 opened this issue Dec 22, 2024 · 0 comments · May be fixed by #1988

Comments

@itay1542
Copy link
Contributor

itay1542 commented Dec 22, 2024

dspy.asyncify is a good start but it doesn't feel idiomatic. Would be cool if we had an AsyncModule where the forward method is async or alternatively add an aforward method to dspy.Module. The reason this would be useful is

  1. The user will be able to control parallelization inside their Module's forward and
  2. This will enable async tool calls with dspy.ReAct for example
  3. Better integration with async frameworks such as FastAPI etc..

At the moment, using dspy.asyncify on a Module doesn't allow easy async programming inside the forward method because you can't use the await keyword, you have to resort to interacting with the active asyncio loop etc..

@itay1542 itay1542 changed the title Async support in dspy.ReAct Better async support Dec 22, 2024
@younes-io younes-io linked a pull request Dec 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant