Loading the notebook…
Loading the notebook…
Notebooks · First agents · 07
Use this notebook to test HumanReviewTool and the runtime's interactive review event flow.
Its imports and arguments are checked against shipit-agent 3.0. The outputs were saved when it was written, for an earlier release.
from pathlib import Path
import sys
import json
ROOT = (
Path.cwd().resolve().parent
if Path.cwd().name == "notebooks"
else Path.cwd().resolve()
)
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from examples.run_multi_tool_agent import build_llm_from_env
from shipit_agent import Agent, HumanReviewToolllm = build_llm_from_env("bedrock")
agent = Agent(
llm=llm,
tools=[HumanReviewTool()],
name="human-review-demo",
)
for event in agent.stream(
"If a risky action appears necessary, request human review before continuing."
):
print(json.dumps(event.to_dict(), indent=2, default=str))Look for interactive_request events in the stream. Those are the packets your app or notebook UI would intercept before continuing the workflow.