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

core[minor]: Add Runnable.batch_as_completed #17603

Merged
merged 4 commits into from Mar 13, 2024

Conversation

nfcampos
Copy link
Collaborator

@nfcampos nfcampos commented Feb 15, 2024

This PR adds batch as completed method to the standard Runnable interface. It takes in a list of inputs and yields the corresponding outputs as the inputs are completed.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 15, 2024
Copy link

vercel bot commented Feb 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 0:47am

@dosubot dosubot bot added the 🤖:improvement Medium size change to existing code to handle new use-cases label Feb 15, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Feb 16, 2024
@eyurtsev eyurtsev changed the title Add Runnable.batch_as_completed core[minor]: Add Runnable.batch_as_completed Feb 16, 2024
*,
return_exceptions: bool = False,
**kwargs: Optional[Any],
) -> AsyncIterator[Tuple[Input, Output]]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this to be AsyncIterator[Tuple[int, Input, Output]]?

Duplicated Input, Output but different configs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like index in input array?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case I'd actually prefer to not return the input at all, just index and output, wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that works

@nfcampos nfcampos force-pushed the nc/15feb/batch-as-completed branch from a550b4d to 5a081cd Compare March 13, 2024 00:09
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 13, 2024
@nfcampos nfcampos merged commit 2b7c3c5 into master Mar 13, 2024
95 checks passed
@nfcampos nfcampos deleted the nc/15feb/batch-as-completed branch March 13, 2024 18:18
bechbd pushed a commit to bechbd/langchain that referenced this pull request Mar 29, 2024
This PR adds `batch as completed` method to the standard Runnable
interface. It takes in a list of inputs and yields the corresponding
outputs as the inputs are completed.
gkorland pushed a commit to FalkorDB/langchain that referenced this pull request Mar 30, 2024
This PR adds `batch as completed` method to the standard Runnable
interface. It takes in a list of inputs and yields the corresponding
outputs as the inputs are completed.
hinthornw pushed a commit that referenced this pull request Apr 26, 2024
This PR adds `batch as completed` method to the standard Runnable
interface. It takes in a list of inputs and yields the corresponding
outputs as the inputs are completed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants