Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/three-cats-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
langchain: patch
"@langchain/mcp-adapters": patch
---

Further refinements and improvements to createAgent with middleware:

- updated createAgent symbol documentation
- improved type handling for invoke and stream invocation parameter
- acknowledge middleware context schema's that are optional or have default values as actually optional
- improvements to HITL middleware: support for multiple tool interrupts at the same time
- updates `@langchain/mcp-adapters` examples to use the new createAgent primitive from langchain
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@langchain/google-vertexai": "workspace:*",
"@langchain/google-vertexai-web": "workspace:*",
"@langchain/groq": "workspace:*",
"@langchain/langgraph": "alpha",
"@langchain/langgraph": "next",
"@langchain/mistralai": "workspace:*",
"@langchain/mongodb": "workspace:*",
"@langchain/nomic": "workspace:*",
Expand Down
6 changes: 2 additions & 4 deletions examples/src/createAgent/middleware/hitl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ const writeFileTool = tool(
const hitlMiddleware = humanInTheLoopMiddleware({
toolConfigs: {
write_file: {
requireApproval: true,
allowAccept: true,
description: "⚠️ File write operation requires approval",
},
calculator: {
requireApproval: false, // Math is safe
},
calculator: false, // Math is safe
},
});

Expand Down
4 changes: 2 additions & 2 deletions internal/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "Shared ESLint configuration for LangChain.js projects",
"author": "LangChain",
"license": "MIT",
"main": "./index.ts",
"types": "./index.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"type": "module",
"keywords": [
"eslint",
Expand Down
30 changes: 30 additions & 0 deletions libs/langchain-community/src/load/import_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,37 @@ export * as llms__togetherai from "../llms/togetherai.js";
export * as llms__watsonx_ai from "../llms/watsonx_ai.js";
export * as llms__writer from "../llms/writer.js";
export * as llms__yandex from "../llms/yandex.js";
export * as llms__layerup_security from "../llms/layerup_security.js";
export * as vectorstores__analyticdb from "../vectorstores/analyticdb.js";
export * as vectorstores__astradb from "../vectorstores/astradb.js";
export * as vectorstores__azion_edgesql from "../vectorstores/azion_edgesql.js";
export * as vectorstores__azure_aisearch from "../vectorstores/azure_aisearch.js";
export * as vectorstores__azure_cosmosdb from "../vectorstores/azure_cosmosdb.js";
export * as vectorstores__cassandra from "../vectorstores/cassandra.js";
export * as vectorstores__chroma from "../vectorstores/chroma.js";
export * as vectorstores__clickhouse from "../vectorstores/clickhouse.js";
export * as vectorstores__closevector__node from "../vectorstores/closevector/node.js";
export * as vectorstores__closevector__web from "../vectorstores/closevector/web.js";
export * as vectorstores__cloudflare_vectorize from "../vectorstores/cloudflare_vectorize.js";
export * as vectorstores__convex from "../vectorstores/convex.js";
export * as vectorstores__couchbase_search from "../vectorstores/couchbase_search.js";
export * as vectorstores__elasticsearch from "../vectorstores/elasticsearch.js";
export * as vectorstores__faiss from "../vectorstores/faiss.js";
export * as vectorstores__googlevertexai from "../vectorstores/googlevertexai.js";
export * as vectorstores__hnswlib from "../vectorstores/hnswlib.js";
export * as vectorstores__hanavector from "../vectorstores/hanavector.js";
export * as vectorstores__lancedb from "../vectorstores/lancedb.js";
export * as vectorstores__libsql from "../vectorstores/libsql.js";
export * as vectorstores__mariadb from "../vectorstores/mariadb.js";
export * as vectorstores__milvus from "../vectorstores/milvus.js";
export * as vectorstores__momento_vector_index from "../vectorstores/momento_vector_index.js";
export * as vectorstores__mongodb_atlas from "../vectorstores/mongodb_atlas.js";
export * as vectorstores__myscale from "../vectorstores/myscale.js";
export * as vectorstores__neo4j_vector from "../vectorstores/neo4j_vector.js";
export * as vectorstores__neon from "../vectorstores/neon.js";
export * as vectorstores__opensearch from "../vectorstores/opensearch.js";
export * as vectorstores__pgvector from "../vectorstores/pgvector.js";
export * as vectorstores__pinecone from "../vectorstores/pinecone.js";
export * as vectorstores__prisma from "../vectorstores/prisma.js";
export * as vectorstores__qdrant from "../vectorstores/qdrant.js";
export * as vectorstores__redis from "../vectorstores/redis.js";
Expand Down
11 changes: 1 addition & 10 deletions libs/langchain-core/src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ export * from "./transformers.js";
export * from "./metadata.js";
export * from "./message.js";
export * from "./modifier.js";
// TODO: Use a star export when we deprecate the
// existing "ToolCall" type in "base.js".
export {
type ToolMessageFields,
ToolMessage,
ToolMessageChunk,
type InvalidToolCall,
isToolMessage,
isToolMessageChunk,
} from "./tool.js";
export * from "./tool.js";

// This is an old export for backwards compatibility with existing multimodal content blocks
// TODO: remove this in v2
Expand Down
2 changes: 1 addition & 1 deletion libs/langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"dependencies": {
"@langchain/textsplitters": "workspace:*",
"@langchain/langgraph": "^1.0.0-alpha",
"@langchain/langgraph": "next",
"@langchain/langgraph-checkpoint": "^0.1.1",
"js-yaml": "^4.1.0",
"jsonpointer": "^5.0.1",
Expand Down
14 changes: 14 additions & 0 deletions libs/langchain/src/agents/interrupt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
export { interrupt } from "@langchain/langgraph";

/**
* Represents information about an interrupt.
*/
export interface Interrupt<TValue = unknown> {
/**
* The ID of the interrupt.
*/
id: string;
/**
* The requests for human input.
*/
value: TValue;
}

/**
* Configuration interface that defines what actions are allowed for a human interrupt.
* This controls the available interaction options when the graph is paused for human input.
Expand Down
Loading
Loading