### Install Dependencies and Set API Keys for ACI Agents Source: https://github.com/aipotheosis-labs/aci-agents/tree/main This snippet describes the initial setup steps for running ACI Agents examples. It involves cloning the repository, installing dependencies using 'uv sync', and setting environment variables for API keys (OpenAI, Anthropic, ACI) and other configurations like BRAVE_SEARCH and LINKED_ACCOUNT_OWNER_ID. ```bash uv sync export OPENAI_API_KEY='your-openai-api-key' export ANTHROPIC_API_KEY='your-anthropic-api-key' export ACI_API_KEY='your-aci-api-key' export LINKED_ACCOUNT_OWNER_ID='your-owner-id' ``` -------------------------------- ### Display Getting Started Links with Cards (JSX) Source: https://docs.camel-ai.org/ This JSX code renders a 'CardGroup' with three 'Card' components, providing quick links to get started with the CAMEL-AI project. It includes 'Quickstart', 'Installation', and 'Explore Cookbooks' sections, each with an icon and a brief description. ```jsx _jsx(Heading, { level: "2", id: "ready-to-get-started%3F", children: "Ready to Get Started?" }), "\n", _jsxs(CardGroup, { cols: 3, children: [_jsx(Card, { title: "Quickstart", icon: "bolt", href: "/cookbooks/basic_concepts/create_your_first_agent", children: _jsx(_components.p, { children: "Spin up your first agent in under 5 minutes" }) }), _jsx(Card, { title: "Installation", icon: "wrench", href: "/get_started/installation", children: _jsx(_components.p, { children: "pip install camel-ai[all] – all toolkits and interpreters included" }) }), _jsx(Card, { title: "Explore Cookbooks", icon: "book-open", href: "/cookbooks/", children: _jsx(_components.p, { children: "Hands‑on examples: data gen, RAG, simulations, and more" }) })] }) ``` -------------------------------- ### Running ACI Agents Examples Source: https://github.com/aipotheosis-labs/aci-agents/tree/main Instructions for setting up and running ACI Agents examples. This involves cloning the repository, installing dependencies, setting API keys (OpenAI, Anthropic, ACI), configuring apps on the ACI platform, linking accounts, and running Python scripts. ```bash uv sync export OPENAI_API_KEY='YOUR_API_KEY' export ANTHROPIC_API_KEY='YOUR_API_KEY' export ACI_API_KEY='YOUR_API_KEY' export LINKED_ACCOUNT_OWNER_ID='YOUR_OWNER_ID' python examples/agent_with_pre_planned_tools.py ``` -------------------------------- ### Dynamic Tool Discovery - Initializing Tools in Python Source: https://context7_llms Shows the initial setup for dynamic tool discovery by defining meta functions and an empty list for retrieved tools. This is the starting point for allowing an LLM to discover and use tools dynamically. ```python tools_meta = [ ACISearchFunctions.to_json_schema(FunctionDefinitionFormat.OPENAI), ] tools_retrieved = [] ``` -------------------------------- ### Install ACI SDK Source: https://github.com/aipotheosis-labs/aci-python-sdk/tree/main Installs the ACI Python SDK using pip. Alternatively, it can be installed using uv. ```bash pip install aci-sdk # or with uv: uv add aci-sdk ``` -------------------------------- ### Install GitHub Copilot Python SDK Source: https://github.com/aipotheosis-labs/aci-python-sdk/tree/main Installs the official Python SDK for the Aipolabs API using pip. Ensure you have Python and pip installed. ```bash pip install aci-python-sdk ``` -------------------------------- ### Install ACI Python SDK Source: https://github.com/aipotheosis-labs/aci-python-sdk Installs the ACI Python SDK using pip. This is the primary method for setting up the SDK in your Python environment. ```shell pip install aci-sdk ``` -------------------------------- ### Bash Example Query for GitHub Repo Creation Source: https://context7_llms This bash command provides an example of a user query to be input into the running ACIToolkit script. The query requests the creation of a GitHub repository with a specific name and a README file. ```bash "Create a GitHub repository named 'my-aci-toolkit-demo' and add a README.md file with the content '# ACI Toolkit Demo'." ``` -------------------------------- ### Install CAMEL-AI with pip Source: https://docs.camel-ai.org/ Installs the CAMEL-AI library along with all optional toolkits and interpreters using pip. This command provides a quick way to set up CAMEL-AI with all dependencies. ```shell pip install camel-ai[all] ``` -------------------------------- ### Environment Variable Setup for ACI Agents Source: https://github.com/aipotheosis-labs/aci-agents This snippet details the environment variables required to run Aipolabs Agent examples. It includes API keys for OpenAI, Anthropic, and ACI, as well as configuration for specific apps like Brave Search and linked account details. ```shell export OPENAI_API_KEY='your_openai_api_key' export ANTHROPIC_API_KEY='your_anthropic_api_key' export ACI_API_KEY='your_aci_api_key' export BRAVE_SEARCH='your_brave_search_api_key' export LINKED_ACCOUNT_OWNER_ID='your_owner_id' ``` -------------------------------- ### Example User Query for GitHub Actions (Bash) Source: https://context7_llms This is an example of a user query provided to the running CAMEL AI agent. The query instructs the agent to create a new GitHub repository named 'my-ski-demo' with a specific description and then add a README.md file containing predefined content. The agent executes these commands using the GitHub tool accessible through the MCP server. ```bash Create a new GitHub repository named 'my-ski-demo' with the description 'A demo repository for top US skiing locations' and push a README.md file with the content: '# Epic Ski Destinations\nBest spots: Aspen, Vail, Park City.' ``` -------------------------------- ### Agent with Pre-planned Tools Example (Python) Source: https://github.com/aipotheosis-labs/aci-agents/tree/main Demonstrates an agent configured with a predefined set of tools, suitable for scenarios where tool requirements are known in advance. This example is part of the OpenAI integration. ```python from aci.agent import Agent from aci.tools import Tool # Define your tools search_tool = Tool( name="web_search", description="Searches the web for information.", func=lambda query: f"Results for {query}: ..." ) calculator_tool = Tool( name="calculator", description="Performs mathematical calculations.", func=lambda expression: eval(expression) ) # Initialize the agent with pre-planned tools agent = Agent( tools=[search_tool, calculator_tool], llm="openai" ) # Run the agent response = agent.run("What is the capital of France and what is 2+2?") print(response) ``` -------------------------------- ### Cloning Repository and Installing Dependencies Source: https://github.com/aipotheosis-labs/aci-agents Provides the command to clone the Aipolabs Agents repository and install its dependencies. This is the initial step for setting up the project. ```shell uv sync ``` -------------------------------- ### Install uv and run aci-mcp Source: https://github.com/aipotheosis-labs/aci-mcp Installs the 'uv' package manager and then runs the 'aci-mcp' command with the '--help' flag to display its usage information. This is a common first step for interacting with the ACI.dev MCP servers. ```shell # Install uv if you don't have it already curl -sSf https://install.pypa.io/get-pip.py | python3 - pip install uv ``` ```shell $ uvx aci-mcp --help Usage: aci-mcp [OPTIONS] COMMAND [ARGS]... Main entry p ``` -------------------------------- ### Fetch Repositories using ACI SDK Source: https://github.com/aipotheosis-labs/aci-python-sdk/tree/main Example of fetching repositories using the ACI Python SDK. This assumes the client has been initialized. ```python from aci_python_sdk import ACIClient client = ACIClient(api_token='YOUR_API_TOKEN') # Fetch repositories repositories = client.get_repositories() for repo in repositories: print(f"Repository: {repo.name}, ID: {repo.id}") ``` -------------------------------- ### Running Agent Examples with uv Source: https://github.com/aipotheosis-labs/aci-agents Demonstrates how to execute a specific Aipolabs Agent example using the 'uv run' command. This command is used to run Python scripts within the project's environment. ```shell uv run python examples/agent_with_pre_planned_tools.py ``` -------------------------------- ### Install uv with pip Source: https://context7_llms Installs the 'uv' package manager using curl and pip. This is a prerequisite for setting up the Apps MCP Server. ```bash # Install uv if you don't have it already curl -sSf https://install.pypa.io/get-pip.py | python3 - pip install uv ``` -------------------------------- ### Search and Get Apps Source: https://github.com/aipotheosis-labs/aci-python-sdk/tree/main Demonstrates searching for apps based on intent and other criteria, and retrieving detailed information for a specific app. ```python from aci.types.apps import AppBasic, AppDetails # search for apps, returns list of basic app data, sorted by relevance to the intent # all parameters are optional apps: list[AppBasic] = client.apps.search( intent="I want to search the web", allowed_apps_only=False, # If true, only return apps that are allowed by the agent/accessor, identified by the api key. include_functions=False, # If true, include functions (name and description) in the search results. categories=["search"], limit=10, offset=0 ) # get detailed information about an app, including functions supported by the app app_details: AppDetails = client.apps.get(app_name="BRAVE_SEARCH") ``` -------------------------------- ### Install uv package manager Source: https://github.com/aipotheosis-labs/aci-mcp Installs the 'uv' package manager, a prerequisite for running ACI.dev MCP servers locally. This command should be run once to set up the environment. ```shell curl -sSf https://install.pypa.io/get-pip.py | python3 - pip install uv ``` -------------------------------- ### GET /v1/linked-accounts/oauth2 Source: https://context7_llms Start an OAuth2 account linking process. It will return a redirect url to the OAuth2 provider's authorization endpoint. ```APIDOC ## GET /v1/linked-accounts/oauth2 ### Description Start an OAuth2 account linking process. It will return a redirect url (as a string, instead of RedirectResponse) to the OAuth2 provider's authorization endpoint. ### Method GET ### Endpoint /v1/linked-accounts/oauth2 ### Parameters #### Query Parameters - **app_name** (string) - Required - The name of the app to link the account to. - **redirect_uri** (string) - Required - The URI to redirect to after authorization. ``` -------------------------------- ### GET /v1/app-configurations/{app_name} Source: https://context7_llms Get an app configuration by app name. ```APIDOC ## GET /v1/app-configurations/{app_name} ### Description Get an app configuration by app name. ### Method GET ### Endpoint /v1/app-configurations/{app_name} ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the app configuration to retrieve. ``` -------------------------------- ### GET /v1/linked-accounts/{linked_account_id} Source: https://context7_llms Get a linked account by its id. `linked_account_id` uniquely identifies a linked account across the platform. ```APIDOC ## GET /v1/linked-accounts/{linked_account_id} ### Description Get a linked account by its id. `linked_account_id` uniquely identifies a linked account across the platform. ### Method GET ### Endpoint /v1/linked-accounts/{linked_account_id} ### Parameters #### Path Parameters - **linked_account_id** (string) - Required - The ID of the linked account to retrieve. ``` -------------------------------- ### Get App Configuration API Source: https://context7_llms Retrieves a specific app configuration by its name using a GET request to /v1/app-configurations/{app_name}. ```HTTP get /v1/app-configurations/{app_name} ``` -------------------------------- ### Initialize GitHub Copilot Client Source: https://github.com/aipotheosis-labs/aci-python-sdk/tree/main Demonstrates how to initialize the ACI Python SDK client with an API token. Replace 'YOUR_API_TOKEN' with your actual token. ```python from aci_python_sdk import ACIClient client = ACIClient(api_token='YOUR_API_TOKEN') ``` -------------------------------- ### Get Linked Account API Source: https://context7_llms Retrieves a specific linked account by its unique ID using a GET request to /v1/linked-accounts/{linked_account_id}. ```HTTP get /v1/linked-accounts/{linked_account_id} ``` -------------------------------- ### Environment Variables Setup (.env file) Source: https://context7_llms Sets up essential environment variables required for ACI Dev LLMs integration, including API keys for Gemini and ACI, and a linked account owner ID. These variables are crucial for authenticating and configuring the connection to ACI's services. ```bash GEMINI_API_KEY="your_gemini_api_key_here" ACI_API_KEY="your_aci_api_key_here" LINKED_ACCOUNT_OWNER_ID="your_linked_account_owner_id_here" ``` -------------------------------- ### Initialize Repository with uv Source: https://context7_llms Initializes a new repository using the 'uv' package manager. This is a prerequisite for managing project dependencies. ```bash uv init ``` -------------------------------- ### Initialize ACI Client Source: https://github.com/aipotheosis-labs/aci-python-sdk Initializes the ACI client, optionally reading the API key from environment variables. This is the entry point for interacting with the ACI platform. ```python import os from aci import ACI client = ACI( # it reads from environment variable by default so you can omit it if you set it in your environment api_key=os.environ.get("ACI_API_KEY") ) ``` -------------------------------- ### Get Function Definition API Source: https://context7_llms Returns the definition of a function, suitable for direct LLM use, via a GET request to /v1/functions/{function_name}/definition. ```HTTP get /v1/functions/{function_name}/definition ``` -------------------------------- ### Get App Details API Source: https://context7_llms Retrieves detailed information about an application, including its name, description, and functions, via a GET request to /v1/apps/{app_name}. ```HTTP get /v1/apps/{app_name} ``` -------------------------------- ### Example OpenAI Chat Completion API Call with Custom Tool Source: https://github.com/aipotheosis-labs/aci-python-sdk/tree/main Demonstrates how to use a custom tool, converted to an OpenAI-compatible schema, within an OpenAI chat completion API call. The tool definition is included in the `tools` parameter of the `openai.chat.completions.create` method. ```python # use the tool in a openai chat completion api response = openai.chat.completions.create( model="gpt-4o", messages=[ { "role": "system", "content": "You are a helpful assistant with access to a variety of tools.", }, ], tools=[custom_function_openai_chat_completions] ) ``` -------------------------------- ### Install CAMEL AI and dependencies Source: https://context7_llms Installs the 'camel-ai[all]' package with version 0.2.62, along with 'python-dotenv', 'rich', and 'uv'. This command uses 'uv' for efficient package management. ```bash pip install "camel-ai[all]==0.2.62" python-dotenv rich uv ``` -------------------------------- ### POST /v1/app-configurations Source: https://context7_llms Create an app configuration for a project. ```APIDOC ## POST /v1/app-configurations ### Description Create an app configuration for a project. ### Method POST ### Endpoint /v1/app-configurations ``` -------------------------------- ### Initialize ACI Client in Python Source: https://github.com/aipotheosis-labs/aci-python-sdk Demonstrates how to initialize the ACI client using an API key, which can be read from environment variables. This is the primary way to interact with the ACI platform. ```python from aci import ACI client = ACI( # it reads from environment variable by default so you can omit it if you set it in your environment api_key=os.environ.get("ACI_API_KEY") ) ``` -------------------------------- ### Dynamic Tool Discovery Example (Python) Source: https://github.com/aipotheosis-labs/aci-agents Illustrates dynamic tool discovery patterns within a Python environment. It focuses on how to retrieve relevant functions and add them to the LLM's tool list for invocation. ```python agent_with_dynamic_tool_discovery_pattern_1.py ``` ```python agent_with_dynamic_tool_discovery_pattern_2.py ``` -------------------------------- ### Install ACI Python SDK and Dependencies Source: https://context7_llms Installs the ACI Python SDK and other necessary packages like 'openai' and 'python-dotenv' using the 'uv' package manager. These are required for interacting with ACI services and OpenAI. ```bash uv add aci-sdk uv add openai python-dotenv ``` -------------------------------- ### App Configurations API Source: https://github.com/aipotheosis-labs/aci-python-sdk/tree/main Endpoints for managing application configurations, including creation, listing, retrieval, and deletion. ```APIDOC ## POST /api/app_configurations ### Description Creates a new configuration for a given application. ### Method POST ### Endpoint /api/app_configurations ### Parameters #### Request Body - **app_name** (string) - Required - The name of the app to configure. - **security_scheme** (SecurityScheme) - Required - The security scheme for the app configuration. ### Request Example { "example": "client.app_configurations.create(app_name='GMAIL', security_scheme=SecurityScheme.OAUTH2)" } ### Response #### Success Response (200) - **configuration** (AppConfiguration) - The created app configuration. #### Response Example { "example": "{ \"app_name\": \"GMAIL\", \"security_scheme\": \"OAUTH2\" }" } ## GET /api/app_configurations ### Description Lists existing app configurations, with optional filtering by app names. ### Method GET ### Endpoint /api/app_configurations ### Parameters #### Query Parameters - **app_names** (list[string]) - Optional - Filter configurations by a list of app names. - **limit** (integer) - Optional - Maximum number of results to return. - **offset** (integer) - Optional - Pagination offset. ### Request Example { "example": "client.app_configurations.list(app_names=['GMAIL', 'BRAVE_SEARCH'], limit=10, offset=0)" } ### Response #### Success Response (200) - **configurations** (list[AppConfiguration]) - A list of app configurations. #### Response Example { "example": "[ { \"app_name\": \"GMAIL\", \"security_scheme\": \"OAUTH2\" } ]" } ## GET /api/app_configurations/{app_name} ### Description Retrieves the configuration for a specific application by its name. ### Method GET ### Endpoint /api/app_configurations/{app_name} ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the app whose configuration to retrieve. ### Request Example { "example": "client.app_configurations.get(app_name='GMAIL')" } ### Response #### Success Response (200) - **configuration** (AppConfiguration) - The app configuration details. #### Response Example { "example": "{ \"app_name\": \"GMAIL\", \"security_scheme\": \"OAUTH2\" }" } ## DELETE /api/app_configurations/{app_name} ### Description Deletes the configuration for a specific application. ### Method DELETE ### Endpoint /api/app_configurations/{app_name} ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the app whose configuration to delete. ### Request Example { "example": "client.app_configurations.delete(app_name='GMAIL')" } ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the configuration was deleted. #### Response Example { "example": "{\"message\": \"App configuration for GMAIL deleted successfully.\"}" } ``` -------------------------------- ### Running Unified MCP Server Locally Source: https://context7_llms Demonstrates how to run the Unified MCP Server locally using the 'uvx' command. Includes options for standard input/output mode and server-sent events (SSE) mode, specifying the linked account owner ID and API key via environment variables. ```bash # Set API key export ACI_API_KEY= # Option 1: Run in stdio mode (default) uvx aci-mcp@latest unified-server --linked-account-owner-id --allowed-apps-only # Option 2: Run in sse mode uvx aci-mcp@latest unified-server --linked-account-owner-id --allowed-apps-only --transport sse --port 8000 ``` -------------------------------- ### Initialize Global Environment and Fast Connect WebSocket Source: https://discord.gg/nnqFSzq2ne Sets up global environment variables like API endpoints and connection details. It then attempts to establish a fast WebSocket connection to the Discord gateway, prioritizing efficient communication with support for different compression methods. ```javascript window.GLOBAL_ENV = {"NODE_ENV":"production","BUILT_AT":"1758567717337","HTML_TIMESTAMP":Date.now(),"BUILD_NUMBER":"447677","PROJECT_ENV":"production","RELEASE_CHANNEL":"stable","VERSION_HASH":"5aa85863940928c4ea7642aa7a04a37adc2e5008","PRIMARY_DOMAIN":"discord.com","SENTRY_TAGS":{"buildId":"5aa85863940928c4ea7642aa7a04a37adc2e5008","buildType":"normal"},"SENTRY_RELEASE":"2025-09-22-5aa85863940928c4ea7642aa7a04a37adc2e5008-discord_web","PUBLIC_PATH":"/assets/","LOCATION":"history","API_VERSION":9,"API_PROTOCOL":"https:","API_ENDPOINT":"//discord.com/api","GATEWAY_ENDPOINT":"wss://gateway.discord.gg","STATIC_ENDPOINT":"","ASSET_ENDPOINT":"//discord.com","MEDIA_PROXY_ENDPOINT":"//media.discordapp.net","IMAGE_PROXY_ENDPOINTS":"//images-ext-1.discordapp.net,//images-ext-2.discordapp.net","CDN_HOST":"cdn.discordapp.com","DEVELOPERS_ENDPOINT":"//discord.com","MARKETING_ENDPOINT":"//discord.com","WEBAPP_ENDPOINT":"//discord.com","WIDGET_ENDPOINT":"//discord.com/widget","SEO_ENDPOINT":"undefined","NETWORKING_ENDPOINT":"//router.discordapp.net","REMOTE_AUTH_ENDPOINT":"//remote-auth-gateway.discord.gg","RTC_LATENCY_ENDPOINT":"//latency.discord.media/rtc","INVITE_HOST":"discord.gg","GUILD_TEMPLATE_HOST":"discord.new","GIFT_CODE_HOST":"discord.gift","ACTIVITY_APPLICATION_HOST":"discordsays.com","MIGRATION_SOURCE_ORIGIN":"https://discordapp.com","MIGRATION_DESTINATION_ORIGIN":"https://discord.com","STRIPE_KEY":"pk_live_CUQtlpQUF0vufWpnpUmQvcdi","ADYEN_KEY":"live_E3OQ33V6GVGTXOVQZEAFQJ6DJIDVG6SY","BRAINTREE_KEY":"production_ktzp8hfp_49pp2rp4phym7387","SPRIG_API_KEY":"ZaQ2JuStvc","MUX_ENV_KEY":"undefined","DEV_SESSION_KEY":"undefined"} !function(){if(null!=window.WebSocket&&function(n){try{var o=localStorage.getItem(n);if(null==o)return null;return JSON.parse(o)}catch(e){return null}}("token")&&!window.__OVERLAY__){var n=null!=window.DiscordNative||null!=window.require?"etf":"json",o=window.GLOBAL_ENV.GATEWAY_ENDPOINT+"/?encoding="+n+"&v="+window.GLOBAL_ENV.API_VERSION;null!=window.DiscordNative&&void 0!==window.Uint8Array&&void 0!==window.TextDecoder?o+="&compress=zstd-stream":void 0!==window.Uint8Array&&(o+="&compress=zlib-stream"),console.log("[FAST CONNECT] "+o+", encoding: "+n+", version: "+window.GLOBAL_ENV.API_VERSION);var e=new WebSocket(o);e.binaryType="arraybuffer";var i=Date.now(),r={open:!1,identify:!1,gateway:o,messages:[]};e.onopen=function(){console.log("[FAST CONNECT] connected in "+(Date.now()-i)+"ms"),r.open=!0},e.onclose=e.onerror=function(){window._ws=null},e.onmessage=function(n){r.messages.push(n)},window._ws={ws:e,state:r}}}(); ``` -------------------------------- ### GET /v1/functions/search Source: https://www.aci.dev/docs/advanced/oauth2-whitelabel Returns the basic information of a list of functions. ```APIDOC ## GET /v1/functions/search ### Description Returns the basic information of a list of functions. ### Method GET ### Endpoint /v1/functions/search ### Parameters #### Query Parameters - **query** (string) - Required - The natural language query to search for functions. ### Response #### Success Response (200) - **functions** (array) - A list of matching function objects. - **name** (string) - The name of the function. - **description** (string) - A description of the function. #### Response Example ```json { "functions": [ { "name": "example_function", "description": "An example function." } ] } ``` ``` -------------------------------- ### GET /v1/functions/search Source: https://context7_llms Returns the basic information of a list of functions. ```APIDOC ## GET /v1/functions/search ### Description Returns the basic information of a list of functions. ### Method GET ### Endpoint /v1/functions/search ### Parameters #### Query Parameters - **app_name** (string) - Optional - Filter functions by app name. - **query** (string) - Optional - Natural language query to search for functions. ``` -------------------------------- ### ACI.dev MCP Apps Server Help Information Source: https://context7_llms This output shows the help information for the `aci-mcp apps-server` command. It details the required and optional command-line arguments, including `--apps`, `--linked-account-owner-id`, `--transport`, and `--port`, along with their descriptions and default values. ```bash $ uvx aci-mcp@latest apps-server --help Usage: aci-mcp apps-server [OPTIONS] Start the apps-specific MCP server to access tools under specific apps. Options: --apps TEXT comma separated list of apps of which to use the functions [required] --linked-account-owner-id TEXT the owner id of the linked accounts to use for the tool calls. You'll need to create the linked accounts on platform.aci.dev [required] --transport [stdio|sse] Transport type --port INTEGER Port to listen on for SSE --help Show this message and exit. ``` -------------------------------- ### GET /v1/app-configurations Source: https://context7_llms List all app configurations for a project, with optional filters. ```APIDOC ## GET /v1/app-configurations ### Description List all app configurations for a project, with optionally filters. ### Method GET ### Endpoint /v1/app-configurations ### Parameters #### Query Parameters - **app_name** (string) - Optional - Filter by app name. - **linked_account_owner_id** (string) - Optional - Filter by linked account owner ID. ``` -------------------------------- ### Agent with Pre-planned Tools (Static Tools) Example Source: https://github.com/aipotheosis-labs/aci-agents/tree/main This Python script demonstrates the first pattern of building an AI agent with ACI.dev, utilizing a predefined set of tools. It's ideal for applications where the required tools are known in advance. ```python from aci.agents import Agent from aci.tools import Tool # Define your tools search_tool = Tool( name="search", description="A tool to search for information.", func=lambda query: f"Results for {query}: ..." ) calculator_tool = Tool( name="calculator", description="A calculator to perform math operations.", func=lambda expression: eval(expression) ) # Initialize the agent with pre-planned tools agent = Agent( llm="openai", # Or any other LLM supported by ACI.dev tools=[search_tool, calculator_tool] ) # Define the task for the agent agent.run("What is the capital of France?") agent.run("Calculate 2 + 2") ``` -------------------------------- ### Get Linked Account Source: https://www.aci.dev/docs/introduction/overview Retrieves a specific linked account by its unique identifier. ```APIDOC ## GET /v1/linked-accounts/{linked_account_id} ### Description Get a linked account by its id. `linked_account_id` uniquely identifies a linked account across the platform. ### Method GET ### Endpoint /v1/linked-accounts/{linked_account_id} ### Parameters #### Path Parameters - **linked_account_id** (string) - Required - The unique identifier of the linked account. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the linked account. - **type** (string) - The type of the linked account (e.g., 'google', 'github'). - **user_id** (string) - The identifier of the user this account is linked to. - **created_at** (string) - The timestamp when the account was linked. - **updated_at** (string) - The timestamp when the account was last updated. #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "type": "google", "user_id": "user-123", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Basic Introduction Text (JSX) Source: https://docs.camel-ai.org/ This snippet defines a basic introduction to CAMEL-AI using JSX, rendering a paragraph that describes the project's purpose: fostering an open-source community for finding scaling laws of agents for data generation, world simulation, and task automation. ```jsx function _createMdxContent(props) { const _components = { p: "p", ..._provideComponents(), ...props.components }; return _jsx(_components.p, { children: "CAMEL-AI is an open-source community for finding the scaling laws of agents for data generation, world simulation, and task automation." }); } ``` -------------------------------- ### GET /v1/apps/{app_name} Source: https://www.aci.dev/docs/advanced/oauth2-whitelabel Returns an application, including its name, description, and associated functions. ```APIDOC ## GET /v1/apps/{app_name} ### Description Returns an application, including its name, description, and associated functions. ### Method GET ### Endpoint /v1/apps/{app_name} ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the application to retrieve. ### Response #### Success Response (200) - **name** (string) - The name of the app. - **description** (string) - A description of the app. - **functions** (array) - A list of functions available in the app. - **name** (string) - The name of the function. - **description** (string) - A description of the function. #### Response Example ```json { "name": "example-app", "description": "An example application.", "functions": [ { "name": "example_function", "description": "An example function." } ] } ``` ``` -------------------------------- ### GET /v1/linked-accounts Source: https://context7_llms List all linked accounts. Optionally filter by app_name and linked_account_owner_id. ```APIDOC ## GET /v1/linked-accounts ### Description List all linked accounts. Optionally filter by app_name and linked_account_owner_id. `app_name` + `linked_account_owner_id` can uniquely identify a linked account. This can be an alternatively way to GET /linked-accounts/{linked_account_id} for getting a specific linked account. ### Method GET ### Endpoint /v1/linked-accounts ### Parameters #### Query Parameters - **app_name** (string) - Optional - Filter linked accounts by app name. - **linked_account_owner_id** (string) - Optional - Filter linked accounts by linked account owner ID. ``` -------------------------------- ### Execution Flow Patterns Source: https://github.com/aipotheosis-labs/aci-agents/tree/main Illustrates different execution flow patterns for LLM function integration, comparing direct tool calls with indirect calls via text context. This table summarizes the steps involved in each approach. ```markdown | Pattern | Approach | |---|---| | **1** | Pre-planned tools | | **2.1** | Tool List Expansion | | **2.2** | Text Context Execution | | Flow | |---|---| | Define Tools in tools list → Direct Tool Call | | Search → Get Tool Definition → Add to Tools → Direct Tool Call | | Search → Get Tool Definition → Add to Text Context → Call via Meta Function | ``` -------------------------------- ### GET /v1/functions/{function_name}/definition Source: https://context7_llms Return the function definition that can be used directly by LLM. ```APIDOC ## GET /v1/functions/{function_name}/definition ### Description Return the function definition that can be used directly by LLM. The actual content depends on the intended model (inference provider, e.g., OpenAI, Anthropic, etc.) and the function itself. ### Method GET ### Endpoint /v1/functions/{function_name}/definition ### Parameters #### Path Parameters - **function_name** (string) - Required - The name of the function to get the definition for. ``` -------------------------------- ### Dynamic Tool Discovery - Pattern 1 (Python) Source: https://github.com/aipotheosis-labs/aci-agents/tree/main Illustrates the 'Tool List Expansion' approach for dynamic tool discovery, where tools are discovered via ACI_SEARCH_FUNCTIONS and added directly to the LLM's tool list. Suitable for many tools or when tools are not known ahead of time. Part of OpenAI examples. ```python from aci.agent import Agent from aci.tools import Tool, ACI_SEARCH_FUNCTIONS # Initialize agent with the search function tool agent = Agent( tools=[ACI_SEARCH_FUNCTIONS], llm="openai" ) # Assume tools_retrieved is managed internally or passed # For demonstration, let's simulate adding a tool found by ACI_SEARCH_FUNCTIONS # In a real scenario, ACI_SEARCH_FUNCTIONS would return actual tool definitions # Simulate discovery of a new tool new_tool_definition = { "name": "brave_search_web_search", "description": "Searches the web using Brave Search.", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "The search query." } }, "required": ["query"] } } # In a real implementation, agent.tools would be updated dynamically # For this example, we'll simulate passing it in the run method or agent initialization # agent.add_tool(Tool.from_definition(new_tool_definition)) # Example of running with potentially discovered tools (conceptually) # The agent internally manages and updates its tool list based on ACI_SEARCH_FUNCTIONS response = agent.run("Find information about the latest AI advancements and use any discovered tools.") print(response) ``` -------------------------------- ### GET /v1/apps/{app_name} Source: https://context7_llms Returns an application's details (name, description, and functions). ```APIDOC ## GET /v1/apps/{app_name} ### Description Returns an application (name, description, and functions). ### Method GET ### Endpoint /v1/apps/{app_name} ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the app to retrieve. ``` -------------------------------- ### App Configurations API Source: https://github.com/aipotheosis-labs/aci-python-sdk Manage configurations for applications, including creating, listing, retrieving, and deleting configurations. ```APIDOC ## POST /app-configurations ### Description Creates a new configuration for an application. ### Method POST ### Endpoint /app-configurations #### Request Body - **app_name** (string) - Required - The name of the app to configure. - **security_scheme** (SecurityScheme) - Required - The security scheme to use for the app. ### Request Example ```json { "app_name": "GMAIL", "security_scheme": "OAUTH2" } ``` ### Response #### Success Response (200) - **configuration** (AppConfiguration) - The newly created app configuration. #### Response Example ```json { "configuration": { "app_name": "GMAIL", "security_scheme": "OAUTH2", "created_at": "2023-10-27T10:00:00Z" } } ``` ``` ```APIDOC ## GET /app-configurations ### Description Lists existing app configurations, with optional filtering by app names. ### Method GET ### Endpoint /app-configurations #### Query Parameters - **app_names** (list[string]) - Optional - Filter results by a list of app names. - **limit** (integer) - Optional - Maximum number of results to return. - **offset** (integer) - Optional - Pagination offset. ### Response #### Success Response (200) - **configurations** (list[AppConfiguration]) - A list of app configurations. #### Response Example ```json { "configurations": [ { "app_name": "GMAIL", "security_scheme": "OAUTH2", "created_at": "2023-10-27T10:00:00Z" }, { "app_name": "BRAVE_SEARCH", "security_scheme": "API_KEY", "created_at": "2023-10-27T10:05:00Z" } ] } ``` ``` ```APIDOC ## GET /app-configurations/{app_name} ### Description Retrieves the configuration for a specific app by its name. ### Method GET ### Endpoint /app-configurations/{app_name} #### Path Parameters - **app_name** (string) - Required - The name of the app whose configuration is to be retrieved. ### Response #### Success Response (200) - **configuration** (AppConfiguration) - The app configuration details. #### Response Example ```json { "configuration": { "app_name": "GMAIL", "security_scheme": "OAUTH2", "created_at": "2023-10-27T10:00:00Z" } } ``` ``` ```APIDOC ## DELETE /app-configurations/{app_name} ### Description Deletes the configuration for a specific app by its name. ### Method DELETE ### Endpoint /app-configurations/{app_name} #### Path Parameters - **app_name** (string) - Required - The name of the app whose configuration is to be deleted. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the configuration was deleted. #### Response Example ```json { "message": "App configuration for GMAIL deleted successfully." } ``` ```