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

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsConfigurationTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentstypesInferCompiledSubagents
Type●Since v1.4

InferCompiledSubagents

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

Copy
InferCompiledSubagents: Extract<InferDeepAgentSubagents<T>[number], __type>

Example

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