LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentstypesInferRegularSubagents
Type●Since v1.6

InferRegularSubagents

Helper type to extract SubAgent (subagents with middleware) from a DeepAgent. Uses Extract to filter for subagents that have a middleware property but no runnable.

Copy
InferRegularSubagents: Exclude<InferDeepAgentSubagents<T>[number], __type>

Example

Copy
const agent = createDeepAgent({ subagents: [subagent1, compiledSubagent] });
type RegularSubagents = InferRegularSubagents<typeof agent>;
// Result: the subagent type that has `middleware` property
View source on GitHub