Skip to content

Conversation

christian-bromann
Copy link
Member

Various code updates after last week:

  • interrupt_on instead of tool_configs
  • systemPrompt everywhere in JS
  • moving middleware import path to root

cc @sydney-runkle @eyurtsev

@Copilot Copilot AI review requested due to automatic review settings September 28, 2025 02:34
@github-actions github-actions bot added langchain For docs changes to LangChain oss labels Sep 28, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 updates the createAgent API in documentation to align with recent HITL (Human-in-the-Loop) changes. The changes standardize import paths, parameter names, and configuration options across Python and JavaScript examples.

  • Updates import paths to import middleware from the root "langchain" package instead of "langchain/middleware"
  • Changes tool_configs parameter to interrupt_on in Python and toolConfigs to interruptOn in JavaScript
  • Standardizes the use of systemPrompt parameter in JavaScript examples

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/oss/langchain/middleware.mdx Updates middleware import paths, parameter names (tool_configs → interrupt_on, toolConfigs → interruptOn), and systemPrompt usage across multiple code examples
src/oss/langchain/agents.mdx Updates middleware import path to use root "langchain" package

HumanInTheLoopRequest,
humanInTheLoopMiddleware,
} from "langchain";
import { createAgent } from "langchain";
Copy link
Preview

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

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

The createAgent import is duplicated. It's already imported on line 596-601 in the same import block. Remove this duplicate import statement.

Suggested change
import { createAgent } from "langchain";

Copilot uses AI. Check for mistakes.

Comment on lines +629 to +638
const result = await agent.invoke(
{
messages: [
new HumanMessage(
"Write to greeting.txt with the content 'Hello, world!'"
),
],
},
config
);
Copy link
Preview

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

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

The new keyword is missing when creating the HumanMessage instance. This is inconsistent with other examples in the file and will cause a runtime error.

Copilot uses AI. Check for mistakes.

Copy link

Preview ID generated: preview-cbagen-1759026889-ddde1c1

Copy link

Preview ID generated: preview-cbagen-1759028230-c924c95

middleware=[
HumanInTheLoopMiddleware(
tool_configs={
interrupt_on={
Copy link
Collaborator

Choose a reason for hiding this comment

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

I have a different PR for HIL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
langchain For docs changes to LangChain oss
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants