### Pydantic ACP Quickstart Source: https://github.com/vcoderun/acpkit/blob/main/docs/index.md A minimal example demonstrating how to set up and run an agent using the Pydantic ACP adapter. Ensure you have pydantic_ai and pydantic_acp installed. ```python from pydantic_ai import Agent from pydantic_acp import run_acp agent = Agent( "openai:gpt-5", name="weather-agent", instructions="Answer briefly and ask for clarification when location is missing.", ) @agent.tool_plain def lookup_weather(city: str) -> str: """Return a canned weather response for demos.""" return f"Weather in {city}: sunny" run_acp(agent=agent) ``` -------------------------------- ### LangChain ACP Quickstart Source: https://github.com/vcoderun/acpkit/blob/main/docs/index.md A minimal example demonstrating how to set up and run a graph using the LangChain ACP adapter. Ensure you have langchain and langchain_acp installed. ```python from langchain.agents import create_agent from langchain_acp import run_acp graph = create_agent(model="openai:gpt-5", tools=[]) run_acp(graph=graph) ``` -------------------------------- ### ACPKit Installation Hint (Langchain) Source: https://github.com/vcoderun/acpkit/blob/main/docs/cli.md Provides an example installation command for the 'langchain' extra when encountering a 'MissingAdapterError'. ```bash uv pip install "acpkit[langchain]" ``` -------------------------------- ### Development Setup with uv Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install development dependencies including runtime packages, docs tooling, and testing tools using uv sync. ```bash uv sync --extra dev --extra docs --extra pydantic --extra langchain --extra codex --extra remote ``` -------------------------------- ### Development Setup with pip Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install development dependencies including runtime packages, docs tooling, and testing tools using pip. ```bash pip install -e ".[dev,docs,pydantic,langchain,codex,remote]" ``` -------------------------------- ### Pydantic Adapter Quickstart Source: https://github.com/vcoderun/acpkit/blob/main/README.md This example demonstrates how to use the Pydantic adapter to expose a Pydantic AI Agent. Ensure the Agent is initialized with a model and any necessary tools are defined. ```python from pydantic_ai import Agent from pydantic_acp import run_acp agent = Agent("openai:gpt-5", name="weather-agent") @agent.tool_plain def get_weather(city: str) -> str: return f"Weather in {city}: sunny" run_acp(agent=agent) ``` -------------------------------- ### acpkit launch Command Examples Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Provides examples of using 'acpkit launch' to have Toad ACP start a resolved target. ```bash acpkit launch finance_agent acpkit launch finance_agent:agent -p ./examples ``` -------------------------------- ### Contributor Setup with Development Dependencies Source: https://github.com/vcoderun/acpkit/blob/main/README.md Install ACP Kit with development, documentation, Pydantic, and LangChain dependencies for contributor setup. ```bash uv sync --extra dev --extra docs --extra pydantic --extra langchain ``` ```bash pip install -e ".[dev,docs,pydantic,langchain]" ``` -------------------------------- ### ACPKit Installation Hint (Pydantic) Source: https://github.com/vcoderun/acpkit/blob/main/docs/cli.md Provides an example installation command for the 'pydantic' extra when encountering a 'MissingAdapterError'. ```bash uv pip install "acpkit[pydantic]" ``` -------------------------------- ### Install codex-auth-helper Source: https://github.com/vcoderun/acpkit/blob/main/packages/helpers/codex-auth-helper/README.md Install the codex-auth-helper package using uv. ```bash uv add codex-auth-helper ``` -------------------------------- ### Run Travel Agent Example Source: https://github.com/vcoderun/acpkit/blob/main/README.md Execute the travel planning runtime example using the uv command. ```bash uv run python -m examples.pydantic.travel_agent ``` -------------------------------- ### Install acpremote Source: https://github.com/vcoderun/acpkit/blob/main/packages/transports/acpremote/README.md Installation commands for the acpremote package. ```bash uv add acpremote ``` ```bash pip install acpremote ``` -------------------------------- ### Install codex-auth-helper with LangChain support Source: https://github.com/vcoderun/acpkit/blob/main/packages/helpers/codex-auth-helper/README.md Install the codex-auth-helper package with optional LangChain support using uv. ```bash uv add "codex-auth-helper[langchain]" ``` -------------------------------- ### Run the Codex-Backed LangChain Graph Example Source: https://github.com/vcoderun/acpkit/blob/main/docs/examples/langchain-codex.md Execute the example script using uv run. Ensure you have the necessary local state configured. ```bash uv run python -m examples.langchain.codex_graph ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/vcoderun/acpkit/blob/main/docs/testing.md Installs the lightweight pre-commit configuration hooks for the project. ```bash uv run pre-commit install ``` -------------------------------- ### Run DeepAgents Graph Example Source: https://github.com/vcoderun/acpkit/blob/main/examples/langchain/README.md Execute the DeepAgents compatibility graph example using uv unicorn. This demonstrates integration with DeepAgents. ```bash uv run python -m examples.langchain.deepagents_graph ``` -------------------------------- ### Install Codex Auth Helper (uv) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install the Codex-backed helper for Pydantic AI or LangChain using uv. ```bash uv pip install codex-auth-helper ``` -------------------------------- ### Install LangChain Adapter with DeepAgents Helpers (uv) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install the LangChain adapter package with optional DeepAgents helpers using uv. ```bash uv pip install "langchain-acp[deepagents]" ``` -------------------------------- ### Install Pre-commit Hook Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Install the Git pre-commit hook using `uv` to manage development dependencies. ```bash uv run pre-commit install ``` -------------------------------- ### Example: Durable Session Store with Graph Factory Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Demonstrates how to configure a durable session store using `FileSessionStore` and enable transcript replay on load. This example also shows how to define a `graph_factory` that dynamically creates an agent based on session context, ensuring session state influences graph rebuilds. ```python from pathlib import Path from langchain.agents import create_agent from langchain_acp import AdapterConfig, FileSessionStore, run_acp def graph_from_session(session): model_name = session.session_model_id or "openai:gpt-5-mini" return create_agent(model=model_name, tools=[]) config = AdapterConfig( session_store=FileSessionStore(root=Path(".acpkit/langchain-sessions")), replay_history_on_load=True, ) run_acp(graph_factory=graph_from_session, config=config) ``` -------------------------------- ### Run DeepAgents graph example Source: https://github.com/vcoderun/acpkit/blob/main/docs/examples/deepagents.md Execute the DeepAgents graph example using the uv run command. ```bash uv run python -m examples.langchain.deepagents_graph ``` -------------------------------- ### Install ACP Kit with LangChain Adapter (uv) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Use this command to install the root CLI with the LangChain adapter using uv. ```bash uv pip install "acpkit[langchain]" ``` -------------------------------- ### Install ACP Kit with Pydantic and Launch Support Source: https://github.com/vcoderun/acpkit/blob/main/README.md Install ACP Kit with Pydantic adapter and launch support. ```bash uv add "acpkit[pydantic,launch]" ``` ```bash pip install "acpkit[pydantic,launch]" ``` -------------------------------- ### Install langchain-acp with DeepAgents support using uv Source: https://github.com/vcoderun/acpkit/blob/main/packages/adapters/langchain-acp/README.md Install langchain-acp with optional DeepAgents compatibility using uv. ```bash uv add "langchain-acp[deepagents]" ``` -------------------------------- ### ACPKit Launch Examples Source: https://github.com/vcoderun/acpkit/blob/main/docs/cli.md Provides examples of using 'acpkit launch' to have Toad ACP launch a Python target, mirroring the behavior of 'acpkit run'. ```bash acpkit launch finance_agent acpkit launch finance_agent:agent -p ./examples ``` -------------------------------- ### Install Codex Auth Helper (pip) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install the Codex-backed helper for Pydantic AI or LangChain using pip. ```bash pip install codex-auth-helper ``` -------------------------------- ### Install Codex Auth Helper with LangChain Extra (uv) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install the Codex Auth Helper with the optional LangChain extra using uv. ```bash uv pip install "codex-auth-helper[langchain]" ``` -------------------------------- ### Contributor setup from monorepo root Source: https://github.com/vcoderun/acpkit/blob/main/packages/adapters/langchain-acp/README.md Run this command from the monorepo root for contributor setup, including development and LangChain extras. ```bash uv sync --extra dev --extra langchain ``` -------------------------------- ### One-File ACP Integration Example Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/langchain-quickstart.md A self-contained example demonstrating how to create a LangChain agent and immediately expose it via ACP in a single file. ```python from langchain.agents import create_agent from langchain_acp import run_acp graph = create_agent( model="openai:gpt-5", tools=[], system_prompt="Answer directly and keep responses short.", ) if __name__ == "__main__": run_acp(graph=graph) ``` -------------------------------- ### Install ACP Kit with Pydantic Adapter (uv) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Use this command to install the root CLI with the Pydantic adapter using uv. ```bash uv pip install "acpkit[pydantic]" ``` -------------------------------- ### Minimal Dynamic Agent Factory Example Source: https://github.com/vcoderun/acpkit/blob/main/docs/examples/dynamic-factory.md This example demonstrates a dynamic agent factory that customizes the model, name, and system prompt based on session context like workspace name, configuration values, and metadata. ```python from pydantic_ai import Agent from pydantic_acp import AcpSessionContext, AdapterConfig, MemorySessionStore, run_acp def build_agent(session: AcpSessionContext) -> Agent[None, str]: workspace_name = session.cwd.name requested_tone = str(session.config_values.get("tone", "concise")) tenant = str(session.metadata.get("tenant", "general")) model_name = "openai:gpt-5.4-mini" if workspace_name.endswith("-deep"): model_name = "openai:gpt-5.4" system_prompt = ( f"You are working inside `{workspace_name}` for tenant `{tenant}`. " f"Respond in a {requested_tone} style." ) return Agent( model_name, name=f"{tenant}-{workspace_name}", system_prompt=system_prompt, ) run_acp( agent_factory=build_agent, config=AdapterConfig(session_store=MemorySessionStore()), ) ``` -------------------------------- ### Install ACP Kit with LangChain Adapter (pip) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Use this command to install the root CLI with the LangChain adapter using pip. ```bash pip install "acpkit[langchain]" ``` -------------------------------- ### Install LangChain Adapter with DeepAgents Helpers (pip) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install the LangChain adapter package with optional DeepAgents helpers using pip. ```bash pip install "langchain-acp[deepagents]" ``` -------------------------------- ### Install LangChain Adapter Package Directly (uv) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install the standalone LangChain adapter package using uv for LangChain, LangGraph, or DeepAgents runtimes. ```bash uv pip install langchain-acp ``` -------------------------------- ### Install ACP Kit with Pydantic and Launch Helper (uv) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install the root CLI with Pydantic adapter and launch helper using uv to boot agents through Toad ACP. ```bash uv pip install "acpkit[pydantic,launch]" ``` -------------------------------- ### Install Codex Auth Helper with LangChain Extra (pip) Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Install the Codex Auth Helper with the optional LangChain extra using pip. ```bash pip install "codex-auth-helper[langchain]" ``` -------------------------------- ### Initialize ACPKit with Custom Metadata Providers Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Instantiate the `ExampleState` and then create an `AdapterConfig` object, passing in instances of the custom metadata providers. This configures ACPKit to use the host-defined logic for managing models, modes, and configurations. ```python from pydantic_acp import AdapterConfig state = ExampleState() config = AdapterConfig( models_provider=ModelsProvider(state=state), modes_provider=ModesProvider(state=state), config_options_provider=ConfigProvider(state=state), plan_provider=PlanProvider(state=state), approval_metadata_provider=ApprovalMetadataProvider(state=state) ) ``` -------------------------------- ### Initialize AdapterConfig Source: https://github.com/vcoderun/acpkit/blob/main/docs/pydantic-acp/adapter-config.md Demonstrates a standard configuration setup including model definitions, capability bridges, and session storage. ```python from pathlib import Path from pydantic_ai import Agent from pydantic_acp import ( AdapterConfig, AdapterModel, FileSessionStore, NativeApprovalBridge, ThinkingBridge, run_acp, ) agent = Agent("openai:gpt-5", name="configured-agent") config = AdapterConfig( agent_name="configured-agent", agent_title="Configured Agent", agent_version="2026.04", allow_model_selection=True, available_models=[ AdapterModel( model_id="fast", name="Fast", description="Lower-latency responses.", override="openai:gpt-5-mini", ), AdapterModel( model_id="smart", name="Smart", description="Higher-quality responses.", override="openai:gpt-5", ), ], capability_bridges=[ThinkingBridge()], approval_bridge=NativeApprovalBridge(enable_persistent_choices=True), session_store=FileSessionStore(root=Path(".acp-sessions")), ) run_acp(agent=agent, config=config) ``` -------------------------------- ### Smallest Pydantic ACP Path Example Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt This example demonstrates the minimal setup for a Pydantic AI agent integrated with ACP Kit. Ensure you have the necessary imports and define your agent with its tools. ```python from pydantic_ai import Agent from pydantic_acp import run_acp agent = Agent( "openai:gpt-5", name="weather-agent", instructions="Answer briefly and ask for clarification when location is missing.", ) @agent.tool_plain def lookup_weather(city: str) -> str: """Return a canned weather response for demos.""" return f"Weather in {city}: sunny" run_acp(agent=agent) ``` -------------------------------- ### AgentSource for Session-Specific Dependencies Source: https://github.com/vcoderun/acpkit/blob/main/docs/examples/dynamic-factory.md An example of `AgentSource` used when the agent requires session-specific dependencies. It defines how to get the agent and its dependencies separately. ```python from pydantic_acp import AgentSource class WorkspaceSource(AgentSource[WorkspaceDeps, str]): async def get_agent(self, session: AcpSessionContext) -> Agent[WorkspaceDeps, str]: return Agent("openai:gpt-5.4", deps_type=WorkspaceDeps) async def get_deps( self, session: AcpSessionContext, agent: Agent[WorkspaceDeps, str], ) -> WorkspaceDeps: del agent return WorkspaceDeps(root=session.cwd) ``` -------------------------------- ### Quickstart: Create an ACP agent with a graph factory Source: https://github.com/vcoderun/acpkit/blob/main/packages/adapters/langchain-acp/README.md This Python snippet shows how to create an ACP agent using a graph factory, allowing session state to influence graph construction. ```python from langchain.agents import create_agent from langchain_acp import AcpSessionContext, create_acp_agent def graph_from_session(session: AcpSessionContext): mode_name = session.session_mode_id or "default" return create_agent(model="openai:gpt-5", tools=[], name=f"graph-{mode_name}") acp_agent = create_acp_agent(graph_factory=graph_from_session) ``` -------------------------------- ### Install ACP Kit with Pydantic Extra Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Use this command to install the pydantic adapter for ACP Kit. Ensure you have `uv` or `pip` installed. ```bash uv pip install "acpkit[pydantic]" ``` ```bash uv pip install "acpkit[langchain]" ``` -------------------------------- ### Install DeepAgents Dependency Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Install the optional dependency for DeepAgents compatibility with ACPKit. ```bash uv add "langchain-acp[deepagents]" ``` ```bash pip install "langchain-acp[deepagents]" ``` -------------------------------- ### Docs Preview with uv Source: https://github.com/vcoderun/acpkit/blob/main/docs/getting-started/installation.md Serve the documentation locally for preview using uv, with Pydantic, LangChain, and Codex extras. ```bash uv run --extra docs --extra pydantic --extra langchain --extra codex mkdocs serve --dev-addr 127.0.0.1:8080 ``` -------------------------------- ### Install langchain-acp with pip Source: https://github.com/vcoderun/acpkit/blob/main/packages/adapters/langchain-acp/README.md Use this command to install the langchain-acp package using pip. ```bash pip install langchain-acp ``` -------------------------------- ### Install Codex Auth Helper with LangChain Support Source: https://github.com/vcoderun/acpkit/blob/main/docs/examples/langchain-codex.md Install the codex-auth-helper package with LangChain support using uv add or pip install. This command ensures that the necessary dependencies for LangChain integration are included. ```bash uv add "codex-auth-helper[langchain]" ``` ```bash pip install "codex-auth-helper[langchain]" ``` -------------------------------- ### Initialize and Run BlackBoxHarness Source: https://github.com/vcoderun/acpkit/blob/main/docs/integration-testing.md Demonstrates the full lifecycle of creating a harness, starting a session, queuing permissions, and verifying state through assertions. ```python import asyncio from pydantic_acp import AdapterConfig, BlackBoxHarness, FileSessionStore harness = BlackBoxHarness.create( agent_factory=build_agent, config=AdapterConfig(session_store=FileSessionStore(tmp_path / 'sessions')), ) session = asyncio.run(harness.new_session(cwd=str(tmp_path))) harness.queue_permission_selected('allow_once') response = asyncio.run(harness.prompt_text('Write the workspace note.')) assert response.stop_reason == 'end_turn' assert harness.tool_updates(session_id=session.session_id) assert harness.agent_messages(session_id=session.session_id) harness.clear_updates() asyncio.run(harness.load_session(cwd=str(tmp_path), session_id=session.session_id)) assert harness.agent_messages(session_id=session.session_id) ``` -------------------------------- ### Verify Minimal Harness Interaction Source: https://github.com/vcoderun/acpkit/blob/main/docs/integration-testing.md A concise example showing basic session creation, permission queuing, and message assertion. ```python session = asyncio.run(harness.new_session(cwd=str(tmp_path))) harness.queue_permission_selected('allow_once') response = asyncio.run(harness.prompt_text('Write the workspace note.')) assert response.stop_reason == 'end_turn' assert harness.agent_messages(session_id=session.session_id) == ['done'] ``` -------------------------------- ### Install Codex Auth Helper Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Install the codex-auth-helper package to build a Codex-backed Pydantic AI model. ```bash codex-auth-helper ``` -------------------------------- ### Run Finance Agent Example Source: https://github.com/vcoderun/acpkit/blob/main/docs/examples/finance.md Executes the finance agent using the uv package manager. ```bash uv run python -m examples.pydantic.finance_agent ``` -------------------------------- ### Install DeepAgents dependencies Source: https://github.com/vcoderun/acpkit/blob/main/docs/examples/deepagents.md Install the necessary optional dependencies for DeepAgents support using uv or pip. ```bash uv add "langchain-acp[deepagents]" ``` ```bash pip install "langchain-acp[deepagents]" ``` -------------------------------- ### Define Host-Owned State for Metadata Providers Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt The `ExampleState` dataclass stores configuration values per session, acting as a central store for all metadata providers. Use `config_for` to retrieve or initialize the configuration dictionary for a given session. ```python from dataclasses import dataclass, field @dataclass(slots=True) class ExampleState: config_values: dict[str, dict[str, str | bool]] = field(default_factory=dict) def config_for(self, session: AcpSessionContext) -> dict[str, str | bool]: return self.state.config_values.setdefault(session.session_id, {}) ``` -------------------------------- ### Run LangChain Workspace Graph Locally Source: https://github.com/vcoderun/acpkit/blob/main/docs/examples/langchain-workspace.md Executes the workspace graph example using the uv environment. ```bash uv run python -m examples.langchain.workspace_graph ``` -------------------------------- ### Install langchain-acp with DeepAgents support using pip Source: https://github.com/vcoderun/acpkit/blob/main/packages/adapters/langchain-acp/README.md Install langchain-acp with optional DeepAgents compatibility using pip. ```bash pip install "langchain-acp[deepagents]" ``` -------------------------------- ### Use HostAccessPolicy presets Source: https://github.com/vcoderun/acpkit/blob/main/docs/host-backends.md Initializes policies using predefined strict or permissive configurations. ```python from pydantic_acp import HostAccessPolicy strict_policy = HostAccessPolicy.strict() permissive_policy = HostAccessPolicy.permissive() ``` -------------------------------- ### Install ACP Remote Package Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Install the acpremote package to expose or mirror an existing ACP server over WebSocket. ```bash acpremote ``` -------------------------------- ### Build Documentation Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Build the documentation using `mkdocs` with strict checking, including extra dependencies for Pydantic and LangChain. ```bash uv run --extra docs --extra pydantic --extra langchain --extra codex mkdocs build --strict ``` -------------------------------- ### Install LangChain ACP Adapter Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Install the langchain-acp package to embed the ACP adapter in a LangChain or LangGraph app. ```bash langchain-acp ``` -------------------------------- ### Create Agent with LangChain ACP Source: https://github.com/vcoderun/acpkit/blob/main/docs/langchain-acp/runtime-controls.md This example demonstrates creating an agent using LangChain ACP, specifying model and mode IDs, and configuring the adapter. It's useful for product code that knows its supported models and modes upfront. ```python from langchain.agents import create_agent from langchain_acp import AdapterConfig, run_acp def graph_from_session(session): model_id = session.session_model_id or "openai:gpt-5-mini" mode_id = session.session_mode_id or "default" return create_agent( model=model_id, tools=[], name=f"graph-{mode_id}", system_prompt=f"Run in {mode_id} mode.", ) config = AdapterConfig( available_models=[], ) run_acp(graph_factory=graph_from_session, config=config) ``` -------------------------------- ### Install Pydantic ACP Adapter Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Install the pydantic-acp package to embed the ACP adapter in a Pydantic AI app. ```bash pydantic-acp ``` -------------------------------- ### Install ACP Kit with DeepAgents Compatibility Source: https://github.com/vcoderun/acpkit/blob/main/README.md Install ACP Kit with DeepAgents compatibility on top of the LangChain adapter. ```bash uv add "acpkit[deepagents]" ``` ```bash pip install "acpkit[deepagents]" ``` -------------------------------- ### Install ACP Kit SDK Skill Source: https://github.com/vcoderun/acpkit/blob/main/README.md Install the ACP Kit SDK skill package for Codex using npm. ```bash npx ctx7 skills install /vcoderun/acpkit acpkit-sdk ``` -------------------------------- ### Run Finance Agent Source: https://github.com/vcoderun/acpkit/blob/main/docs/llms-full.txt Execute the finance agent example using uv unicorn. Set ACP_FINANCE_MODEL for live model behavior. ```bash uv run python -m examples.pydantic.finance_agent ``` -------------------------------- ### Initialize AdapterConfig Source: https://github.com/vcoderun/acpkit/blob/main/docs/langchain-acp/adapter-config.md Demonstrates the initialization of AdapterConfig with various settings including agent identity, available models and modes, session store, capability bridges, projection maps, and event projection maps. ```python from acp.schema import ModelInfo, SessionMode from langchain_acp import ( AdapterConfig, DeepAgentsCompatibilityBridge, DeepAgentsProjectionMap, FileSessionStore, StructuredEventProjectionMap, ) config = AdapterConfig( agent_name="workspace-graph", available_models=[ ModelInfo(model_id="fast", name="Fast"), ModelInfo(model_id="deep", name="Deep"), ], available_modes=[ SessionMode(id="ask", name="Ask"), SessionMode(id="agent", name="Agent"), ], default_model_id="fast", default_mode_id="ask", session_store=FileSessionStore(root=".acpkit/langchain-sessions"), capability_bridges=[DeepAgentsCompatibilityBridge()], projection_maps=[DeepAgentsProjectionMap()], event_projection_maps=[StructuredEventProjectionMap()], ) ``` -------------------------------- ### Install ACP Kit with LangChain Support Source: https://github.com/vcoderun/acpkit/blob/main/README.md Use this command to install ACP Kit with LangChain and LangGraph adapter support. ```bash uv add "acpkit[langchain]" ``` ```bash pip install "acpkit[langchain]" ``` -------------------------------- ### Configure Mode-aware Tools with MCP Metadata Source: https://github.com/vcoderun/acpkit/blob/main/docs/bridges.md Demonstrates setting up an AdapterConfig with ThinkingBridge, PrepareToolsBridge, and McpBridge to manage tool modes and MCP server definitions. ```python from pydantic_acp import ( AdapterConfig, McpBridge, McpServerDefinition, McpToolDefinition, PrepareToolsBridge, PrepareToolsMode, ThinkingBridge, ) from pydantic_ai.tools import RunContext, ToolDefinition def ask_tools( ctx: RunContext[None], tool_defs: list[ToolDefinition], ) -> list[ToolDefinition]: del ctx return [tool_def for tool_def in tool_defs if tool_def.name == "mcp_repo_search_paths"] def agent_tools( ctx: RunContext[None], tool_defs: list[ToolDefinition], ) -> list[ToolDefinition]: del ctx return list(tool_defs) config = AdapterConfig( capability_bridges=[ ThinkingBridge(), PrepareToolsBridge( default_mode_id="ask", modes=[ PrepareToolsMode( id="ask", name="Ask", description="Read-only inspection mode.", prepare_func=ask_tools, ), PrepareToolsMode( id="agent", name="Agent", description="Full workspace mode.", prepare_func=agent_tools, plan_tools=True, ), ], ), McpBridge( servers=[ McpServerDefinition( server_id="repo", name="Repository", transport="http", tool_prefix="mcp_repo_", description="Repository inspection tools.", ) ], tools=[ McpToolDefinition( tool_name="mcp_repo_search_paths", server_id="repo", kind="search", ) ], ), ], ) ``` -------------------------------- ### Run Langchain Workspace Graph Source: https://github.com/vcoderun/acpkit/blob/main/examples/langchain/README.md Execute the workspace graph example using uv unicorn. This is useful for local development and testing. ```bash uv run python -m examples.langchain.workspace_graph ```