langchain_acp API
This page documents the public surface re-exported by langchain_acp.
Functions
create_acp_agent(graph=None, *, graph_factory=None, graph_source=None, config=None, event_projection_maps=None, projection_maps=None)
Source code in packages/adapters/langchain-acp/src/langchain_acp/runtime/server.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
run_acp(graph=None, *, graph_factory=None, graph_source=None, config=None, event_projection_maps=None, projection_maps=None)
Source code in packages/adapters/langchain-acp/src/langchain_acp/runtime/server.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
compose_projection_maps(projection_maps)
Source code in packages/adapters/langchain-acp/src/langchain_acp/projection.py
209 210 211 212 213 214 215 216 217 218 | |
compose_event_projection_maps(projection_maps)
Source code in packages/adapters/langchain-acp/src/langchain_acp/event_projection.py
53 54 55 56 57 58 59 60 61 62 | |
Core Classes And Data Types
AdapterConfig(*, agent_name=DEFAULT_AGENT_NAME, agent_title=DEFAULT_AGENT_TITLE, agent_version=DEFAULT_AGENT_VERSION, approval_bridge=NativeApprovalBridge(), available_models=list(), available_modes=list(), capability_bridges=tuple(), config_options_provider=None, default_model_id=None, default_mode_id=None, default_plan_generation_type='structured', enable_plan_progress_tools=False, event_projection_maps=tuple(), models_provider=None, modes_provider=None, native_plan_additional_instructions=None, native_plan_persistence_provider=None, output_serializer=DefaultOutputSerializer(), plan_mode_id=None, plan_provider=None, projection_maps=tuple(), replay_history_on_load=True, session_store=MemorySessionStore(), tool_classifier=DefaultToolClassifier())
dataclass
AcpSessionContext(*, session_id, cwd, created_at, updated_at, title=None, session_model_id=None, session_mode_id=None, plan_entries=list(), plan_markdown=None, config_values=dict(), mcp_servers=list(), metadata=dict(), transcript=list(), client=None)
dataclass
JsonValue = JsonPrimitive | list['JsonValue'] | dict[str, 'JsonValue']
module-attribute
TaskPlan
Bases: BaseModel
Graph Source Classes And Protocols
CompiledAgentGraph = CompiledStateGraph[Any, Any, Any, Any]
module-attribute
GraphFactory
Bases: Protocol
GraphSource
Bases: Protocol
StaticGraphSource(graph)
dataclass
FactoryGraphSource(factory)
dataclass
Session Store Classes
SessionStore
Bases: Protocol
MemorySessionStore(_sessions=dict())
dataclass
FileSessionStore(root)
dataclass
Provider State Classes And Protocols
ConfigOption = SessionConfigOptionSelect | SessionConfigOptionBoolean
module-attribute
ConfigOptionsProvider
Bases: Protocol
ModelSelectionState(*, available_models, current_model_id, allow_any_model_id=False, enable_config_option=True, config_option_name='Model')
dataclass
ModeState(*, modes, current_mode_id=None, enable_config_option=True, config_option_name='Mode')
dataclass
NativePlanPersistenceProvider
Bases: Protocol
PlanProvider
Bases: Protocol
SessionModelsProvider
Bases: Protocol
SessionModesProvider
Bases: Protocol
Bridge Classes
CapabilityBridge
BufferedCapabilityBridge()
dataclass
Bases: CapabilityBridge
ConfigOptionsBridge(*, provider)
dataclass
Bases: CapabilityBridge
ModelSelectionBridge(*, available_models=(), default_model_id=None, provider=None)
dataclass
Bases: CapabilityBridge
ModeSelectionBridge(*, available_modes=(), default_mode_id=None, provider=None)
dataclass
Bases: CapabilityBridge
ToolSurfaceBridge(*, tool_kinds=dict(), approval_policy_keys=dict())
dataclass
Bases: CapabilityBridge
DeepAgentsCompatibilityBridge(*, metadata_key='deepagents')
dataclass
Bases: CapabilityBridge
GraphBridgeBuilder(*, base_classifier, bridges)
dataclass
GraphBuildContributions(*, interrupt_configuration=dict(), metadata=dict(), middleware=(), response_format=None, system_prompt_parts=(), tools=())
dataclass
Plan Helpers
NativePlanGeneration = TaskPlan
module-attribute
PlanGenerationType = Literal['tools', 'structured']
module-attribute
acp_get_plan()
Return the saved plan and numbered entries.
Source code in packages/adapters/langchain-acp/src/langchain_acp/plan.py
89 90 91 92 93 94 | |
acp_mark_plan_done(index)
async
Mark a single plan entry completed by its 1-based index.
Source code in packages/adapters/langchain-acp/src/langchain_acp/plan.py
133 134 135 136 137 138 139 140 141 142 143 | |
acp_set_plan(entries, plan_md=None)
async
Replace the current ACP-owned plan state.
Source code in packages/adapters/langchain-acp/src/langchain_acp/plan.py
97 98 99 100 101 102 103 104 105 106 107 | |
acp_update_plan_entry(index, status=None, content=None, priority=None)
async
Update a single plan entry by its 1-based index.
Source code in packages/adapters/langchain-acp/src/langchain_acp/plan.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
native_plan_tools()
Source code in packages/adapters/langchain-acp/src/langchain_acp/plan.py
146 147 148 149 150 151 152 | |
Projection Classes
FileSystemProjectionMap(*, write_tool_names=frozenset(), read_tool_names=frozenset(), search_tool_names=frozenset(), execute_tool_names=frozenset())
dataclass
DeepAgentsProjectionMap(*, base=(lambda: FileSystemProjectionMap(read_tool_names=(frozenset({'read_file'})), write_tool_names=(frozenset({'edit_file', 'write_file'})), search_tool_names=(frozenset({'glob', 'grep', 'ls'})), execute_tool_names=(frozenset({'execute'}))))())
dataclass
CompositeProjectionMap(*, maps)
dataclass
StructuredEventProjectionMap(*, event_keys=_EVENT_KEYS)
dataclass
CompositeEventProjectionMap(*, maps)
dataclass
Projection Helpers
build_tool_start_update(*, tool_call_id, tool_name, classifier, raw_input, cwd, projection_map)
Source code in packages/adapters/langchain-acp/src/langchain_acp/projection.py
965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | |
build_tool_progress_update(*, tool_call_id, tool_name, classifier, raw_input, raw_output, serialized_output, cwd, projection_map, status)
Source code in packages/adapters/langchain-acp/src/langchain_acp/projection.py
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 | |
extract_tool_call_locations(raw_input)
Source code in packages/adapters/langchain-acp/src/langchain_acp/projection.py
956 957 958 959 960 961 962 | |