### Install dappier-go SDK Source: https://docs.dappier.com/integrations/go-sdk Instructions for installing the dappier-go SDK using go get. This is the first step to integrate Dappier's capabilities into your Go applications. ```bash go get github.com/DappierAI/dappier-go ``` -------------------------------- ### Google ADK + Dappier Starter App Setup Source: https://docs.dappier.com/integrations/google-adk-integration Provides instructions for setting up and running a starter application that integrates Google ADK with Dappier SDK. This guide focuses on forking the project on Replit and preparing for API key configuration. ```APIDOC Getting Started: Build the Google ADK + Dappier Starter App Step 1: Fork the Starter App on Replit 1. Open the project in your browser: 👉 [Google ADK + Dappier Starter App](https://replit.com/@dappier/Google-ADK-Dappier-Starter-App?v=1) 2. Click "Fork" at the top-right to create your own copy. 3. Replit will automatically set up the project environment and open the code editor. Once forked, you are ready to configure your API keys. Proceed to Step 2 for API key setup. ``` -------------------------------- ### Dappier RAG API Call Example Source: https://docs.dappier.com/quickstart Demonstrates how to fetch data from a Dappier RAG model using Python and cURL. This involves setting up authentication with an API key and sending a query to a specific endpoint. The response contains the AI-generated output based on the provided query and the RAG model's data. ```python import requests def fetch_dappier_data(query): api_key = "" # Replace with your actual Dappier API key endpoint = "https://api.dappier.com/app/aimodel/am_01j06ytn18ejftedz6dyhz2b15" headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"} body = {"query": query} response = requests.post(endpoint, headers=headers, json=body) return response.json() # Example usage results = fetch_dappier_data("Plan me an itinerary for a 3 day trip to Puerto Rico") print(results) ``` ```bash curl -L 'https://api.dappier.com/app/aimodel/am_01j06ytn18ejftedz6dyhz2b15' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d "{ \"query\": \"Plan me an itinerary for a 3 day trip to Puerto Rico\" }" ``` -------------------------------- ### Install Dappier and LlamaIndex Packages Source: https://docs.dappier.com/cookbook/recipes/llama-index-stock-analyzer Installs the necessary Python packages for Dappier, LlamaIndex, and OpenAI integration. This command-line instruction ensures all dependencies are met before proceeding with the setup. ```bash pip install llama-index llama-index-tools-dappier openai ``` -------------------------------- ### Claude Desktop Configuration for Dappier MCP Source: https://docs.dappier.com/integrations/claude-dappier-mcp-server-integration This JSON configuration enables Claude for Desktop to automatically start the Dappier MCP Server upon application launch. It specifies the command to run and environment variables, including the Dappier API key. ```json { "mcpServers": { "dappier": { "command": "uvx", "args": ["dappier-mcp"], "env": { "DAPPIER_API_KEY": "YOUR_API_KEY_HERE" } } } } ``` -------------------------------- ### Install Dependencies Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-travel-assistant Installs the necessary Python packages for the project, including openai-agents, dappier, colorama, and nest-asyncio, which are essential for building the AI assistant. ```bash !pip install openai-agents dappier colorama nest-asyncio ``` -------------------------------- ### Install Dependencies Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-stock-analyser Installs necessary Python packages for building the AI-powered stock analyzer, including OpenAI Agents SDK, Dappier, colorama, and nest-asyncio. ```bash !pip install openai-agents dappier colorama nest-asyncio ``` -------------------------------- ### Install Dappier Python SDK Source: https://docs.dappier.com/integrations/python-sdk Installs the Dappier Python SDK using pip. This is the first step to integrate Dappier's capabilities into your project. ```bash pip install dappier ``` -------------------------------- ### Install dappier-mcp Package Source: https://docs.dappier.com/cookbook/recipes/dappier-mcp-claude-integration Installs the dappier-mcp Python package using the UV package manager. This command fetches and installs the necessary library for Dappier MCP integration. ```bash uv pip install dappier-mcp ``` -------------------------------- ### Create AI Agent with Dappier Tools (Python) Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-travel-assistant This example demonstrates how to create an AI agent using a Python framework. The agent is configured with a name, specific instructions for query analysis, and a list of tools, including Dappier's real-time search and AI recommendations functions. The agent's instructions guide it to choose between these tools based on the user's query context. ```Python # Assuming Agent class and dappier_real_time_search, dappier_ai_recommendations are defined elsewhere # from your_agent_framework import Agent # from your_dappier_tools import dappier_real_time_search, dappier_ai_recommendations agent = Agent( name="Dappier Assistant", instructions=""" You analyze the user's query and determine whether to use real-time search or AI recommendations. If the query involves stocks, finance, or current events, use `dappier_real_time_search`. If the query is about recommendations (e.g., news, lifestyle, sports, pets), use `dappier_ai_recommendations`. You MUST provide `ai_model_id` or `data_model_id` as necessary. Format responses in structured Markdown. """, tools=[dappier_real_time_search, dappier_ai_recommendations], ) ``` -------------------------------- ### Install OpenAI Agents SDK Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-mcp-travel-assistant Installs the OpenAI Agents SDK using pip, a necessary dependency for building AI agents. ```bash pip install openai-agents ``` -------------------------------- ### Install MCP-Use and LangChain Dependencies Source: https://docs.dappier.com/integrations/mcp-use-integration Installs the necessary Python libraries for using the MCP-Use client and integrating with LangChain, such as OpenAI or Anthropic LLM providers. ```bash pip install mcp-use langchain-openai # or langchain-anthropic ``` -------------------------------- ### Install OpenAI Agents SDK Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-mcp-news-letter Installs the OpenAI Agents SDK using pip, a standard package installer for Python, to enable agent functionality. ```bash pip install openai-agents ``` -------------------------------- ### Install Required Packages Source: https://docs.dappier.com/cookbook/recipes/open-ai-function-calling-stock-analyst Installs the necessary Python packages, 'openai' and 'dappier', required for the stock market analysis functionality. ```bash !pip install openai dappier ``` -------------------------------- ### Install Project Dependencies Source: https://docs.dappier.com/cookbook/recipes/google-adk-dynamic-travel-planner Installs the necessary Python packages for the project, including the Google ADK and Dappier SDKs, using pip. ```bash pip install google-adk dappier ``` -------------------------------- ### Example User Prompts Source: https://docs.dappier.com/cookbook/recipes/agent-ai-dynamic-travel-planner Provides examples of prompts that can be used to gather necessary information from the user for the travel itinerary generation process. ```text Destination Prompt: "Where would you like to go?" Example: "Paris" Travel Dates Prompt: "When would you like to leave for [destination]?" Example: "Coming weekend" Trip Duration Prompt: "How long will this trip be? (in number of days)" Example: 7 ``` -------------------------------- ### Install Libraries (Bash) Source: https://docs.dappier.com/integrations/open-ai-function-calling-integration Installs the necessary Python libraries, 'openai' and 'dappier', required for integrating OpenAI Function Calling with the Dappier SDK. ```bash pip install openai dappier ``` -------------------------------- ### Verify UV Installation Source: https://docs.dappier.com/integrations/cursor-dappier-mcp-integration Checks if the UV package manager has been successfully installed by displaying its version. This confirms the installation process. ```bash uv --version ``` -------------------------------- ### Install UV Package Manager (Windows) Source: https://docs.dappier.com/integrations/cursor-dappier-mcp-integration Installs the UV package manager using a PowerShell command for Windows systems. This is a prerequisite for using Dappier MCP. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Install UV Package Manager (macOS/Linux) Source: https://docs.dappier.com/integrations/cursor-dappier-mcp-integration Installs the UV package manager using a curl script for macOS and Linux systems. This is a prerequisite for using Dappier MCP. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Initialize and Launch Dappier MCP Workflow (Python) Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-mcp-news-letter This Python function initializes the Dappier MCP server with specified parameters, including environment variables for API keys. It then enables tracing for observability and executes the `run` function to start the smart content curator agent. ```Python async def main(): async with MCPServerStdio( cache_tools_list=True, params={ "command": "uvx", "args": ["dappier-mcp"], "env": {"DAPPIER_API_KEY": os.environ["DAPPIER_API_KEY"]}, }, ) as server: with trace(workflow_name="Smart Content Curator with Dappier MCP"): await run(server) ``` -------------------------------- ### Install Project Dependencies with UV Source: https://docs.dappier.com/cookbook/recipes/agentstack-dynamic-travel-planner Synchronizes and installs all project dependencies defined in pyproject.toml using the 'uv' package manager. 'uv lock' generates a lock file, and 'uv sync' installs the packages into the active virtual environment, ensuring a consistent setup. ```bash uv lock uv sync ``` -------------------------------- ### Use Real-Time Search API with Go Source: https://docs.dappier.com/integrations/go-sdk Demonstrates how to initialize the Dappier client and perform a real-time search query using the dappier-go SDK. It shows how to handle API keys and process search results. ```go package main import ( "fmt" "log" "github.com/DappierAI/dappier-go" ) func main() { // Initialize Dappier client client, err := dappier.NewDappierApp("your-api-key") if err != nil { log.Fatalf("Failed to initialize Dappier client: %v", err) } // Make real-time search API request result, err := client.RealtimeSearchAPI("when is election in USA") if err != nil { log.Fatalf("Failed to get search result: %v", err) } // Print the search result fmt.Println("Search Result:", result.Response.Results) } ``` -------------------------------- ### Manually Run Dappier MCP Server Source: https://docs.dappier.com/integrations/claude-dappier-mcp-server-integration Command to manually start the Dappier MCP Server, useful for troubleshooting when the server is not automatically detected or responding. ```bash uvx dappier-mcp ``` -------------------------------- ### Get 9 and 10 News Recommendations Source: https://docs.dappier.com/integrations/llama-index-integration Fetches news recommendations from 9 and 10 News using a specified query and similarity threshold. This example demonstrates a basic usage of the Dappier tool for news retrieval. ```python print( dappier_tool.get_nine_and_ten_news_recommendations( query="northern michigan local news", similarity_top_k=1 ) ) ``` -------------------------------- ### Initialize Dappier Client Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-stock-analyser Initializes the Dappier client using the provided API key, enabling access to Dappier's real-time data platform. ```python dappier_client = Dappier(api_key=os.environ["DAPPIER_API_KEY"]) ``` -------------------------------- ### Initialize and Launch Workflow Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-mcp-travel-assistant The `main` function initializes the Dappier MCP server with necessary parameters and environment variables. It then enables tracing for observability and calls the `run` function to execute the travel planning agent. ```Python async def main(): city, num_days, travel_date = get_user_input() async with MCPServerStdio( cache_tools_list=True, params={ "command": "uvx", "args": ["dappier-mcp"], "env": {"DAPPIER_API_KEY": os.environ["DAPPIER_API_KEY"]}, }, ) as server: with trace(workflow_name="Dynamic Travel Planner with Dappier MCP"): await run(server, city, num_days, travel_date) ``` -------------------------------- ### Install Required Packages Source: https://docs.dappier.com/cookbook/recipes/open-ai-function-calling-sports-summarizer Installs the necessary Python libraries, openai and dappier, for the project. This command is typically run in a terminal or notebook environment. ```bash !pip install openai dappier ``` -------------------------------- ### Install uv (Windows) Source: https://docs.dappier.com/integrations/dappier-mcp-server-integration Installs the uv package manager on Windows systems using PowerShell. This is a prerequisite for installing Dappier MCP Server. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Execute Workflow with uvx Check (Python) Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-mcp-news-letter This Python script serves as the entry point for the application. It first checks if the 'uvx' binary is installed and available in the system path, raising an error if it's not found. Subsequently, it runs the main asynchronous workflow using `asyncio.run()`. ```Python if __name__ == "__main__": if not shutil.which("uvx"): raise RuntimeError( "uvx is not installed. Please install it with `pip install uvx` or " "`curl -LsSf https://astral.sh/uv/install.sh | sh`." ) asyncio.run(main()) ``` -------------------------------- ### Verify UV Installation Source: https://docs.dappier.com/cookbook/recipes/dappier-mcp-claude-integration Checks the installed version of the UV package manager to confirm a successful installation. ```bash uv --version ``` -------------------------------- ### Install Langchain Dappier and OpenAI Packages Source: https://docs.dappier.com/cookbook/recipes/langchain-real-time-market-strategyzer Installs the necessary Langchain Dappier integration package along with its dependencies and the OpenAI package. This ensures all required libraries are available for the project. ```Python #!pip install langchain langchain-dappier langchain-openai ``` -------------------------------- ### Run Dappier MCP Agent with LangChain Source: https://docs.dappier.com/integrations/mcp-use-integration Python script demonstrating how to set up and run an agent using MCP-Use and a Dappier MCP Server. It configures the server connection, initializes an LLM, and executes a query. ```python import asyncio import os from dotenv import load_dotenv from langchain_openai import ChatOpenAI from mcp_use import MCPAgent, MCPClient async def main(): load_dotenv() config = { "mcpServers": { "dappier": { "command": "uvx", "args": ["dappier-mcp"], "env": { "DAPPIER_API_KEY": os.getenv("DAPPIER_API_KEY") } } } } client = MCPClient.from_dict(config) llm = ChatOpenAI(model="gpt-4o") agent = MCPAgent(llm=llm, client=client, max_steps=30) result = await agent.run("Show me the latest news about Tesla.") print(result) if __name__ == "__main__": asyncio.run(main()) ``` -------------------------------- ### Install uv (macOS/Linux) Source: https://docs.dappier.com/integrations/dappier-mcp-server-integration Installs the uv package manager using a curl script on macOS and Linux systems. This is a prerequisite for installing Dappier MCP Server. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install Dappier MCP Server (uv) Source: https://docs.dappier.com/integrations/dappier-mcp-server-integration Installs the Dappier MCP Server Python package using the uv package manager. This is an alternative installation method for the server. ```bash uv pip install dappier-mcp ``` -------------------------------- ### Install Dappier MCP Server (pip) Source: https://docs.dappier.com/integrations/dappier-mcp-server-integration Installs the Dappier MCP Server Python package using pip. This command fetches and installs the necessary libraries for the server. ```bash pip install dappier-mcp ``` -------------------------------- ### Install Dappier and LlamaIndex Packages Source: https://docs.dappier.com/cookbook/recipes/llama-index-dyamic-travel-planner Installs the necessary Python packages for LlamaIndex, the Dappier tool integration, and OpenAI. This command is essential for setting up the environment to run the travel planner. ```bash pip install llama-index llama-index-tools-dappier openai ``` -------------------------------- ### Verify UV Installation Source: https://docs.dappier.com/cookbook/recipes/dappier-mcp-5ire-integration Checks if the UV package manager has been successfully installed by displaying its version number. This command confirms that the installation process was completed correctly. ```shell uv --version ``` -------------------------------- ### Use AI Recommendations API with Go Source: https://docs.dappier.com/integrations/go-sdk Illustrates the usage of the AI Recommendations API with the dappier-go SDK, including basic and advanced parameter configurations. It covers fetching AI-driven recommendations for datamodels and displaying results. ```go package main import ( "fmt" "log" "github.com/DappierAI/dappier-go" ) func main() { // Initialize Dappier client client, err := dappier.NewDappierApp("your-api-key") if err != nil { log.Fatalf("Failed to initialize Dappier client: %v", err) } // Example usage of DappierRagAPI // Parameters: // - query (string): A natural language query or a URL. If a URL is passed, // the AI analyzes the page and performs a semantic search query. // - similarityTopK (int): Number of articles to return (default is 9). // - ref (string): The domain of the site to fetch recommendations from (e.g., techcrunch.com). optional // - numArticlesRef (int): Number of guaranteed articles from the specified domain (if ref is provided). optional // - datamodelID (string): The Data Model ID for the API request. recommendations, err := client.AIRecommendations("latest tech news", "dm_02hr75e8ate6adr15hjrf3ikol") if err != nil { log.Fatalf("Failed to get AI recommendations: %v", err) } // Print the results for _, result := range recommendations.Results { fmt.Printf("Title: %s\nAuthor: %s\nSite: %s\nURL: %s\n\n", result.Title, result.Author, result.Site, result.URL) } // With optional params recommendations, err = client.AIRecommendations( "latest tech news", "dm_02hr75e8ate6adr15hjrf3ikol", dappier.WithSimilarityTopK(5), // Set custom similarity_top_k dappier.WithRef("techcrunch.com"), // Set custom ref dappier.WithNumArticlesRef(5), ) if err != nil { log.Fatalf("Failed to get AI recommendations: %v", err) } // Print the results for _, result := range recommendations.Results { fmt.Printf("Title: %s\nAuthor: %s\nSite: %s\nURL: %s\n\n", result.Title, result.Author, result.Site, result.URL) } } ``` -------------------------------- ### Initialize LLM and Dappier Tool Source: https://docs.dappier.com/cookbook/recipes/langchain-real-time-market-strategyzer Sets up the language model (e.g., GPT-4o) with streaming enabled and binds it to the Dappier Real-Time Search Tool. This prepares the LLM to use the tool for fetching real-time data. ```Python llm = init_chat_model("gpt-4o", model_provider="openai", streaming=True) dappier_tool = DappierRealTimeSearchTool() llm_with_tools = llm.bind_tools([dappier_tool]) ``` -------------------------------- ### Install CAMEL Package Source: https://docs.dappier.com/integrations/camel-integration Installs the CAMEL package with all its dependencies using pip. ```bash pip install "camel-ai[all]" ``` -------------------------------- ### Initialize Dappier SDK Source: https://docs.dappier.com/integrations/python-sdk Initializes the Dappier SDK by setting the API key as an environment variable and creating an instance of the Dappier client. Ensure your API key is kept secure. ```python import os from dappier import Dappier # Set your API key as an environment variable os.environ["DAPPIER_API_KEY"] = "" # Initialize the Dappier SDK app = Dappier() ``` -------------------------------- ### Setup Google ADK Agent with Dappier Tools (Python) Source: https://docs.dappier.com/integrations/google-adk-integration Demonstrates the initialization of a Google ADK Agent. It specifies the agent's name, model, description, instructions, and integrates a list of Dappier tools for fetching live data. This setup enables the agent to interact with various data sources via Dappier. ```python from google.adk.agents import Agent root_agent = Agent( name="dappier_tools_agent", model="gemini-2.0-flash", description="Agent to answer questions using Dappier tools.", instruction="You are a helpful assistant that uses Dappier tools to fetch live data.", tools=[ real_time_web_search, stock_market_data_search, get_sports_news, get_lifestyle_news, get_iheartdogs_content, get_iheartcats_content, get_greenmonster_guides ] ) ``` -------------------------------- ### Install uv Package Manager (Windows) Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-mcp-stock-analyst Installs the `uv` package manager using a PowerShell script on Windows systems. `uv` is a fast Python package installer and is required to run the Dappier MCP server. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Install UV Package Manager (Windows) Source: https://docs.dappier.com/cookbook/recipes/dappier-mcp-claude-integration Installs the UV package manager on Windows systems using a PowerShell script. This command bypasses execution policy restrictions to download and run the installer. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Install uv Package Manager (macOS/Linux) Source: https://docs.dappier.com/cookbook/recipes/open-ai-agent-mcp-stock-analyst Installs the `uv` package manager using a curl script on macOS and Linux systems. `uv` is a fast Python package installer and is required to run the Dappier MCP server. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install Project Dependencies with UV Source: https://docs.dappier.com/cookbook/recipes/agentstack-stock-market-researcher Installs and locks project dependencies using the 'uv' package manager. 'uv lock' generates a lock file based on pyproject.toml, and 'uv sync' installs the specified dependencies into the active virtual environment. ```bash uv lock uv sync ```