langchain-praisonai
LangChain integration for PraisonAI multi-agent framework.
Installation
pip install langchain-praisonai
Prerequisites
- Install and start PraisonAI server:
pip install praisonai
praisonai serve agents.yaml --port 8080
Usage
Basic Usage
from langchain_praisonai import PraisonAITool
from langchain_openai import ChatOpenAI
from langchain.agents import initialize_agent, AgentType
# Create the PraisonAI tool
praisonai_tool = PraisonAITool(api_url="http://localhost:8080")
# Use with LangChain agent
llm = ChatOpenAI(model="gpt-4o-mini")
agent = initialize_agent(
tools=[praisonai_tool],
llm=llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
verbose=True
)
result = agent.run("Research the latest trends in AI and summarize them")
print(result)
Using Specific Agents
from langchain_praisonai import PraisonAIAgentTool
# Create tools for specific agents
researcher = PraisonAIAgentTool(agent_name="researcher")
writer = PraisonAIAgentTool(agent_name="writer")
# Use multiple agent tools
tools = [researcher, writer]
List Available Agents
from langchain_praisonai import PraisonAIListAgentsTool
list_tool = PraisonAIListAgentsTool()
agents = list_tool.run({})
print(agents)
Direct Tool Usage
from langchain_praisonai import PraisonAITool
tool = PraisonAITool()
# Run with default workflow
result = tool.run({"query": "What are the benefits of AI?"})
# Run with specific agent
result = tool.run({"query": "Research quantum computing", "agent": "researcher"})
Async Usage
import asyncio
from langchain_praisonai import PraisonAITool
async def main():
tool = PraisonAITool()
result = await tool.arun({"query": "Analyze market trends"})
print(result)
asyncio.run(main())
Configuration
| Parameter | Default | Description |
|---|---|---|
api_url |
http://localhost:8080 |
PraisonAI server URL |
timeout |
300 |
Request timeout in seconds |
Available Tools
| Tool | Description |
|---|---|
PraisonAITool |
General-purpose tool for running PraisonAI workflows |
PraisonAIAgentTool |
Tool for running a specific named agent |
PraisonAIListAgentsTool |
Tool for listing available agents |
Links
License
MIT
Metadata
Release files for langchain-praisonai 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_praisonai-0.1.0.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_praisonai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / langchain_praisonai-0.1.0.tar.gz
| Download URL | langchain_praisonai-0.1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
351c3ee7326725b3d7f31dc9cde24d0381232b8bfae2513d8f6f5c3929081d44
|
|
BLAKE2b-256 checksum How to use checksums |
37e1d1243faea8e24ffda12bc2836e2de85d28bd15108227b11a0506eb1fe71d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Release files / langchain_praisonai-0.1.0-py3-none-any.whl
| Download URL | langchain_praisonai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14cb8a1fee49f6d477d30fb9dc45d594de97206c3fff6c7577b22a1a98cfda82
|
|
BLAKE2b-256 checksum How to use checksums |
fcc7ef0b39f852ff9ceaf7fd3d6371c5ce6963ff653520dd783750e2f56f911a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|