Skip to main content

LlamaIndex tool integration for PraisonAI multi-agent framework

Project description

llama-index-tools-praisonai

LlamaIndex tool integration for PraisonAI multi-agent framework.

Installation

pip install llama-index-tools-praisonai

Prerequisites

  1. Install and start PraisonAI server:
pip install praisonai
praisonai serve agents.yaml --port 8080

Usage

Basic Usage with LlamaIndex Agent

from llama_index_tools_praisonai import PraisonAIToolSpec
from llama_index.agent.openai import OpenAIAgent

# Create the PraisonAI tool spec
spec = PraisonAIToolSpec(api_url="http://localhost:8080")
tools = spec.to_tool_list()

# Create agent with PraisonAI tools
agent = OpenAIAgent.from_tools(tools, verbose=True)

# Use the agent
response = agent.chat("Research the latest trends in AI and summarize them")
print(response)

Using Individual Tools

from llama_index_tools_praisonai import PraisonAIToolSpec

spec = PraisonAIToolSpec()

# Run a specific agent
result = spec.run_agent(query="Research quantum computing", agent="researcher")
print(result)

# Run the full workflow
result = spec.run_workflow(query="Create a blog post about AI")
print(result)

# List available agents
agents = spec.list_agents()
print(agents)

Async Usage

import asyncio
from llama_index_tools_praisonai import PraisonAIToolSpec

async def main():
    spec = PraisonAIToolSpec()
    
    # Async agent execution
    result = await spec.arun_agent(query="Research AI", agent="researcher")
    print(result)
    
    # Async workflow execution
    result = await spec.arun_workflow(query="Create content")
    print(result)

asyncio.run(main())

With ReAct Agent

from llama_index_tools_praisonai import PraisonAIToolSpec
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI

spec = PraisonAIToolSpec()
tools = spec.to_tool_list()

llm = OpenAI(model="gpt-4o-mini")
agent = ReActAgent.from_tools(tools, llm=llm, verbose=True)

response = agent.chat("Use PraisonAI to research and write about machine learning")
print(response)

Configuration

Parameter Default Description
api_url http://localhost:8080 PraisonAI server URL
timeout 300 Request timeout in seconds

Available Tools

Tool Description
run_agent Run a specific PraisonAI agent (e.g., researcher, writer)
run_workflow Run the full multi-agent workflow
list_agents List all available agents

Links

License

MIT

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

llama_index_tools_praisonai-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

llama_index_tools_praisonai-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_praisonai-0.1.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_praisonai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5647398e8ce5a458f53e7efd07a525a2fec813a0d40c5b4b0aae75b43572c500
MD5 4111bbeaf0895c9ecc17278a18f15d89
BLAKE2b-256 03adf4890f9b7c8e4726454b49d6b6af9bc39c5345be9ae183b997c974ad8d58

See more details on using hashes here.

File details

Details for the file llama_index_tools_praisonai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_praisonai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 168451012dc126dd62c3c5541d8c94607e7a83d3299685739663769b98c498fe
MD5 a69a477ff7ac3ad33ffbee5a8f630c65
BLAKE2b-256 767304dbdaddf73413e421b2fe3ee337a778a9ff673066314ff4d4c80ea53ac9

See more details on using hashes here.

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