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.

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

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astropods_adapter_langchain-0.4.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astropods_adapter_langchain-0.4.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file astropods_adapter_langchain-0.4.0.tar.gz.

File metadata

File hashes

Hashes for astropods_adapter_langchain-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7853b34e496a8e0629f01054da3d9b0968cc70fe65e8ee4e891c88f3c70d90bd
MD5 2c1fb7384c2785737b30f5ae8c0aef63
BLAKE2b-256 4c177d7c6a4778d184d5c30e16cc4d64152327abc86bf0e607286cb548091036

See more details on using hashes here.

Provenance

The following attestation bundles were made for astropods_adapter_langchain-0.4.0.tar.gz:

Publisher: publish-pypi.yml on astropods/adapters

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file astropods_adapter_langchain-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for astropods_adapter_langchain-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3ab13778ec28b058b67e0eb8834309eebdba16a7c3eda91ef3b94b42f504a74
MD5 48545efc996dc2421dad2c260ee4b67f
BLAKE2b-256 7911cd306cde88a64df2984ce2277d894a40e4ba8d5dd575c413334ba32c056c

See more details on using hashes here.

Provenance

The following attestation bundles were made for astropods_adapter_langchain-0.4.0-py3-none-any.whl:

Publisher: publish-pypi.yml on astropods/adapters

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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