-
Notifications
You must be signed in to change notification settings - Fork 31
human-in-the-loop #659
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 #659
Conversation
714614a
to
cfa130b
Compare
Preview ID generated: preview-eugene-1758914338-69fe33e |
cfa130b
to
a044f96
Compare
Preview ID generated: preview-eugene-1758914717-5b68b8a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a comprehensive human-in-the-loop documentation page for LangChain, moving detailed middleware documentation from a general middleware page to a dedicated page focused on human oversight capabilities.
- Replaces extensive human-in-the-loop middleware documentation with a brief summary and link to the new dedicated page
- Creates a new detailed human-in-the-loop documentation page with comprehensive examples and configuration details
- Updates link mapping to correct the interrupt reference
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/oss/langchain/middleware.mdx | Condenses human-in-the-loop section to summary with link to dedicated page |
src/oss/langchain/human-in-the-loop.mdx | Creates comprehensive documentation page covering middleware configuration, interrupt handling, and response types |
pipeline/preprocessors/link_map.py | Corrects link reference for interrupt function to use lowercase |
Comments suppressed due to low confidence (1)
src/oss/langchain/human-in-the-loop.mdx:1
- This documentation link creates a circular reference since it's on the human-in-the-loop page itself. This appears to be copied from the middleware.mdx file and should be removed or replaced with appropriate content for this page.
---
Preview ID generated: preview-eugene-1758915174-ff34a81 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
You must configure a checkpointer to persist the graph state across interrupts. | ||
In production, use a persistent checkpointer like @[AsyncPostgresSaver]. For testing or prototyping, use @[InMemorySaver]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reference '@[AsyncPostgresSaver]' appears to have a typo - it should be 'AsyncPostgresSaver' (with 'Postgres' not 'Postgress').
Copilot uses AI. Check for mistakes.
82ae034
to
eb6b085
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Preview ID generated: preview-eugene-1758915627-c75f251 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
}), | ||
], | ||
// Human-in-the-loop requires checkpointing to handle interrupts. | ||
// In production, use a persistent checkpointer like AsyncPostgresSaver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in 'AsyncPostgressSaver'. It should be 'AsyncPostgresSaver' (with an 'e' after 'Postgr').
// In production, use a persistent checkpointer like AsyncPostgresSaver. | |
// In production, use a persistent checkpointer like AsyncPostgresSaver. |
Copilot uses AI. Check for mistakes.
Preview ID generated: preview-eugene-1758916208-c2ce9f6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nits
| ✏️ `edit` | The tool call is executed with modifications. | Change the recipient before sending an email | | ||
| ❌ `respond` | The tool call is rejected, with an explanation added to the conversation. | Reject an email draft and explain how to rewrite it | | ||
|
||
<Note> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be in a note callout
::: | ||
|
||
|
||
<Important> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be <Warning>
-- we don't have an Important
callout
Co-authored-by: Lauren Hirata Singh <lauren@langchain.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
|
||
<Important> | ||
You must configure a checkpointer to persist the graph state across interrupts. | ||
In production, use a persistent checkpointer like @[AsyncPostgresSaver]. For testing or prototyping, use @[InMemorySaver]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @[AsyncPostgresSaver]
and @[InMemorySaver]
use the same custom link notation that may not render correctly. Consider using standard markdown links or verifying this notation is supported.
In production, use a persistent checkpointer like @[AsyncPostgresSaver]. For testing or prototyping, use @[InMemorySaver]. | |
In production, use a persistent checkpointer like `AsyncPostgresSaver`. For testing or prototyping, use `InMemorySaver`. |
Copilot uses AI. Check for mistakes.
3. If any calls require human input, the middleware builds a list of `HumanInterrupt` objects and calls @[interrupt]. | ||
4. The agent waits for human responses. | ||
5. Based on responses, the middleware executes approved or edited calls, synthesizes @[ToolMessage]'s for rejected calls, and resumes execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @[interrupt]
and @[ToolMessage]
custom link notations are inconsistent with standard markdown linking. Consider using proper markdown links or verify the custom notation is supported throughout the documentation system.
Copilot uses AI. Check for mistakes.
|
||
## Custom HITL logic | ||
|
||
For more specialized workflows, you can build custom HITL logic directly using the @[interrupt] primitive and [middleware](/oss/langchain/middleware) abstraction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed usage of @[interrupt]
custom notation and standard markdown link [middleware](/oss/langchain/middleware)
in the same sentence creates inconsistency. Consider standardizing the link format throughout the document.
For more specialized workflows, you can build custom HITL logic directly using the @[interrupt] primitive and [middleware](/oss/langchain/middleware) abstraction. | |
For more specialized workflows, you can build custom HITL logic directly using the [interrupt](/oss/langchain/interrupt) primitive and [middleware](/oss/langchain/middleware) abstraction. |
Copilot uses AI. Check for mistakes.
Preview ID generated: preview-eugene-1759153626-dd7e685 |
Preview ID generated: preview-eugene-1759154154-4ec77fe |
Overview
Outstanding:
Type of change
New documentation page
Checklist
docs dev
src/docs.json
if neededAdditional notes