### Install Dependencies and Set Up Environment Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/executive-intelligence.mdx Clone the repository, install npm dependencies, and copy the environment example file to set up your local environment variables. ```bash git clone https://github.com/raishs/perplexityhackathon.git cd perplexityhackathon npm install cp .env.example .env.local ``` -------------------------------- ### Podbean Integration Setup Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/Ellipsis.mdx Installs and runs the Podbean integration module for Ellipsis. This involves installing the package and starting the MCP server and client. ```bash cd backend/integrations/podbean_mcp pip install -e . python server.py python client.py server.py ``` -------------------------------- ### Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/financial-news-tracker/README.mdx Install the necessary Python packages for the financial news tracker. Use the requirements file for recommended setup or install manually. ```bash pip install -r requirements.txt ``` ```bash pip install requests pydantic ``` -------------------------------- ### Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/discord-py-bot/README.mdx Set up a virtual environment and install the necessary Python packages for the bot. ```bash # Create a virtual environment (recommended) python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install required packages pip install -r requirements.txt ``` -------------------------------- ### Start Backend and Frontend Applications Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/4point-Hoops.mdx Instructions to start the backend Python Flask API and the frontend React application. Ensure the backend is running before starting the frontend to avoid connection issues. ```bash cd 4Point-Hoops-Server python app.py cd hoop-ai-frontend-44 npm run dev ``` -------------------------------- ### Run Example Script Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/articles/memory-management/chat-with-persistence/README.mdx Executes the example usage script to test the persistent chat functionality. ```bash python3 scripts/example_usage.py ``` -------------------------------- ### Install Perplexity Lens Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/perplexity-lens.mdx Clone the repository, navigate to the directory, install dependencies, and build the extension. ```bash # Clone the repository git clone https://github.com/iamaayushijain/perplexity-lens.git cd perplexity_lens # Install dependencies npm install # Build the extension npm run build ``` -------------------------------- ### Clone Repository and Setup Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/sonar-chromium-browser.mdx Clone the repository and follow README for detailed Chromium setup instructions before applying patches. ```bash git clone https://github.com/KoushikBaagh/perplexity-hackathon-chromium.git cd perplexity-hackathon-chromium # Apply patches to Chromium source # Follow the README for detailed Chromium setup instructions ``` -------------------------------- ### Start Backend and Frontend Servers Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/monday.mdx Start the backend server using Node.js and then launch the frontend development server. This is necessary to run the Monday application. ```bash # Start Backend Server node backend-server.js # Start frontend npm run dev ``` -------------------------------- ### Clone and Install Briefo Project Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/briefo.mdx Clone the Briefo public repository and install its dependencies using npm. ```bash git clone https://github.com/adamblackman/briefo-public.git cd briefo-public npm install ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/first-principle.mdx Navigate to the client directory and run the npm start command to launch the React frontend. The client will be accessible at http://localhost:3000. ```bash cd client npm start ``` -------------------------------- ### Install and Build Chrome Extension Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/uncovered.mdx Commands to clone the repository, install dependencies, and build the Chrome extension. ```bash # Clone the repository git clone https://github.com/aayushsingh7/UnCovered.git cd UnCovered # Install dependencies npm install # Build the Chrome extension npm run build ``` -------------------------------- ### Backend Installation Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/Ellipsis.mdx Installs backend dependencies for Ellipsis. Ensure you are in the 'backend' directory and have Python 3.10+ and pip installed. Activate your virtual environment before running. ```bash cd backend python -m venv venv source venv/bin/activate # macOS/Linux pip install -r requirements.txt ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/flow-and-focus.mdx Installs project dependencies and sets up environment variables. Ensure Node.js 18+ and npm are installed. ```bash git clone https://github.com/michitomo/NewsReel.git cd NewsReel npm install cp .env.example .env.local ``` -------------------------------- ### Quick Start Fact Check Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/fact-checker-cli/README.mdx Run a quick fact check on a given claim immediately after setup. ```bash ./fact_checker.py -t "The Earth is flat and NASA is hiding the truth." ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/greenify.mdx Clone the repository and install frontend and backend dependencies using npm and pip. ```bash git clone https://github.com/deepjyotipaulhere/greenify.git cd greenify npm install cd service pip install -r requirements.txt ``` -------------------------------- ### Install Dependencies for Research Finder Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/research-finder/README.mdx Installs the necessary Python packages for the research finder script. Use the requirements file for a streamlined setup. ```bash pip install -r requirements.txt ``` ```bash pip install requests ``` -------------------------------- ### Start Development Server Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/flow-and-focus.mdx Launches the Next.js development server. Access the application at http://localhost:3000. ```bash npm run dev ``` -------------------------------- ### Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/fact-checker-cli/README.mdx Install the necessary Python packages for the fact-checker CLI. It's recommended to install from a requirements file. ```bash pip install -r requirements.txt ``` ```bash pip install requests pydantic newspaper3k ``` -------------------------------- ### Start TruthTracer Backend and Frontend Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/truth-tracer.mdx Run the backend development server and the frontend development server to access the application locally. ```bash cd truth-tracer-backend npm run start:dev cd truth-tracer-front npm start ``` -------------------------------- ### Quick Start: Track Tech Stocks Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/financial-news-tracker/README.mdx Run the tracker to get the latest financial news and analysis for 'tech stocks'. This command fetches recent news, analyzes sentiment, and provides insights. ```bash ./financial_news_tracker.py "tech stocks" ``` -------------------------------- ### Clone and Install Frontend and Backend Repositories Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/4point-Hoops.mdx Clone the frontend and backend repositories for the 4Point Hoops application and install their respective dependencies. Ensure Node.js 16+ and Python 3.8+ are installed. ```bash git clone https://github.com/rapha18th/hoop-ai-frontend-44.git cd hoop-ai-frontend-44 npm install git clone https://github.com/rapha18th/4Point-Hoops-Server.git cd 4Point-Hoops-Server pip install -r requirements.txt ``` -------------------------------- ### Install Perplexity Client Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/perplexity-client.mdx Clone the repository, navigate to the directory, and install project dependencies using npm. ```bash git clone https://github.com/straight-heart/Perplexity-client-.git cd Perplexity-client- npm install npm run dev ``` -------------------------------- ### Run Briefo Development Server Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/briefo.mdx Start the Expo development server to run the Briefo application locally. ```bash npx expo start ``` -------------------------------- ### Start Backend Server Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/first-principle.mdx Navigate to the flask-server directory and run the Python script to start the backend server. The server will be accessible at http://localhost:5000. ```bash cd flask-server python server.py ``` -------------------------------- ### Install and Build Obsidian Plugin Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/daily-news-briefing.mdx Commands to clone the repository, install dependencies, and build the Obsidian plugin. ```bash # Clone the repository git clone https://github.com/ChenziqiAdam/Daily-News-Briefing.git cd Daily-News-Briefing # Install dependencies npm install # Build the plugin npm run build ``` -------------------------------- ### Launch Frontend Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/Ellipsis.mdx Starts the Ellipsis frontend development server. Navigate to the 'frontend' directory before running this command. ```bash cd frontend npm run dev ``` -------------------------------- ### Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/articles/memory-management/chat-summary-memory-buffer/README.mdx Install the necessary LlamaIndex and OpenAI libraries. Ensure versions are compatible with the project requirements. ```text llama-index-core>=0.10.0 llama-index-llms-openai>=0.10.0 openai>=1.12.0 ``` -------------------------------- ### Install Backend and Frontend Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/perplexicart.mdx Clone the repository and set up the backend (FastAPI) and frontend (Next.js) dependencies using pip and npm/yarn. ```bash git clone https://github.com/fizakhan90/perplexicart.git cd perplexicart # Backend (FastAPI) setup cd backend python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt # Frontend (Next.js) setup cd ../frontend npm install ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/bazaar-ai-saathi.mdx Clone the repository and install the necessary Python packages for the BazaarAISaathi project. Ensure you have Python 3.8+ and pip installed. ```bash git clone https://github.com/mahanteshimath/BazaarAISaathi.git cd BazaarAISaathi pip install -r requirements.txt ``` -------------------------------- ### Frontend Installation Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/Ellipsis.mdx Installs frontend dependencies for Ellipsis using npm. Navigate to the 'frontend' directory before executing this command. ```bash cd ../frontend npm install ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/mvp-lifeline-ai-app.mdx Clone the MVP LifeLine repository and install Flutter dependencies. Ensure you have Flutter SDK and Dart installed. ```bash # Clone the repository git clone https://github.com/JohnUmoh/asgard.git cd asgard # Install Flutter dependencies flutter pub get # Configure Firebase flutterfire configure # Set up environment variables cp .env.example .env ``` -------------------------------- ### Launch Backend Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/Ellipsis.mdx Starts the Ellipsis backend server. Ensure you are in the 'backend' directory and have activated your Python virtual environment. ```bash cd backend python app.py ``` -------------------------------- ### Install Required Packages Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/disease-qa/disease_qa_tutorial.ipynb Install necessary Python packages for the project using pip. Ensure you have Python 3.x installed. ```bash pip install requests pandas jupyterlab ``` -------------------------------- ### Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/disease-qa/README.mdx Install the required Python packages for the application. It is recommended to use the requirements file if available. ```bash pip install -r requirements.txt ``` ```bash pip install requests pandas python-dotenv ipython ``` -------------------------------- ### Clone and Install Backend/Frontend Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/truth-tracer.mdx Clone the backend and frontend repositories and install their respective Node.js dependencies. ```bash git clone https://github.com/anthony-okoye/truth-tracer-backend.git cd truth-tracer-backend npm install # Clone the frontend repository git clone https://github.com/anthony-okoye/truth-tracer-front.git cd truth-tracer-front npm install ``` -------------------------------- ### Example Usage: Direct API Call and Browser UI Launch Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/disease-qa/disease_qa_tutorial.ipynb Provides example functions to test the Perplexity API directly with a question and to launch the browser-based UI. The direct API call is commented out to conserve API quota. ```python # Step 7: Example Usage def test_api_in_notebook(): print("Example 1: Direct API Call") print("-------------------------") example_question = "What is diabetes?" print(f"Question: {example_question}") print("Sending request to Perplexity API...") # Uncomment the following lines to make an actual API call: # result = ask_disease_question(example_question) # display_results(result) print("(API call commented out to avoid using your API quota)") print("\n") def launch_browser_app(): print("Example 2: Launching Browser UI") print("-----------------------------") print("Generating HTML file and opening in browser...") path = launch_browser_ui() print(f"\nHTML file created at: {path}") print("\nIf the browser doesn't open automatically, you can manually open the file above.") try: display(HTML(f'
Preview of UI (may not work in all environments):
')) display(IFrame(path, width='100%', height=600)) except Exception as e: print("Preview not available in this environment.") # Run the examples test_api_in_notebook() launch_browser_app() print('Example usage executed.') ``` -------------------------------- ### Clone and Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/fact-dynamics.mdx Clone the repository and install project dependencies using Flutter. ```bash git clone https://github.com/vishnu32510/fact_pulse.git cd fact_pulse flutter pub get ``` -------------------------------- ### Setup and Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/disease-qa/disease_qa_tutorial.ipynb Import essential Python libraries for making API requests, handling data, and displaying output in a Jupyter environment. This step ensures all necessary modules are available. ```python # Step 1: Setup and Dependencies import requests import json import pandas as pd from IPython.display import HTML, display, IFrame import os import webbrowser from pathlib import Path print('Setup complete.') ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/first-principle.mdx Clone the First-Principle repository and set up both the backend (Flask) and frontend (React) dependencies. ```bash git clone https://github.com/william-Dic/First-Principle.git cd First-Principle # Backend setup cd flask-server pip install -r requirements.txt # Frontend setup cd ../client npm install ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/discord-py-bot/README.mdx Copy the example environment file and update it with your Discord bot token and Perplexity API key. ```bash cp env.example .env ``` ```dotenv DISCORD_TOKEN="your_discord_bot_token_here" PERPLEXITY_API_KEY="your_perplexity_api_key_here" ``` -------------------------------- ### Install Dependencies and Make Script Executable Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/equity-research-brief/README.mdx Installs necessary Python packages and makes the main script executable. Ensure you are in the correct directory. ```bash cd docs/examples/equity-research-brief pip install -r requirements.txt chmod +x equity_research_brief.py ``` -------------------------------- ### Start Backend and Frontend Services Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/starplex.mdx Run the backend Python FastAPI application and the frontend Next.js development server. ```bash cd backend python main.py ``` ```bash cd frontend npm run dev ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/discord-py-bot/README.mdx Clone the API cookbook repository and change the directory to the discord-py-bot example. ```bash git clone https://github.com/perplexity-ai/api-cookbook.git cd api-cookbook/docs/examples/discord-py-bot/ ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/monday.mdx Clone the Monday project repository and install its dependencies using npm. Ensure you are in the correct directory after cloning. ```bash git clone https://github.com/srivastavanik/monday.git cd monday git checkout final cd nidsmonday npm install ``` -------------------------------- ### Install Required Packages Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/daily-knowledge-bot/README.mdx Install the necessary Python packages for the daily knowledge bot. It's recommended to use a requirements file if available. ```bash pip install -r requirements.txt ``` ```bash pip install requests python-dotenv ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/articles/memory-management/README.mdx Clone the API cookbook repository and navigate to the memory management directory to access implementation guides. ```bash git clone https://github.com/your-repo/api-cookbook.git cd api-cookbook/articles/memory-management ``` -------------------------------- ### Set Environment Variables Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/articles/openai-agents-integration/README.mdx Before running the example, set your Perplexity API key as an environment variable. ```bash export EXAMPLE_API_KEY="your-perplexity-api-key" ``` -------------------------------- ### Start Backend and Frontend Servers Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/perplexicart.mdx Run the FastAPI backend server for API operations and the Next.js frontend server for the user interface. ```bash cd backend uvicorn main:app --reload # adapt module:app if your entrypoint differs cd ../frontend npm run dev ``` -------------------------------- ### Start the Discord Bot Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/discord-py-bot/README.mdx Run the bot script to start the Discord bot. Ensure your environment variables are set correctly. ```bash python bot.py ``` -------------------------------- ### Start Backend and Frontend Services Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/greenify.mdx Run the Flask backend service and the Expo frontend application to use the Greenify app. ```bash cd service python app.py npx expo start ``` -------------------------------- ### Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/articles/openai-agents-integration/README.mdx Install the necessary Python packages for OpenAI Agents SDK and asynchronous operations. `nest-asyncio` is useful for environments like Jupyter notebooks. ```bash pip install openai nest-asyncio ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/starplex.mdx Clone the StarPlex repository and install backend and frontend dependencies using pip and npm. ```bash git clone https://github.com/JerryWu0430/StarPlex.git cd StarPlex # Backend setup cd backend pip install -r requirements.txt # Frontend setup cd ../frontend npm install ``` -------------------------------- ### Set Perplexity API Key via .env File Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/README.mdx Set up your Perplexity API key by creating a .env file in the example directory with the PERPLEXITY_API_KEY variable. This method is an alternative to using environment variables. ```bash PERPLEXITY_API_KEY=your-api-key-here ``` -------------------------------- ### Install Dependencies Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/articles/memory-management/chat-with-persistence/README.mdx Lists the required Python packages for the persistent chat memory implementation. ```bash llama-index-core>=0.10.0 llama-index-vector-stores-lancedb>=0.1.0 lancedb>=0.4.0 openai>=1.12.0 python-dotenv>=0.19.0 ``` -------------------------------- ### Get Help Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/fact-checker-cli/README.mdx Display the help message for the fact-checker CLI, showing all available options and commands. ```bash ./fact_checker.py --help ``` -------------------------------- ### Start BazaarAISaathi Application Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/bazaar-ai-saathi.mdx Launch the main Streamlit application to access the BazaarAISaathi dashboard and features. Ensure the `secrets.toml` file is correctly configured. ```bash streamlit run Home.py ``` -------------------------------- ### Task Scheduler Arguments Example (Windows) Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/daily-knowledge-bot/daily_knowledge_bot.ipynb Example configuration for Windows Task Scheduler to run a Python script. Specify the correct paths for Python executable and the script. ```powershell Program: C:\Path\to\Python.exe Arguments: C:\Path\to\daily_knowledge_bot.py ``` -------------------------------- ### Start Redis Server Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/Ellipsis.mdx Launches the Redis server on the default port 6380, which is required for the Ellipsis backend to function. ```bash redis-server --port 6380 ``` -------------------------------- ### Configure Firebase Project Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/mvp-lifeline-ai-app.mdx Configure your Flutter project with Firebase services. This command guides you through the setup process. ```bash flutterfire configure ``` -------------------------------- ### MDX File Structure for Cookbook Contributions Source: https://github.com/perplexityai/api-cookbook/blob/main/CONTRIBUTING.md This is a template for the structure of an MDX file when contributing examples or articles. It includes frontmatter, project title, introduction, features, prerequisites, installation, usage, code explanation, links, and limitations. ```mdx --- title: Your Project Title description: A concise description of what your project does sidebar_position: 1 keywords: [relevant, keywords, for, search] --- # Project Title Brief introduction explaining what your project does and why it's useful. ## Features - Key feature 1 - Key feature 2 - Key feature 3 ## Prerequisites What users need before they can use your project. ## Installation Step-by-step installation instructions. ## Usage Clear examples of how to use your project. ## Code Explanation Key code snippets with explanations of how they work. ## Links - [GitHub Repository](https://github.com/yourusername/yourproject) - [Live Demo](https://yourproject.com) (if applicable) ## Limitations Any known limitations or considerations users should be aware of. ``` -------------------------------- ### Set Up Environment and API Key Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/daily-knowledge-bot/daily_knowledge_bot.ipynb Imports necessary libraries and configures the Perplexity API key. It's recommended to use environment variables for sensitive keys. ```python import requests import json import os from datetime import datetime # Replace this with your actual Perplexity API key API_KEY = "your_perplexity_api_key" # Alternatively, you can set it as an environment variable # API_KEY = os.environ.get("PERPLEXITY_API_API_KEY") # Verify we have an API key if not API_KEY or API_KEY == "your_perplexity_api_key": print("⚠️ Warning: You need to set your actual API key to use this notebook.") else: print("✅ API key is set.") ``` -------------------------------- ### Example Fact Check Command Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/fact-checker-cli/README.mdx An example command to fact-check a common misconception about the Great Wall of China. ```bash ./fact_checker.py -t "The Great Wall of China is visible from the moon." ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/starplex.mdx Create a .env file in the backend directory to configure Perplexity API key, Mapbox token, and SERP API key. ```ini PERPLEXITY_API_KEY=your_perplexity_api_key MAPBOX_TOKEN=your_mapbox_token SERPAPI_KEY=your_serpapi_key ``` -------------------------------- ### Cron Job Scheduling Example Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/daily-knowledge-bot/daily_knowledge_bot.ipynb Example cron job entry for scheduling a Python script to run daily at 9 AM. Ensure the paths to Python and the script are correct. ```bash 0 9 * * * /path/to/python /path/to/daily_knowledge_bot.py ``` -------------------------------- ### Native Package Installation Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/Ellipsis.mdx Installs specific native Python packages required for audio processing and AI integration within the Ellipsis backend. These include llama-cpp-python, orpheus-cpp, and huggingface_hub. ```bash pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu pip install git+https://github.com/freddyaboulton/orpheus-cpp.git pip install huggingface_hub[hf_xet] hf_xet ``` -------------------------------- ### Build Perplexity Client for Platforms Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/perplexity-client.mdx Build the Electron application for specific operating systems using npm scripts. ```bash npm run build:win # Windows npm run build:mac # macOS npm run build:linux # Linux ``` -------------------------------- ### Run Disease Information App Tutorial Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/README.mdx Launch the Disease Information App tutorial using Jupyter Notebook. This interactive web application allows for medical information lookup, structured knowledge card display, and citation tracking for medical sources. ```bash cd disease-qa/ jupyter notebook disease_qa_tutorial.ipynb ``` -------------------------------- ### Backend Configuration Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/Ellipsis.mdx Sets up the backend environment variables for Ellipsis. Create a .env file in the 'backend' directory and populate it with your Redis URL and Perplexity API key. ```ini REDIS_URL=redis://your-redis-host:6379 PERPLEXITY_API_KEY=your_key_here PODBEAN_CLIENT_ID=... PODBEAN_CLIENT_SECRET=... ``` -------------------------------- ### Use Custom Prompt File Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/fact-checker-cli/README.mdx Provide a custom prompt in a file to guide the fact-checking process. ```bash ./fact_checker.py --text "The first human heart transplant was performed in the United States." --prompt-file custom_prompt.md ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/flow-and-focus.mdx Sets up the necessary API keys and model configuration in the .env.local file. Replace placeholders with your actual API keys. ```ini PERPLEXITY_API_KEY=your_perplexity_api_key_here RUNWARE_API_KEY=your_runware_api_key_here PERPLEXITY_FOCUS_MODEL=sonar-deep-research ``` -------------------------------- ### Configure API Keys Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/monday.mdx Create a .env file to store your Perplexity, ElevenLabs, and YouTube API keys. These keys are required for the application to function correctly. ```ini # Create a .env file and set your API keys PERPLEXITY_API_KEY=your_api_key ELEVENLABS_API_KEY=your_api_key YOUTUBE_API_KEY=your_api_key ``` -------------------------------- ### Check Python Version Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/discord-py-bot/README.mdx Verify that your Python installation meets the minimum requirement of Python 3.8 or higher. ```bash python --version # Should be 3.8 or higher ``` -------------------------------- ### Configure Perplexity API Key Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/greenify.mdx Create a .env file in the 'service' directory and add your Perplexity API key. ```ini PPLX_API_KEY=your_perplexity_api_key_here ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/showcase/mvp-lifeline-ai-app.mdx Set up your API keys and project IDs in the .env file for Perplexity, OpenAI, Firebase, and Twilio integration. ```ini PERPLEXITY_API_KEY=your_sonar_api_key OPENAI_API_KEY=your_openai_api_key FIREBASE_PROJECT_ID=your_firebase_project_id TWILIO_ACCOUNT_SID=your_twilio_sid TWILIO_AUTH_TOKEN=your_twilio_token ``` -------------------------------- ### Set API Key in a File Source: https://github.com/perplexityai/api-cookbook/blob/main/docs/examples/fact-checker-cli/README.mdx Store your Perplexity API key in a file named .pplx_api_key in the script's directory and set appropriate permissions. ```bash echo "YOUR_API_KEY" > .pplx_api_key chmod 600 .pplx_api_key ```