Skip to content

Commit

Permalink
workflow docs nit (#16618)
Browse files Browse the repository at this point in the history
cr
  • Loading branch information
jerryjliu authored Oct 21, 2024
1 parent 00fe1d1 commit d9a219e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/docs/module_guides/workflow/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ Since workflows are so flexible, there are many possible ways to implement human
The easiest way to implement a human-in-the-loop is to use the `InputRequiredEvent` and `HumanResponseEvent` events during event streaming.

```python
from llama_index.core.workflow import InputRequiredEvent, HumanResponseEvent


class HumanInTheLoopWorkflow(Workflow):
@step
async def step1(self, ev: StartEvent) -> InputRequiredEvent:
Expand Down
10 changes: 9 additions & 1 deletion llama-index-core/llama_index/core/workflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
WorkflowTimeoutError,
WorkflowValidationError,
)
from llama_index.core.workflow.events import Event, StartEvent, StopEvent
from llama_index.core.workflow.events import (
Event,
StartEvent,
StopEvent,
InputRequiredEvent,
HumanResponseEvent,
)
from llama_index.core.workflow.workflow import Workflow
from llama_index.core.workflow.context import Context

Expand All @@ -26,4 +32,6 @@
"draw_most_recent_execution",
"step",
"Context",
"InputRequiredEvent",
"HumanResponseEvent",
]

0 comments on commit d9a219e

Please sign in to comment.