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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astropods_adapter_langchain-0.2.2.tar.gz.
File metadata
- Download URL: astropods_adapter_langchain-0.2.2.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d54a959a24d38f3dbf3d5ee05028da1ec5936bf1a777735b5baea0ad331ce92
|
|
| MD5 |
7abca34fc010d3420d2037e4039e5d52
|
|
| BLAKE2b-256 |
af1328ece09e48cab50d14c5d4c0ba8dbf98dfa3f320b47a43889ce2710b442a
|
Provenance
The following attestation bundles were made for astropods_adapter_langchain-0.2.2.tar.gz:
Publisher:
publish-pypi.yml on astropods/adapters
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
astropods_adapter_langchain-0.2.2.tar.gz -
Subject digest:
9d54a959a24d38f3dbf3d5ee05028da1ec5936bf1a777735b5baea0ad331ce92 - Sigstore transparency entry: 1284994288
- Sigstore integration time:
-
Permalink:
astropods/adapters@c710035a0b4b44a083a0f916c29b9daa44f51ddb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/astropods
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c710035a0b4b44a083a0f916c29b9daa44f51ddb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file astropods_adapter_langchain-0.2.2-py3-none-any.whl.
File metadata
- Download URL: astropods_adapter_langchain-0.2.2-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c714ca76ed81f5116b1443a5f63b983023b6d9d6be086b9c5c954eb24fc9091
|
|
| MD5 |
b0023187e69089016ffb58d6c53c5f6c
|
|
| BLAKE2b-256 |
9c7d451a075c90a12417e0a35f4fca7c57855870e64ffb00f035bdf389d28be2
|
Provenance
The following attestation bundles were made for astropods_adapter_langchain-0.2.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on astropods/adapters
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
astropods_adapter_langchain-0.2.2-py3-none-any.whl -
Subject digest:
8c714ca76ed81f5116b1443a5f63b983023b6d9d6be086b9c5c954eb24fc9091 - Sigstore transparency entry: 1284994375
- Sigstore integration time:
-
Permalink:
astropods/adapters@c710035a0b4b44a083a0f916c29b9daa44f51ddb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/astropods
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c710035a0b4b44a083a0f916c29b9daa44f51ddb -
Trigger Event:
workflow_dispatch
-
Statement type: