Skip to main content

LangChain AgentExecutor adapter for the Astropods messaging service

Project description

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.

Project details


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.2.1.tar.gz (7.0 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.2.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for astropods_adapter_langchain-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c650c7c3f3d97a129c93b847cdc07f9cbc7ec116f8233734118b63da071cf964
MD5 b2bbd8d484cf7167d1481291408ac91c
BLAKE2b-256 51e23ba4288d37e219b50522572cad4b1f9a8a83bc83819d708e80fae62c255e

See more details on using hashes here.

Provenance

The following attestation bundles were made for astropods_adapter_langchain-0.2.1.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.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for astropods_adapter_langchain-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f58f0d0c4a1be11db4a632d94290da33cc1a7913a5a602bfcae117ddda2ea2c2
MD5 ac67f2d4ebc99c86127028c815c37d3c
BLAKE2b-256 c6ccb2dfec9280c24474de6534009e8c0110a997100baed6a6dd65dbee79eb37

See more details on using hashes here.

Provenance

The following attestation bundles were made for astropods_adapter_langchain-0.2.1-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page