Skip to content

Prompt for human feedback in LangGraph Functional API HITL sample - #368

Open
musi22 wants to merge 2 commits into
temporalio:mainfrom
musi22:langgraph-functional-hitl-feedback
Open

musi22 wants to merge 2 commits into
temporalio:mainfrom
musi22:langgraph-functional-hitl-feedback

Conversation

@musi22

@musi22 musi22 commented Sep 15, 2026

Copy link
Copy Markdown

Description

Brings the LangGraph Functional API human-in-the-loop sample to parity with the Graph API version and makes both HITL samples deliberately model-free (per review feedback from @brianstrauch):

  • Both Functional and Graph API HITL samples are deliberately model-free and runnable out of the box without an Anthropic API key or external network dependencies.
  • The runner scripts prompt interactively at the terminal for approval or revision notes instead of auto-approving.
  • Workflows generate an initial draft deterministically and revise it based on human feedback when requested.
  • Unit tests (human_in_the_loop_test.py and functional_human_in_the_loop_test.py) test approval and revision deterministically without LLM mocking.
  • Updated READMEs to describe the interactive flow.

Ref: #146, #324

@musi22
musi22 requested review from a team as code owners September 15, 2026 12:30
@CLAassistant

CLAassistant commented Sep 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The README should document the required ANTHROPIC_API_KEY setup for the configured model.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates the Functional API human-in-the-loop sample with LLM-generated drafts, interactive feedback, and revision support.

Changes:

  • Adds LLM-based drafting and revision.
  • Prompts for terminal approval or revision feedback.
  • Adds deterministic mocked tests.
  • Updates the interactive workflow documentation.
File summaries
File Summary
tests/langgraph_plugin/functional_human_in_the_loop_test.py Tests approval and revision with mocked chat-model calls.
langgraph_plugin/functional_api/human_in_the_loop/workflow.py Generates and revises drafts with an LLM.
langgraph_plugin/functional_api/human_in_the_loop/run_workflow.py Prompts for interactive human feedback.
langgraph_plugin/functional_api/human_in_the_loop/README.md Documents the workflow; should specify the required Anthropic credential setup.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread langgraph_plugin/functional_api/human_in_the_loop/README.md Outdated
Rewrite both graph_api and functional_api human-in-the-loop samples to be deliberately model-free without requiring an Anthropic API key. Draft generation and revision use deterministic templates while preserving the interactive terminal review workflow. Update unit tests and documentation accordingly.
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 this pull request may close these issues.

3 participants