### Quickstart (SDK, Agent-first) Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/resources/reference/python-sdk Install the SDK and get started with agent creation and execution. ```APIDOC ## Quickstart (SDK, Agent-first) ### Description Install the `glaip-sdk` package and begin using the agent functionality. ### Installation ```bash pip install glaip-sdk # or for local development: pip install glaip-sdk[local] ``` ### Usage ```python from glaip_sdk import Agent # Create an agent instance agent = Agent(...) # Run the agent locally agent.run(...) # Optionally, deploy the agent for remote execution agent.deploy() ``` ``` -------------------------------- ### Quickstart Guide Source: https://gdplabs.gitbook.io/sdk/llms-full.txt/1 A step-by-step guide to get started with the GL Connectors SDK, including installation and setting up your first integration. ```APIDOC # Quickstart This page assumes you have fulfilled the Prerequisites in your environment. ### Getting Started #### Installation ```shellscript uv add gl-connectors-sdk ``` #### Setting Up the Integration The API Key and User Token are accessible through our console. To use the console, please see the following page: Connectors Console, or if you want to go directly to the console, it is here in Connectors Console. In the dashboard, to activate one of the integration, we will use our Google Drive Integration to search for files. 1. Under `Google_drive` module, click `Add New Integration` button 2. Follow the generated URL and complete the authentication 3. Later, you will have an active integration for `google_drive` under your email. ``` -------------------------------- ### Install and Quick Start Commands Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/resources/reference/cli-commands Commands to install the SDK and perform initial setup and verification. Use `aip accounts add` for interactive credential setup and `aip status` to test connectivity. ```bash pipx install glaip-sdk ``` ```bash aip accounts add prod # interactive credential prompt ``` ```bash aip status # smoke test connectivity ``` ```bash aip agents list # browse resources (defaults to active account) ``` -------------------------------- ### Install and Quick Start Commands Source: https://gdplabs.gitbook.io/sdk/llms-full.txt Install the SDK using pipx and run initial commands to add an account, check status, and list agents. Assumes interactive credential prompts for account setup. ```bash pipx install glaip-sdk aip accounts add prod # interactive credential prompt aip status # smoke test connectivity aip agents list # browse resources (defaults to active account) ``` -------------------------------- ### Setup Guide Source: https://gdplabs.gitbook.io/sdk/gen-ai-sdk/resources/supported-models Indicates that a setup guide is available for configuring the environment. ```text Setup Guide ``` -------------------------------- ### Start Here: Python SDK Agent-First Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/introduction-to-gl-aip This section guides users on starting with the Python SDK using an agent-first approach. It highlights the minimal setup required for local development. ```python glaip-sdk ``` -------------------------------- ### Setup UV Authentication and Install Dependencies Source: https://gdplabs.gitbook.io/sdk/llms-full.txt/1 Executes setup scripts for UV authentication and dependency installation. Use setup.sh for Unix-based systems and setup.bat for Windows. ```bash ./setup.sh ``` ```cmd setup.bat ``` -------------------------------- ### Full Agent Configuration Example Source: https://gdplabs.gitbook.io/sdk/llms-full.txt This example demonstrates a comprehensive agent setup, including optional fields like 'version', 'description', 'metadata', 'tools', 'agents', 'mcps', 'tool_configs', and 'agent_config'. ```json { "name": "data-analyst", "type": "config", "framework": "langchain", "version": "1.0.0", "description": "Analyzes data and generates reports", "instruction": "You are a data analyst. Analyze the provided data and generate comprehensive reports with visualizations.", "metadata": { "team": "analytics", "environment": "production" }, "tools": ["tool-uuid-1", "tool-uuid-2"], "agents": ["sub-agent-uuid"], "mcps": ["mcp-config-uuid"], "tool_configs": { "tool-uuid-1": { "api_key": "analytics-api-key", "timeout": 30 } }, "language_model_id": "model-uuid", "agent_config": { "max_recursion_limit": 10, "memory": "mem0", "planning": true, "tool_output_sharing": true } } ``` -------------------------------- ### Setup Multi-Agent Example Environment Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/tutorials/multi-agent-system-patterns Navigate to the multi-agent system patterns directory, synchronize dependencies, and set up the environment variables file. ```bash cd gl-aip/examples/multi-agent-system-patterns uv sync cp .env.example .env # then edit with your credentials ``` -------------------------------- ### Setup Multi-Agent Examples Source: https://gdplabs.gitbook.io/sdk/llms-full.txt Clone the cookbook, navigate to the multi-agent patterns directory, sync dependencies, and configure environment variables. ```bash git clone https://github.com/gl-sdk/gen-ai-sdk-cookbook.git cd gl-aip/examples/multi-agent-system-patterns uv sync cp .env.example .env # then edit with your credentials ``` -------------------------------- ### Clone Example Repository Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/tutorials/multi-agent-system-patterns Clone the example repository to get started with multi-agent system patterns. This sets up the necessary project structure. ```bash git clone https://github.com/gl-sdk/gen-ai-sdk-cookbook.git cd gl-aip/examples/multi-agent-system-patterns ``` -------------------------------- ### Quickstart: Agent-first SDK Usage Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/resources/reference/python-sdk Create an Agent instance and run it locally. Optionally deploy for remote execution. ```python from glaip_sdk.agent import Agent agent = Agent() agent.run() agent.deploy() ``` -------------------------------- ### Install MCP Client and SDKs Source: https://gdplabs.gitbook.io/sdk/llms-full.txt/1 Installs necessary packages for handling MCP clients and GL AI SDK locally. This setup is required for advanced MCP tool filtration examples. ```shellscript uv init --bare uv add glaip-sdk[local] gllm-tools-binary ``` -------------------------------- ### Navigate and Sync Example Directory Source: https://gdplabs.gitbook.io/sdk/gl-aip/tutorials/multi-agent-system-patterns Navigate to the multi-agent system patterns example directory and synchronize dependencies using uv. ```bash cd gl-aip/examples/multi-agent-system-patterns uv sync ``` -------------------------------- ### Install and Set Up WebM Recording Source: https://gdplabs.gitbook.io/sdk/llms-full.txt/1 Install the necessary package for WebM recording and run the setup command to install Playwright Chromium. This is a one-time setup. ```bash pip install "gl-computer-use[recording]" gl-computer-use-setup # installs Playwright Chromium (~130 MB, one-time) ``` -------------------------------- ### Account Configuration Example Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/tutorials/cli/commands/accounts This example demonstrates how to configure account settings, such as API keys and endpoints, via the CLI. Ensure all required parameters are provided. ```bash gl-ai account config --api-key "YOUR_API_KEY" --api-endpoint "https://api.example.com" ``` -------------------------------- ### Agent Initialization and Basic Usage Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/resources/reference/python-sdk Demonstrates how to install the SDK, import the Agent class, initialize an agent with a name and instruction, and run a simple prompt. ```python pip install glaip-sdk from glaip_sdk import Agent agent = Agent( name="hello-agent", instruction="You are a helpful assistant.", ) print(agent.run("Hello")) ``` -------------------------------- ### Example: Document Loader Quickstart Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/guides/file-processing Refer to the 'main_with_docproc_pdf.py' file for a quickstart and example of using document loader tools for local file processing. ```python main_with_docproc_pdf.py ``` -------------------------------- ### Example Code Block Source: https://gdplabs.gitbook.io/sdk/gl-browser-use/prerequisites This is a generic example code block. Ensure you have the necessary environment setup before running. ```plaintext Project: /llmstxt/gdplabs_gitbook_io_sdk_llms-full_txt Content: ame\":\ ``` -------------------------------- ### Running an Agent - Example Source: https://gdplabs.gitbook.io/sdk/gl-aip/guides/agents-guide This example demonstrates how to run an agent. Ensure the agent is properly configured before execution. ```javascript )\"\n166:[\ ``` ```javascript )\"\n167:[\ ``` ```javascript )\"\n168:[\ ``` ```javascript )\"\n169:[\ ``` -------------------------------- ### Get Search Results Source: https://gdplabs.gitbook.io/sdk/gl-smart-search/guides/sdk/web-search Perform a search query using the SDK. This example shows how to get results for a given query. ```javascript const results = await search(\"your search query\"); console.log(results); ``` -------------------------------- ### Run Privacy Quickstart Script Source: https://gdplabs.gitbook.io/sdk/gen-ai-sdk/tutorials/security-and-privacy/pii-masking Execute the privacy quickstart Python script. This is a common way to initiate the PII masking process using the installed library. ```bash python privacy_quickstart.py ``` -------------------------------- ### Install SDK with All Extras Source: https://gdplabs.gitbook.io/sdk/llms-full.txt/1 Install the SDK with all available extras for the full feature set. ```bash pip install "gl-computer-use[all]" ``` -------------------------------- ### Get TTS Count API Example (Bash) Source: https://gdplabs.gitbook.io/sdk/gl-speech/rest-api-reference/text-to-speech This bash command uses curl to make a GET request to the TTS count endpoint, filtering results by date. ```bash curl -X GET 'https://tts-api.stg.prosa.ai/v2/speech/tts/count?from_date=2024-01-01' \ ``` -------------------------------- ### Install gl-computer-use[observability] Source: https://gdplabs.gitbook.io/sdk/gl-computer-use/prerequisites Use this command to install the GL Computer Use SDK with observability features. Ensure pip is up-to-date. ```bash pip install gl-computer-use[observability]" ``` -------------------------------- ### Skill Instructional Content Example Source: https://gdplabs.gitbook.io/sdk/gl-connectors/sdk/connectors-skills/creating-a-skill Provides a template for the core instructions and an example of input/output for a custom skill. This section guides the skill's behavior and demonstrates its functionality. ```markdown # My Skill [Your instructions here — what to do, how to format it, what rules to follow] ## Example Input: [example input] Output: [example output] ``` -------------------------------- ### Run Desktop Automation Example Source: https://gdplabs.gitbook.io/sdk/gl-computer-use/getting-started This snippet demonstrates how to initiate desktop automation using the SDK. Ensure necessary configurations are in place before execution. ```javascript console.log("Run Desktop Automation") ``` -------------------------------- ### Audio Input and Output Configuration Example Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/guides/audio-interface A comprehensive example demonstrating the configuration of both audio input and output, including enabling, setting sample rates, and adding event listeners. ```javascript const agent = new Agent(); // Configure input agent.audio.input.enable(); agent.audio.input.setSampleRate(16000); agent.audio.input.addEventListener('data', (data) => { console.log('Received audio data:', data); }); agent.audio.input.addEventListener('error', (error) => { console.error('Input error:', error); }); // Configure output agent.audio.output.enable(); agent.audio.output.setSampleRate(16000); agent.audio.output.addEventListener('playback-end', () => { console.log('Playback finished.'); }); agent.audio.output.addEventListener('error', (error) => { console.error('Output error:', error); }); console.log('Audio input enabled:', agent.audio.input.isEnabled()); console.log('Audio output enabled:', agent.audio.output.isEnabled()); ``` -------------------------------- ### Start Google Realtime Session Source: https://gdplabs.gitbook.io/sdk/gen-ai-sdk/tutorials/inference/realtime-session Initializes and starts a realtime inference session with a specified Gemini model. Ensure you have the dotenv library installed and your environment variables configured. ```python from dotenv import load_dotenv load_dotenv() import asyncio from gllm_inference.realtime_session import GoogleRealtimeSession realtime_session = GoogleRealtimeSession(model_name="gemini-2.5-flash-native-audio-preview-12-2025") asyncio.run(realtime_session.start()) ``` -------------------------------- ### Speech to Text API Request Example Source: https://gdplabs.gitbook.io/sdk/gl-speech/rest-api-reference/speech-to-text Example of how to make a GET request to the Speech to Text API using curl. Ensure you replace 'your-api-key' with your actual API key. ```bash curl -X GET 'https://asr-api.stg.prosa.ai/v2/speech/stt/2fec34e1-efb1-46f7-a743-1cb35b64550d' \ -H 'x-api-key: your-api-key' ``` -------------------------------- ### Global Configuration Example Source: https://gdplabs.gitbook.io/sdk/llms-full.txt An example demonstrating the structure of global configurations, including tool settings. ```json { "tool_configs": { "tool-uuid-1": { "mode": "dry_run" } } } ``` -------------------------------- ### Install GDP Labs SDK Source: https://gdplabs.gitbook.io/sdk/gen-ai-sdk/tutorials/inference/realtime-session Install the GDP Labs SDK using pip with the provided extra index URL. This command ensures you get the correct version for your project. ```bash IN ( 'gcloud auth print-access-token' ) DO pip install --extra-index-url "https://oauth2accesstoken:%T@glsdk.gdplabs.id/gen-ai-internal/simple/" ``` -------------------------------- ### Full Connector SDK Example Source: https://gdplabs.gitbook.io/sdk/gl-smart-search/guides/sdk/connector-search Demonstrates a complete workflow including authentication, searching, and connecting to a connector using the SDK. Ensure environment variables for SMARTSEARCH_BASE_URL and SMARTSEARCH_TOKEN are set. ```python import asyncio import json import os from dotenv import load_dotenv from smart_search_sdk.connector.client import ConnectorClient from smart_search_sdk.connector.models import ( ConnectorRequest, ConnectorConnectRequest, AppName, ) load_dotenv() async def main(): client = ConnectorClient(base_url=os.getenv("SMARTSEARCH_BASE_URL")) await client.authenticate(token=os.getenv("SMARTSEARCH_TOKEN")) gl_token = os.getenv("GL_CONNECTORS_USER_TOKEN", "") # Search request = ConnectorRequest(query="List all my upcoming meetings today") result = await client.search_connector( app_name=AppName.GOOGLE_CALENDAR, gl_token=gl_token, request=request, ) print("=== Connector Search ===") print(json.dumps(result, indent=4)) # Connect connect_request = ConnectorConnectRequest( ``` -------------------------------- ### Include Example Code Configuration Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/guides/programmatic-tool-calling Use the 'include_example' parameter to determine whether example code should be included in the prompt. This is a boolean setting. ```text include_example: Whether to include example code in the prompt ``` -------------------------------- ### Complete HITL Example with Smart Approver Source: https://gdplabs.gitbook.io/sdk/llms-full.txt A comprehensive example demonstrating the integration of a smart approver function with the RemoteHITLHandler. This setup includes necessary imports and defines the approval logic. ```python import os from glaip_sdk import Client from glaip_sdk.hitl.remote import RemoteHITLHandler from glaip_sdk.hitl.base import HITLRequest, HITLResponse, HITLDecision # Approval callback def smart_approver(request: HITLRequest) -> HITLResponse: # Safe tools if request.tool_name in ["read_file", "search"]: return HITLResponse(decision=HITLDecision.APPROVED) # Dangerous tools if "delete" in request.tool_name.lower(): return HITLResponse( decision=HITLDecision.REJECTED, operator_input="Dangerous operation blocked" ) # Default return HITLResponse(decision=HITLDecision.APPROVED) ``` -------------------------------- ### Run the Interactive Setup for Connector MCP Cookbook Source: https://gdplabs.gitbook.io/sdk/gl-connectors/sdk/agentic-tools-and-model-context-protocol-mcp/connector-mcp-cookbook Execute the interactive Python script to set up the Connector MCP Cookbook. This will guide you through the setup process, including authentication and authorization. ```bash uv run example_interactive.py ``` -------------------------------- ### Agent Initialization Example Source: https://gdplabs.gitbook.io/sdk/gl-ai-agent-package/guides/topics Demonstrates how to initialize an Agent using the SDK. This is the default path for development. ```javascript Agent(...) ``` -------------------------------- ### Install gl-computer-use[all] Source: https://gdplabs.gitbook.io/sdk/gl-computer-use/prerequisites Use this command to install the GL Computer Use SDK with all available features. Ensure pip is up-to-date. ```bash pip install gl-computer-use[all]" ``` -------------------------------- ### Install SDK with Pip Source: https://gdplabs.gitbook.io/sdk/tutorials/inference/realtime-session Use pip to install the SDK, specifying an extra index URL for private packages. Ensure your environment is set up correctly, for example, using a Conda environment. ```bash pip install --extra-index-url https://oauth2accesstoken$$gcloud$$ ``` -------------------------------- ### Install GL Computer Use SDK Source: https://gdplabs.gitbook.io/sdk/gl-computer-use/prerequisites Install the core GL Computer Use package and optional extras for specific functionalities. ```bash pip install gl-computer-use ``` ```bash pip install "gl-computer-use[recording]" pip install "gl-computer-use[agents]" pip install "gl-computer-use[opensandbox]" pip install "gl-computer-use[minio]" pip install "gl-computer-use[observability]" pip install "gl-computer-use[all]" ``` -------------------------------- ### Configure PGVector Client Source: https://gdplabs.gitbook.io/sdk/gen-ai-sdk/resources/supported-vector-data-store Example of configuring the PGVector client. This setup uses a persistent client. ```javascript import pg from "pg"; const pool = new pg.Pool({ user: "your_user", host: "your_host", database: "your_database", password: "your_password", port: 5432, }); async function embedding() { const result = await pool.query( "SELECT * FROM documents ORDER BY embedding <-> $1 LIMIT $2", [ "[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]::vector", 10, ] ); console.log(result.rows); } embedding(); ``` -------------------------------- ### Run Setup Script Source: https://gdplabs.gitbook.io/sdk/llms-full.txt/1 Executes the setup script to prepare the project environment. Use './setup.sh' for Unix-based systems (Linux, macOS) and 'setup.bat' for Windows. ```bash ./setup.sh ``` -------------------------------- ### Configure Qdrant Client Source: https://gdplabs.gitbook.io/sdk/gen-ai-sdk/resources/supported-vector-data-store Example of configuring the Qdrant client. This setup uses a persistent client. ```javascript import { QdrantClient } from "@qdrant/js-client-rest"; const client = new QdrantClient({ url: "YOUR_QDRANT_URL", apiKey: "YOUR_QDRANT_API_KEY", }); async function embedding() { const result = await client.search("my_collection", { vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0], limit: 10, }); console.log(result); } embedding(); ``` -------------------------------- ### Quickstart: OpenAI Text Embedding Response Source: https://gdplabs.gitbook.io/sdk/gen-ai-sdk/tutorials/inference/em-invoker Example output of the vectorized text from the OpenAIEM.TEXT_EMBEDDING_3_SMALL model. ```text Vectorized text: [-0.010044993832707405, ..., 0.0008305096416734159] ``` -------------------------------- ### Make a GET request to the Speech to Text API Source: https://gdplabs.gitbook.io/sdk/gl-speech/rest-api-reference/speech-to-text This example demonstrates how to make a GET request to the Speech to Text API endpoint using curl. Ensure you have the correct URL and any required headers. ```bash curl 'https://asr-api.stg.prosa.ai/v2/speech/stt/models' ``` -------------------------------- ### Bash Command to Run Example Source: https://gdplabs.gitbook.io/sdk/llms-full.txt Executes the router example script using uv unicorn. Ensure environment variables are set. ```bash uv run router/main.py ```