Skip to main content

astropods-adapter-langchain

LangChain adapter for the Astropods messaging service. Wraps a create_agent executor and connects it to the Astro runtime.

Installation

pip install astropods-adapter-langchain

Requires Python 3.10+.

Usage

from langchain_anthropic import ChatAnthropic
from langchain.agents import create_agent
from astropods_adapter_langchain import LangChainAdapter, serve

llm = ChatAnthropic(model="claude-sonnet-4-5")
system_prompt = "You are a helpful assistant."
agent = create_agent(llm, tools=[], system_prompt=system_prompt)

adapter = LangChainAdapter(agent, name="My Agent", system_prompt=system_prompt)
serve(adapter)

serve() blocks until SIGINT or SIGTERM. Under ast dev, GRPC_SERVER_ADDR is injected automatically.

The sender's name

configurable["user_name"] carries the sender's name on the source platform (their full name in Slack, or their Astro name in web chat). It is absent when the platform sent none. A tool reads it from its run config:

from langchain_core.runnables import RunnableConfig
from langchain_core.tools import tool

@tool
def who_am_i(config: RunnableConfig) -> str:
    """Name the current user."""
    return config["configurable"].get("user_name", "unknown")

API

LangChainAdapter(executor, name, system_prompt?, tools?)

Parameter Type Description
executor LangChain agent A compiled agent, e.g. from create_agent
name str Display name shown in logs and the playground
system_prompt str Shown in the playground's config panel
tools list LangChain tool objects — populates the playground tool list
supports_history Optional[bool] When the conversation's earlier turns change (the user edited a message or switched versions in the web chat, or the agent never answered the previous turn), delete the checkpointer thread and start it over from the turns the message carries, as text only. Defaults to None, which means true when the checkpointer implements adelete_thread or delete_thread, or when there is none.

serve(adapter, options?)

Re-exported from astropods-adapter-core. Connects the adapter to the messaging service and blocks until shutdown. Pass a ServeOptions(server_address="...") as the second argument to override the gRPC address.

Metadata

Release files for astropods-adapter-langchain 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astropods-adapter-langchain 0.5.0
File Size Uploaded Provenance Actions
astropods_adapter_langchain-0.5.0.tar.gz 11.5 kB With provenance Details for astropods_adapter_langchain-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for astropods-adapter-langchain 0.5.0
File Interpreter ABI Platform Actions
astropods_adapter_langchain-0.5.0-py3-none-any.whl Python 3 none any Details for astropods_adapter_langchain-0.5.0-py3-none-any.whl

Total release size: 19.4 kB

Release files / astropods_adapter_langchain-0.5.0.tar.gz

Download URL astropods_adapter_langchain-0.5.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5f818c8e37aa7f992e351a476d9c2fc68112b8da675b2d86098ec1e81c5718a4
BLAKE2b-256 checksum
How to use checksums
a6fdc5bf0c1ed8adb313ccd6a5295e122185e661df78e0442a8b6de422f3e6de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / astropods_adapter_langchain-0.5.0-py3-none-any.whl

Download URL astropods_adapter_langchain-0.5.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c43a732a3dd9c11b0c93086e0a717b0c806ef35e73c7189e7ec9b61fef851360
BLAKE2b-256 checksum
How to use checksums
bd5d9755ba7c47e31db7003405d2d1454d7321c9acd243f9e411763b2a0be255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Security for astropods-adapter-langchain 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for astropods_adapter_langchain-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page