### Install Prerequisites Source: https://github.com/praison-labs/praison/blob/main/src/praisonai-agents/README.md Install the necessary dependencies for running the MCP server and clients. ```bash pip install praisonaiagents mcp httpx starlette uvicorn anthropic python-dotenv ``` -------------------------------- ### Run example scripts Source: https://github.com/praison-labs/praison/blob/main/src/praisonai-ts/examples/concepts/README.md Execute specific concept examples using ts-node. ```bash # Run single agent example npx ts-node examples/concepts/single-agent.ts # Run multi-agent example npx ts-node examples/concepts/multi-agent.ts # Run task-based agent example npx ts-node examples/concepts/task-based-agent.ts ``` -------------------------------- ### Install Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/model_fee_retreival_agents.ipynb Install the required libraries for web scraping and agent orchestration. ```bash # Install dependencies without output %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install crawl4ai > /dev/null ``` -------------------------------- ### Install Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/Joke_Agent.ipynb Install the necessary libraries for OpenAI and PraisonAIAgents. This should be run before any other code. ```python !pip install openai praisonaiagents ``` -------------------------------- ### Run Single Agent Example Source: https://github.com/praison-labs/praison/blob/main/src/praisonai-ts/README.md Demonstrates how to create and run a single AI agent for a specific task. Ensure the 'praisonai' package is installed. ```typescript import { Agent, PraisonAIAgents } from 'praisonai'; async function main() { // Create a simple agent (no task specified) const agent = new Agent({ name: "BiologyExpert", instructions: "Explain the process of photosynthesis in detail.", verbose: true }); // Run the agent const praisonAI = new PraisonAIAgents({ agents: [agent], tasks: ["Explain the process of photosynthesis in detail."], verbose: true }); try { console.log('Starting single agent example...'); const results = await praisonAI.start(); console.log(' Final Results:', results); } catch (error) { console.error('Error:', error); } } main(); ``` -------------------------------- ### Install Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/markdown_validator_agents.ipynb Install necessary Python packages and the markdownlint-cli2 tool. ```python # Install dependencies without output %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install pymarkdown > /dev/null !npm install -g markdownlint-cli2 ``` -------------------------------- ### Install Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/cli_operation_agents.ipynb Install the necessary libraries for PraisonAI and Open Interpreter in a notebook environment. ```python # Install dependencies without output %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install open-interpreter > /dev/null ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/praison-labs/praison/blob/main/src/praisonai-ts/README.md Install project dependencies after cloning the repository. ```bash npm install ``` -------------------------------- ### Configure Environment and Run Examples Source: https://github.com/praison-labs/praison/blob/main/src/praisonai-ts/README.md Commands to set the OpenAI API key and execute TypeScript examples using ts-node. ```bash export OPENAI_API_KEY='your-api-key' ``` ```bash npx ts-node example.ts ``` -------------------------------- ### Install Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/meeting_prep_using_slack_and_trello_agents.ipynb Installs the necessary libraries for PraisonAI, LangChain, search tools, and Slack integration. ```bash # Install dependencies without output %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install duckduckgo-search > /dev/null %pip install python-dotenv > /dev/null %pip install slack_sdk > /dev/null %pip install python-dotenv > /dev/null ``` -------------------------------- ### Install Framework Source: https://github.com/praison-labs/praison/blob/main/src/praisonai/tests/integration/README.md If you encounter an ImportError for a framework like 'autogen', install it using pip. ```bash pip install pyautogen ``` -------------------------------- ### Install Pytest and Pytest-Asyncio with UV Source: https://github.com/praison-labs/praison/blob/main/src/praisonai/tests/README.md Install necessary pytest packages using UV, a fast Python package installer. Recommended for environments using UV virtual environments. ```bash uv pip install pytest pytest-asyncio ``` -------------------------------- ### Install Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/ReAct_agent.ipynb Install the necessary packages for the agent, including OpenAI, PraisonAI, and DuckDuckGo search. ```bash !pip install openai praisonaiagents duckduckgo-search ``` -------------------------------- ### Install Test Dependencies Source: https://github.com/praison-labs/praison/blob/main/src/praisonai/tests/integration/README.md Commands to install necessary packages for running integration tests. ```bash pip install pyautogen ``` ```bash pip install crewai ``` ```bash pip install pytest pytest-asyncio ``` -------------------------------- ### YAML Configuration Example Source: https://github.com/praison-labs/praison/blob/main/examples/python/usecases/README-secondary-market-research.md Example of a YAML configuration file for the research agents, specifying the framework, topic, and variables for research. ```yaml framework: "crewai" topic: "Secondary Market Research Analysis" variables: company: "Tesla" geography: "North America" industry: "Electric Vehicles" roles: market_overview_specialist: role: "Market Overview Specialist" # ... configuration details ``` -------------------------------- ### Install llama-index and tavily-python Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/FunctionAgent_Workflow.ipynb Install the necessary libraries for llama-index and Tavily web search. ```python %pip install llama-index tavily-python ``` -------------------------------- ### Install Dependencies for Trip Planner Agents Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/surprise_trip_planner_and_itinerary_agents.ipynb Installs the required libraries including langchain_community, praisonai, requests, and duckduckgo_search. ```python # Install dependencies without output %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install requests > /dev/null %pip install duckduckgo_search > /dev/null ``` -------------------------------- ### Install LangChain Community and Google Search Results Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/LangChain_PraisonAI_Agent_Notebook.ipynb Install necessary libraries for using Google Search with LangChain. ```python !pip install langchain-community google-search-results ``` -------------------------------- ### Install Praison AI Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/book_writing_agents.ipynb Installs required Python packages for Praison AI and CrewAI, suppressing installation output. ```bash %pip install langchain_community > /dev/null ``` ```bash %pip install praisonai[crewai] > /dev/null ``` ```bash %pip install duckduckgo-search > /dev/null ``` -------------------------------- ### Install Dependencies for Memory Management Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/memory_management_and_knowledge_retreival_agents.ipynb Installs required Python packages for memory management and knowledge retrieval agents without displaying output. Ensure these are installed before proceeding. ```python # Install dependencies without output %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install duckduckgo_search > /dev/null %pip install mem0ai > /dev/null ``` -------------------------------- ### Initialize and Run PraisonAI Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/cli_operation_agents.ipynb Set up the environment variables and execute the PraisonAI instance. ```python import os from praisonai import PraisonAI from google.colab import userdata # Create a PraisonAI instance with the agent_yaml content praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[CLIExecutorTool]) # Add InstagramSearchTool once scripted # Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below os.environ["OPENAI_API_KEY"] = userdata.get('OPENAI_API_KEY') or "ENTER OPENAI_API_KEY HERE" os.environ["OPENAI_MODEL_NAME"] = "gpt-4o-mini" # Run PraisonAI result = praisonai.run() ``` -------------------------------- ### Run ArXiv Tools Example Source: https://github.com/praison-labs/praison/blob/main/src/praisonai-ts/examples/tools/README.md Execute the ArXiv tools example script using ts-node. Downloaded PDFs will be saved in the examples/downloads directory. ```bash npx ts-node examples/tools/arxiv-tools.ts ``` -------------------------------- ### Install PraisonAI package Source: https://github.com/praison-labs/praison/blob/main/src/praisonai-ts/examples/concepts/README.md Install the required package via npm. ```bash npm install praisonai ``` -------------------------------- ### Install Dependencies with uv Source: https://github.com/praison-labs/praison/blob/main/README.md Commands to set up the development environment using the uv package manager. ```bash # Install uv if you haven't already pip install uv # Install from requirements uv pip install -r pyproject.toml # Install with extras uv pip install -r pyproject.toml --extra code uv pip install -r pyproject.toml --extra "crewai,autogen" ``` -------------------------------- ### Run Real Setup Validation Tests Source: https://github.com/praison-labs/praison/blob/main/src/praisonai/tests/TESTING_GUIDE.md Validate the real setup with autogenerated patterns. This command has a low cost and provides setup-only output. ```python python tests/test_runner.py --pattern real-autogen ``` -------------------------------- ### Install Framework Dependencies Source: https://github.com/praison-labs/praison/blob/main/src/praisonai/tests/e2e/README.md Install the required dependencies for CrewAI and AutoGen integrations. ```bash pip install ".[crewai,autogen]" ``` -------------------------------- ### Initialize and run the PraisonAI agent Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/research_report_generation_agents.ipynb Set up environment variables and execute the PraisonAI instance with the defined configuration. ```python import os from praisonai import PraisonAI from google.colab import userdata # Create a PraisonAI instance with the agent_yaml content praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[TavilyTool]) # Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below os.environ["OPENAI_API_KEY"] = userdata.get('OPENAI_API_KEY') or "ENTER OPENAI_API_KEY HERE" os.environ["TAVILY_API_KEY"] = userdata.get('TAVILY_API_KEY') or "ENTER TAVILY_API_KEY HERE" os.environ["OPENAI_MODEL_NAME"] = "gpt-4o-mini" # Run PraisonAI result = praisonai.run() ``` -------------------------------- ### Selenium WebDriver Initialization and Basic Navigation Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/recruitment_flow_agents.ipynb Sets up a Selenium WebDriver instance, typically for Firefox, and provides methods for navigation and interaction. Ensure Firefox and geckodriver are installed. ```python from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.firefox.options import Options import time class Driver: def __init__(self, url, cookie=None): self.driver = self._create_driver(url, cookie) def navigate(self, url, wait=3): self.driver.get(url) time.sleep(wait) def scroll_to_bottom(self, wait=3): self.driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") time.sleep(wait) self.driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") time.sleep(wait) def get_element(self, selector): return self.driver.find_element(By.CSS_SELECTOR, selector) def get_elements(self, selector): return self.driver.find_elements(By.CSS_SELECTOR, selector) def fill_text_field(self, selector, text): element = self.get_element(selector) element.clear() element.send_keys(text) def click_button(self, selector): element = self.get_element(selector) element.click() def _create_driver(self, url, cookie): options = Options() # options.add_argument("--headless") driver = webdriver.Firefox(options=options) driver.get(url) if cookie: driver.add_cookie(cookie) return driver def close(self): self.driver.close() ``` -------------------------------- ### Install PraisonAI Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/job_profile_matching_agents.ipynb Install the required libraries for PraisonAI and CrewAI integration. ```python # Install dependencies without output %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null ``` -------------------------------- ### Install PraisonAI Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/job_candidate_evaluation.ipynb Install the necessary dependencies for PraisonAI with CrewAI support. ```python # Install dependencies without output %pip install praisonai[crewai] > /dev/null ``` -------------------------------- ### Initialize and Execute PraisonAI Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/screenplay_writer_agents.ipynb Configure the environment variables and execute the PraisonAI workflow. ```python import os from praisonai import PraisonAI from google.colab import userdata # Create a PraisonAI instance with the agent_yaml content praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[]) # Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below os.environ["OPENAI_API_KEY"] = userdata.get('OPENAI_API_KEY') or "ENTER OPENAI_API_KEY HERE" os.environ["OPENAI_MODEL_NAME"] = "gpt-4o-mini" # Run PraisonAI result = praisonai.run() ``` -------------------------------- ### Initialize and Run PraisonAI Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/wikipedia_search_analysis_agents.ipynb Instantiate the PraisonAI framework with the defined configuration and run the agent workflow. ```python import os from praisonai import PraisonAI from google.colab import userdata # Create a PraisonAI instance with the agent_yaml content praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[WikipediaSearchTool]) # Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below os.environ["OPENAI_API_KEY"] = userdata.get('OPENAI_API_KEY') or "ENTER OPENAI_API_KEY HERE" os.environ["OPENAI_MODEL_NAME"] = "gpt-4o-mini" # Run PraisonAI result = praisonai.run() ``` -------------------------------- ### Start the game Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/game_development_agents.ipynb Initiates the main game loop. ```python game_loop() ``` -------------------------------- ### Local Testing of Framework Integration Source: https://github.com/praison-labs/praison/blob/main/src/praisonai/tests/integration/WORKFLOW_INTEGRATION.md Command-line examples for running framework integration tests locally using the `test_runner.py` script. Options include running both frameworks, specific frameworks, or with coverage. ```bash # Run both frameworks python tests/test_runner.py --pattern frameworks # Run AutoGen only python tests/test_runner.py --pattern autogen --verbose # Run CrewAI only python tests/test_runner.py --pattern crewai --verbose # Run with coverage python tests/test_runner.py --pattern frameworks --coverage ``` -------------------------------- ### Install PraisonAI Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/comprehensive_research_report_agents.ipynb Install the necessary libraries for PraisonAI and its integrations in a notebook environment. ```bash # Install dependencies without output %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install requests > /dev/null ``` -------------------------------- ### Install Praison AI Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/marketing_campaign_development_agents.ipynb Install the required Praison AI and search packages silently. ```bash %pip install praisonai[crewai] > /dev/null %pip install duckduckgo_search > /dev/null ``` -------------------------------- ### Initialize LangChain Integration Tests Source: https://github.com/praison-labs/praison/blob/main/src/praisonai/tests/integration/README.md Create an __init__.py file to mark the directory as a Python package for integration tests. ```python # LangChain Integration Tests ``` -------------------------------- ### Install Praison AI Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/job_hunt_agents.ipynb Install the required libraries for Praison AI and LangChain integration. ```bash %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install requests > /dev/null ``` -------------------------------- ### Execute Agent Workflow Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/DuckDuckGo_PraisonAI_Agent_Notebook.ipynb Initialize the agent system with tasks and start the execution process. ```python agents = PraisonAIAgents( agents=[researcher, analyst], tasks=[research_task, analysis_task] ) agents.start() ``` -------------------------------- ### Run Test Runner Help Source: https://github.com/praison-labs/praison/blob/main/src/praisonai/tests/README.md Display help information and available options for the main test runner script. ```bash python tests/test_runner.py --help ``` -------------------------------- ### Get All Memories Tool Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/memory_management_and_knowledge_retreival_agents.ipynb Retrieves all stored memories. Useful for getting an overview of all persisted data. ```python class GetAllMemoriesTool(BaseTool): name: str = "Get All Memories Tool" description: str = ("This tool retrieves all stored memories.\n" ``` ```python m = Memory() result = m.get_all() return result ``` -------------------------------- ### Get Templates API Endpoint Source: https://github.com/praison-labs/praison/blob/main/examples/python/usecases/README-secondary-market-research.md HTTP GET request to retrieve available report templates. ```http GET /research/templates ``` -------------------------------- ### Initialize and Run PraisonAI Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/comprehensive_research_report_agents.ipynb Initialize the PraisonAI instance with the defined configuration and custom tools. ```python import os from praisonai import PraisonAI from google.colab import userdata # Create a PraisonAI instance with the agent_yaml content praisonai = PraisonAI(agent_yaml=agent_yaml, tools=[InternetSearchTool, WebContentReaderTool]) ``` -------------------------------- ### Install Required Dependencies Source: https://github.com/praison-labs/praison/blob/main/examples/cookbooks/yaml/stock_analysis_agents.ipynb Install the necessary Python packages for PraisonAI, LangChain, and SEC data processing. ```bash %pip install langchain_community > /dev/null %pip install praisonai[crewai] > /dev/null %pip install duckduckgo-search > /dev/null %pip install sec-api > /dev/null %pip install embedchain > /dev/null %pip install html2text > /dev/null ```