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

Human-in-the-Loop Functionality: How to Pause Threads Mid-Run for Input? #4

Open
MePriyanshuHoo opened this issue Nov 20, 2024 · 4 comments

Comments

@MePriyanshuHoo
Copy link

Issue with current functionality:
I couldn’t find a clear way in the API to pause a thread’s run midway, wait for user input, and then resume. This is problematic for workflows that require human intervention during execution, as there doesn’t seem to be a mechanism to handle this scenario.

For example:

  • Endpoints like /threads/{thread_id}/runs/wait are designed to wait for final output but don’t seem to support pausing mid-run for input.
  • /threads/{thread_id}/runs/stream streams output in real-time, but I’m not sure if it allows for dynamic input injection while the run is active.

Idea or request:
It would be helpful to have:

  1. A way to pause a run at a specific stage, hold its state, and await input.
  2. Documentation or examples showing how to provide input dynamically during a run.
@markokraemer
Copy link

Human in the Loop is achieved through tool call involving the human with the Thread Run. Or after the Thread Run has completed, user could add a message to the Thread. Which then can be run again.

@lakshyaag12
Copy link

Does this indicate that for HITL in one thread, we can make more than 1 run? Or should we continue with the same run in the same thread?

@hinthornw
Copy link

hinthornw commented Dec 18, 2024

It's multiple runs for the same thread. When you interrupt, the state is checkpointed, so when you resume the thread, the logic can continue

@lakshyaag12
Copy link

Thanks @hinthornw!

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

No branches or pull requests

4 participants