### Cloning Repository for PostgreSQL E-commerce Sample - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-ecommerce-sample/README.md Clones the repository containing the setup scripts and navigates into the specific directory for the PostgreSQL e-commerce sample. This is the first step to access the necessary setup files. ```bash git clone https://github.com/centralmind/gateway cd gateway/example/postgresql-ecommerce-sample ``` -------------------------------- ### Install Gateway Binary (macOS Intel Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/quickstart/README.md This snippet provides the commands to download, extract, and make the Centralmind Gateway binary executable on an Intel-based macOS system using bash. It fetches the latest release tarball, extracts it, renames the executable, and applies execute permissions. ```bash # Download the latest binary for macOS (Intel) curl -LO https://github.com/centralmind/gateway/releases/latest/download/gateway-darwin-amd64.tar.gz # Extract the archive tar -xzf gateway-darwin-amd64.tar.gz mv gateway-darwin-amd64 gateway # Make the binary executable chmod +x gateway ``` -------------------------------- ### Start Gateway REST Server (Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/quickstart/README.md This snippet starts the Centralmind Gateway REST server. It runs the `./gateway start rest` command, which uses the `gateway.yaml` file (generated during the discovery step) to configure and launch the server, making the generated APIs available. ```bash ./gateway --config gateway.yaml start rest ``` -------------------------------- ### Install Gateway Binary on Linux - Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/installation/README.md This snippet provides commands to download the Linux AMD64 binary release, extract it, and make the executable file runnable. It requires wget and tar to be installed on the system. ```bash # Download the latest binary for Linux wget https://github.com/centralmind/gateway/releases/download/v0.0.11/gateway-linux-amd64.tar.gz # Extract the archive tar -xzf gateway-linux-amd64.tar.gz mv gateway-linux-amd64 gateway # Make the binary executable chmod +x gateway ``` -------------------------------- ### Install Gateway Binary (Linux Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/quickstart/README.md This snippet provides the commands to download, extract, and make the Centralmind Gateway binary executable on a Linux system using bash. It fetches the latest release tarball, extracts it, renames the executable, and applies execute permissions. ```bash # Download the latest binary for Linux wget https://github.com/centralmind/gateway/releases/latest/download/gateway-linux-amd64.tar.gz # Extract the archive tar -xzf gateway-linux-amd64.tar.gz mv gateway-linux-amd64 gateway # Make the binary executable chmod +x gateway ``` -------------------------------- ### Build Gateway from Source - Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/installation/README.md These commands clone the Gateway source code, download Go module dependencies, build the executable binary using the Go toolchain, make the binary executable, and run it with the --help flag to verify the build. Requires Git and Go installed. ```bash # Clone the repository git clone https://github.com/centralmind/gateway.git cd gateway # Install dependencies and build go mod download go build -o gateway # Make the binary executable chmod +x gateway # Run the application ./gateway --help ``` -------------------------------- ### Install Gateway Binary (macOS Apple Silicon Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/quickstart/README.md This snippet provides the commands to download, extract, and make the Centralmind Gateway binary executable on an Apple Silicon-based macOS system using bash. It fetches the latest release tarball, extracts it, renames the executable, and applies execute permissions. ```bash # Download the latest binary for macOS (Apple Silicon) curl -LO https://github.com/centralmind/gateway/releases/latest/download/gateway-darwin-arm64.tar.gz # Extract the archive tar -xzf gateway-darwin-arm64.tar.gz mv gateway-darwin-arm64 gateway # Make the binary executable chmod +x gateway ``` -------------------------------- ### Running PostgreSQL E-commerce Setup Script - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-ecommerce-sample/README.md Executes the main `setup.sh` script. This script is responsible for extracting the data, pulling/starting the Docker container, creating the database schema, and importing the data. ```bash ./setup.sh ``` -------------------------------- ### Install Gateway Binary (Windows PowerShell) Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/quickstart/README.md This snippet provides the commands to download, extract, and rename the Centralmind Gateway binary on a Windows system using PowerShell. It downloads the latest release zip file, extracts its contents, and renames the executable for convenience. ```powershell # Download the latest binary for Windows Invoke-WebRequest -Uri https://github.com/centralmind/gateway/releases/latest/download/gateway-windows-amd64.zip -OutFile gateway-windows.zip # Extract the archive Expand-Archive -Path gateway-windows.zip -DestinationPath . # Rename Rename-Item -Path "gateway-windows-amd64.exe" -NewName "gateway.exe" ``` -------------------------------- ### Run Database Discovery & AI API Generation (Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/quickstart/README.md This snippet executes the core Gateway functionality: discovering the database schema and generating API definitions using an AI provider. It runs the `./gateway discover` command, specifying the AI provider (gemini), the database configuration file (`connection.yaml`), and a detailed natural language prompt to guide the API generation. ```bash ./gateway discover \ --ai-provider gemini \ --config connection.yaml \ --prompt "Develop an API that enables a chatbot to retrieve information about data. \ Try to place yourself as analyst and think what kind of data you will require, \ based on that come up with useful API methods for that" ``` -------------------------------- ### Making PostgreSQL E-commerce Setup Script Executable - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-ecommerce-sample/README.md Grants execute permissions to the `setup.sh` script using the chmod utility. This is a prerequisite for running the script to automate the database setup process. ```bash chmod +x setup.sh ``` -------------------------------- ### Starting Database Containers with Docker Compose (Bash) Source: https://github.com/centralmind/gateway/blob/main/example/README.md This command uses Docker Compose to start all services (database containers) defined in the `docker-compose.yml` file. The `-d` flag runs the containers in detached mode, leaving them running in the background. ```bash docker-compose up -d ``` -------------------------------- ### Build and Run Gateway Docker Image from Source - Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/installation/README.md This snippet clones the Gateway source repository, navigates into the directory, builds a Docker image tagged 'gateway' from the Dockerfile, and runs a container from this image, mapping port 8080. Requires Git and Docker. ```bash # Clone the repository git clone https://github.com/centralmind/gateway.git cd gateway # Build the Docker image docker build -t gateway . # Run your container docker run -p 8080:8080 gateway ``` -------------------------------- ### Install Gateway Binary on Windows - Powershell Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/installation/README.md This PowerShell snippet downloads the Windows AMD64 binary release as a zip file, extracts its contents, and renames the executable for easier use. It requires PowerShell with Invoke-WebRequest and Expand-Archive cmdlets. ```powershell # Download the latest binary for Windows Invoke-WebRequest -Uri https://github.com/centralmind/gateway/releases/download/v0.0.11/gateway-windows-amd64.zip -OutFile gateway-windows.zip # Extract the archive Expand-Archive -Path gateway-windows.zip -DestinationPath . # Rename Rename-Item -Path "gateway-windows-amd64.exe" -NewName "gateway.exe" ``` -------------------------------- ### Using gateway plugins CLI Examples (Bash) Source: https://github.com/centralmind/gateway/blob/main/cli/README.md Examples demonstrating how to use the `gateway plugins` command. These examples show how to list all available gateway plugins and display detailed configuration documentation for specific plugins like 'auth' or 'cache'. ```bash gateway plugins # List all available plugins gateway plugins auth # Show documentation for the auth plugin gateway plugins cache # Show documentation for the cache plugin ``` -------------------------------- ### Using gateway connectors CLI Examples (Bash) Source: https://github.com/centralmind/gateway/blob/main/cli/README.md Examples demonstrating how to use the `gateway connectors` command. These examples show how to list all available database connectors and how to display detailed configuration documentation for specific connectors like PostgreSQL or MySQL. ```bash gateway connectors gateway connectors postgres gateway connectors mysql ``` -------------------------------- ### Downloading PostgreSQL E-commerce Sample Data - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-ecommerce-sample/README.md Downloads the zipped sample database data file from a specified raw GitHub URL using the curl command. This file contains the CSV data that will be imported into the database. ```bash curl -O https://raw.githubusercontent.com/centralmind/sample_databases/refs/heads/main/ecommerce/sample_data.zip ``` -------------------------------- ### Starting PostgreSQL Container - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This command starts a detached PostgreSQL container named 'some-postgres', setting environment variables for user, password, and database name, and mapping port 5432. This creates the running PostgreSQL instance ready for data. ```bash docker run -d \ --name some-postgres \ -e POSTGRES_PASSWORD=mysecretpassword \ -e POSTGRES_USER=postgres \ -e POSTGRES_DB=dvdrental \ -p 5432:5432 \ postgres ``` -------------------------------- ### Start Gateway Server (Shell) Source: https://github.com/centralmind/gateway/blob/main/connectors/duckdb/readme.md Shell command example to start the gateway server process, which will load its configuration from the 'gateway.yaml' file typically generated by a preceding 'discover' command. ```shell ./gateway start ``` -------------------------------- ### Install Gateway Binary on macOS (Intel) - Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/installation/README.md This bash snippet downloads the macOS Intel AMD64 binary release, extracts it using tar, and makes the executable file runnable. It depends on curl and tar being available on the system. ```bash # Download the latest binary for macOS (Intel) curl -LO https://github.com/centralmind/gateway/releases/download/v0.0.11/gateway-darwin-amd64.tar.gz # Extract the archive tar -xzf gateway-darwin-amd64.tar.gz mv gateway-darwin-amd64 gateway # Make the binary executable chmod +x gateway ``` -------------------------------- ### Starting Services with Docker Compose - Bash Source: https://github.com/centralmind/gateway/blob/main/example/complex/README.md This command starts all services defined in the `docker-compose.yml` file. The `-d` flag runs the containers in detached mode, allowing the terminal to be used for other commands. ```bash docker-compose up -d ``` -------------------------------- ### Install Gateway Binary on macOS (Apple Silicon) - Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/installation/README.md This bash snippet downloads the macOS Apple Silicon ARM64 binary release, extracts the archive, and gives execute permissions to the binary file. It requires curl and tar utilities. ```bash # Download the latest binary for macOS (Apple Silicon) curl -LO https://github.com/centralmind/gateway/releases/download/v0.0.11/gateway-darwin-arm64.tar.gz # Extract the archive tar -xzf gateway-darwin-arm64.tar.gz mv gateway-darwin-arm64 gateway # Make the binary executable chmod +x gateway ``` -------------------------------- ### Run Gateway using Docker Pre-built Image - Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/installation/README.md These commands pull the official pre-built Gateway Docker image from ghcr.io and run it, mapping the container's port 8080 to the host's port 8080. Docker must be installed and running. ```bash # Pull the latest image docker pull ghcr.io/centralmind/gateway:v0.0.11 # Run the container docker run -p 8080:8080 ghcr.io/centralmind/gateway:v0.0.11 ``` -------------------------------- ### PostgreSQL E-commerce Connection Configuration - YAML Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-ecommerce-sample/README.md Provides the structure and content for a `connection.yaml` file. This file contains the standard details required to connect to the `sampledb` PostgreSQL database instance running via Docker. ```yaml hosts: - localhost user: postgres password: mysecretpassword database: sampledb port: 5432 ``` -------------------------------- ### Extracting Sample Database - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This command extracts the contents of the downloaded `dvdrental.zip` file. It is expected to produce a `dvdrental.tar` file containing the database backup. ```bash unzip dvdrental.zip ``` -------------------------------- ### Complete Gateway API LangChain Integration Example - Python Source: https://github.com/centralmind/gateway/blob/main/docs/content/integration/langchain/README.md Provides a full, runnable Python example demonstrating the integration of a Gateway API with a LangChain agent via its OpenAPI specification. It sets up API details, loads the spec, initializes the LLM and OpenAPI toolkit, configures and runs a 'zero-shot-react-description' agent, and prints the result of a natural language query executed by the agent against the API. ```python import os import requests from langchain_community.agent_toolkits.openapi.toolkit import OpenAPIToolkit from langchain_openai import ChatOpenAI from langchain_community.utilities.requests import RequestsWrapper from langchain_community.tools.json.tool import JsonSpec from langchain.agents import initialize_agent # Define API details API_SPEC_URL = "https://dev1.centralmind.ai/openapi.json" # Replace with your API's OpenAPI spec URL BASE_API_URL = "https://dev1.centralmind.ai" # Replace with your API's base URL # Set OpenAI API key os.environ["OPENAI_API_KEY"] = "your-openai-api-key" # Replace with your actual API key # Load and parse OpenAPI specification api_spec = requests.get(API_SPEC_URL).json() json_spec = JsonSpec(dict_=api_spec) # Initialize components # You can use X-API-KEY header to set authentication using API keys llm = ChatOpenAI(model_name="gpt-4", temperature=0.0) toolkit = OpenAPIToolkit.from_llm(llm, json_spec, RequestsWrapper(headers=None), allow_dangerous_requests=True) # Set up the agent agent = initialize_agent(toolkit.get_tools(), llm, agent="zero-shot-react-description", verbose=True) # Make a request result = agent.run(f"Find specs and pricing for instance c6g.large, use {BASE_API_URL}") print("API response:", result) ``` -------------------------------- ### Stopping PostgreSQL E-commerce Container - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-ecommerce-sample/README.md Stops the running PostgreSQL Docker container that was started by the setup script. This is used to temporarily halt the database service without removing the container. ```bash docker stop some-postgres ``` -------------------------------- ### Downloading Sample Database - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This command downloads the DVD Rental sample database zip file from a specified URL using curl. This file contains the database dump needed for restoration. ```bash curl -O https://neon.tech/postgresqltutorial/dvdrental.zip ``` -------------------------------- ### Verifying PostgreSQL E-commerce Database Tables - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-ecommerce-sample/README.md Connects to the running PostgreSQL Docker container (`some-postgres`) using `docker exec` and runs a psql command (`\dt`) to list all tables in the `sampledb`. Use this to confirm that the data import was successful. ```bash docker exec -it some-postgres psql -U postgres -d sampledb -c "\\dt" ``` -------------------------------- ### Executing Query using Example SQL in MCP Raw Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/running-mcp-raw/README.md This SQL query is provided as an example for the Query Tool in MCP Raw mode. This tool executes the provided query against the configured database, fetches the results, and passes them through the plugin and interceptor systems before returning them. ```sql SELECT * FROM table WHERE id = 123 ``` -------------------------------- ### Starting Gateway REST Server Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/launching-api/README.md This command starts the Gateway REST API server. It uses the `start` action with the `--config` flag to specify the path to the `gateway.yaml` configuration file generated during the API creation process. Requires the `gateway` executable and `gateway.yaml`. ```bash ./gateway start --config gateway.yaml ``` -------------------------------- ### Preparing Query using Example SQL in MCP Raw Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/running-mcp-raw/README.md This SQL query serves as an example used with the Prepare Query Tool in MCP Raw mode. The tool uses such a query to validate its structure and return the expected output schema without actually executing it against the database. ```sql SELECT * FROM table WHERE id = 123 ``` -------------------------------- ### Creating PostgreSQL E-commerce Connection Config File via Echo - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-ecommerce-sample/README.md Uses the `echo` command to write the necessary database connection details directly into a `connection.yaml` file. This provides a quick, command-line method for generating the configuration file. ```bash echo "hosts:\n - localhost\nuser: postgres\npassword: mysecretpassword\ndatabase: sampledb\nport: 5432" > connection.yaml ``` -------------------------------- ### Sample Connection Configuration - YAML Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This YAML snippet provides the structure and details for connecting to the PostgreSQL database running in the Docker container. It lists the host, user, password, database name, and port. ```yaml hosts: - some-postgres user: postgres password: mysecretpassword database: dvdrental port: 5432 ``` -------------------------------- ### Setting up LlamaIndex Agent with MCP Tools (Python) Source: https://github.com/centralmind/gateway/blob/main/docs/content/integration/llamaindex/readme.md This comprehensive Python example demonstrates the full process of setting up an OpenAI agent using LlamaIndex and integrating it with CentralMind Gateway's MCP tools. It involves initializing the MCP client, creating the tool specification, converting tools, initializing the LLM, building the agent, and executing example database queries via the agent. ```python # Setup OpenAI Agent import os from llama_index.agent.openai import OpenAIAgent from llama_index.llms.openai import OpenAI from llama_index.tools.mcp import BasicMCPClient, McpToolSpec # Set your OpenAI API key os.environ["OPENAI_API_KEY"] = "YOUR_API_KEY" # Initialize MCP client with your AutoAPI server mcp_client = BasicMCPClient("http://localhost:9090/sse") # Create MCP tool specification mcp_tool_spec = McpToolSpec( client=mcp_client, # You can filter specific tools by name if needed # allowed_tools=["tool1", "tool2"] ) # Convert tool specification to a list of tools tools = mcp_tool_spec.to_tool_list() # Initialize OpenAI LLM llm = OpenAI(model="gpt-4") # Create the agent with tools agent = OpenAIAgent.from_tools(tools, llm=llm, verbose=True) # Example queries response1 = agent.chat("what is the base url for the server") print(response1) response2 = agent.chat("Show me data from Staff table") print(response2) ``` -------------------------------- ### DuckDB Connector Config with Init SQL (YAML) Source: https://github.com/centralmind/gateway/blob/main/connectors/duckdb/readme.md Example configuration for the DuckDB connector using a directory path in 'hosts', specifying the database file name, and executing initialization SQL commands ('init_sql') to install extensions and create a sample table upon connection. ```yaml connection: type: duckdb hosts: - ./data # relative path to directory database: analytics.duckdb init_sql: | FORCE INSTALL aws FROM core_nightly; FORCE INSTALL httpfs FROM core_nightly; FORCE INSTALL iceberg FROM core_nightly; CREATE TABLE weather AS SELECT * FROM read_csv_auto('https://raw.githubusercontent.com/duckdb/duckdb-web/main/data/weather.csv'); ``` -------------------------------- ### Starting Gateway with Configuration | Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/generating-api/README.md Starts the Gateway server using the previously generated `gateway.yaml` configuration file, making the defined API endpoints accessible. ```bash ./gateway start --config gateway.yaml ``` -------------------------------- ### Create Database Connection Config (Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/quickstart/README.md This snippet demonstrates how to create a basic `connection.yaml` configuration file using the `echo` command in bash. The file specifies the database type (PostgreSQL), host, user, password, database name, and port for connecting Gateway to your database. ```bash echo 'type: postgres hosts: - localhost user: "your-database-user" password: "your-database-password" database: "your-database-name" port: 5432' > connection.yaml ``` -------------------------------- ### Installing LangChain Integration Packages - Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/integration/langchain/README.md Installs the necessary Python packages for integrating a Gateway API with LangChain using pip. These packages include the core LangChain library, specific integrations for OpenAI models and community tools, and the 'requests' library for making HTTP calls to fetch the OpenAPI specification. ```bash pip install langchain langchain-openai langchain-community requests ``` -------------------------------- ### Configure AI Provider API Key (Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/quickstart/README.md This snippet shows how to set the necessary environment variable for authenticating with an AI provider, specifically Google Gemini, using bash. It uses the `export` command to set the `GEMINI_API_KEY` variable to your obtained API key. ```bash export GEMINI_API_KEY='yourkey' ``` -------------------------------- ### Example gateway.yaml Configuration (YAML) Source: https://github.com/centralmind/gateway/blob/main/cli/README.md Provides a basic structural example of the `gateway.yaml` configuration file. This file is central to defining API endpoints, database connections, security settings, and plugin configurations for the Gateway server. ```yaml # Example gateway.yaml api: # API configuration database: # Database connection settings plugins: # Plugin configurations ``` -------------------------------- ### Starting Gateway MCP StdInOut Server Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/launching-api/README.md This command starts the Gateway server in MCP (Message Communication Protocol) StdInOut mode, designed for direct input/output communication. It uses the `start` action with the `--config` flag and explicitly includes the `mcp-stdio` argument to specify the desired mode. Requires the `gateway` executable and `gateway.yaml`. ```bash ./gateway start --config gateway.yaml mcp-stdio ``` -------------------------------- ### Installing LlamaIndex Libraries (Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/integration/llamaindex/readme.md This command installs the necessary Python libraries required for integrating LlamaIndex with CentralMind Gateway's MCP tools. It includes the core LlamaIndex library, the OpenAI agent/LLM integrations, and the specific tools package for MCP. ```bash pip install llama-index llama-index-agent-openai llama-index-llms-openai llama-index-tools-mcp ``` -------------------------------- ### Gateway start stdio CLI Usage (Bash) Source: https://github.com/centralmind/gateway/blob/main/cli/README.md Basic usage syntax for the `gateway start stdio` command. This command starts the MCP gateway specifically for interaction via standard input/output. ```bash gateway start stdio [flags] ``` -------------------------------- ### Starting CentralMind Gateway (Bash) Source: https://github.com/centralmind/gateway/blob/main/docs/content/integration/llamaindex/readme.md This command starts the CentralMind Gateway server, configuring it to connect to a PostgreSQL database using the provided connection string. It enables both MCP and REST endpoints and adds default API methods suitable for read-only analytical queries via an LLM. ```bash ./gateway start --connection-string "postgres://readonly_user.erjbgpchxpyteqwhxauj:supersecretepassword@aws-0-eu-central-1.pooler.supabase.com:6543/postgres" ``` -------------------------------- ### Gateway start CLI Usage (Bash) Source: https://github.com/centralmind/gateway/blob/main/cli/README.md Basic usage syntax for the `gateway start` command. This is the main command used to launch the Gateway server, providing both REST API and MCP SSE endpoints. ```bash gateway start [flags] ``` -------------------------------- ### Creating Connection YAML File - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This command uses `echo` to write the database connection details into a file named `connection.yaml` in YAML format. This file can be used by applications to connect to the database. ```bash echo "hosts:\n - some-postgres\nuser: postgres\npassword: mysecretpassword\ndatabase: dvdrental\nport: 5432" > connection.yaml ``` -------------------------------- ### Stopping and Removing Container - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md These commands stop the running PostgreSQL container and then remove it. This is used for cleaning up the Docker resources after finishing the setup or testing. ```bash docker stop postgres-dvdrental docker rm postgres-dvdrental ``` -------------------------------- ### Restoring Database from Dump - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This command executes `pg_restore` inside the `some-postgres` container. It connects to the `dvdrental` database as user `postgres` and restores the data from the `/tmp/dvdrental.tar` file. ```bash docker exec -it some-postgres pg_restore -U postgres -d dvdrental /tmp/dvdrental.tar ``` -------------------------------- ### Installing Gateway Helm Chart Bash Source: https://github.com/centralmind/gateway/blob/main/helm/gateway/README.md These commands show how to install the Gateway Helm chart into the 'gateway-system' namespace. The first option installs with default values, while the second uses a custom 'values.yaml' file to override default configurations. This deploys the necessary Kubernetes resources defined by the chart. ```bash # Install with default values helm install gateway ./gateway --namespace gateway-system ``` ```bash # Install with custom values helm install gateway ./gateway -f values.yaml --namespace gateway-system ``` -------------------------------- ### Starting Gateway MCP SSE Server Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/launching-api/README.md This command starts the Gateway server in MCP (Message Communication Protocol) SSE mode. It uses the `start` action with the `--config` flag pointing to the `gateway.yaml` file. The exact mode determination might depend on the configuration file content or internal logic when no explicit mode like `mcp-stdio` is provided. Requires the `gateway` executable and `gateway.yaml`. ```bash ./gateway start --config gateway.yaml ``` -------------------------------- ### Verifying Database Restoration - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This command executes `psql` inside the container to connect to the `dvdrental` database as user `postgres` and runs the `\dt` command to list tables. This verifies that the restoration process successfully created database objects. ```bash docker exec -it some-postgres psql -U postgres -d dvdrental -c "\dt" ``` -------------------------------- ### Starting Gateway REST Server Custom Address Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/launching-api/README.md This command starts the Gateway REST API server, overriding the default server address and port. It uses the `start` action with `--config` for the configuration file and `--addr` to specify the desired address (e.g., `:7000` for port 7000). Requires the `gateway` executable and `gateway.yaml`. ```bash ./gateway start --config gateway.yaml --addr :7000 ``` -------------------------------- ### Example Comprehensive Gateway Values Configuration YAML Source: https://github.com/centralmind/gateway/blob/main/helm/gateway/README.md This YAML snippet provides a more comprehensive example of a 'values.yaml' file, including image pull secrets, detailed Ingress configuration (kind, entry points, hosts, paths), and structured Gateway-specific configuration for API and database connections, demonstrating multi-line string usage for database connection details. ```yaml image: repository: ghcr.io/centralmind/gateway tag: "0.0.0-rc0" # Optional: configure image pull secrets if using private registry imagePullSecrets: - name: registry-secret ingress: enabled: true kind: IngressRoute entryPoints: - web hosts: - host: my-gateway.example.com paths: - path: / pathType: Prefix gateway: api: name: My API version: "2.0" database: type: postgres connection: | hosts: - postgres.database user: myuser password: ${DB_PASSWORD} database: mydb port: 5432 ``` -------------------------------- ### Configuring ClickHouse Connector via Host/Port - YAML Source: https://github.com/centralmind/gateway/blob/main/connectors/clickhouse/readme.md Provides an example configuration for the ClickHouse connector using individual parameters such as host(s), database name, username, password, port, and security settings (HTTPS). This is suitable for standard deployments or cluster setups. ```yaml type: clickhouse host: localhost # Single host address hosts: # Or multiple hosts for cluster setup - host1.example.com - host2.example.com database: mydb user: default password: secret port: 8123 secure: false # Use HTTPS instead of HTTP ``` -------------------------------- ### Configuring AWS Credentials using CLI (Bash) Source: https://github.com/centralmind/gateway/blob/main/providers/bedrock/README.md Explains how to initialize the AWS Command Line Interface (CLI) configuration process. This command is used to set up default region, output format, and optionally, access key and secret access key, typically stored in ~/.aws/credentials and ~/.aws/config. It requires the AWS CLI to be installed. ```bash aws configure ``` -------------------------------- ### Starting Gateway REST API Server Bash Source: https://github.com/centralmind/gateway/blob/main/connectors/supabase/README.md This command starts the CentralMind Gateway server using the configuration generated in `gateway.yaml`. It specifically launches the REST API interface, making the automatically generated API endpoints available for HTTP requests. This requires the gateway binary and the `gateway.yaml` file to be present. ```bash ./gateway start --config gateway.yaml rest ``` -------------------------------- ### Pulling PostgreSQL Docker Image - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This command pulls the latest official PostgreSQL Docker image from Docker Hub. This image is required to run the database container. ```bash docker pull postgres ``` -------------------------------- ### Starting Gateway MCP Stdio Server Bash Source: https://github.com/centralmind/gateway/blob/main/connectors/supabase/README.md This command starts the CentralMind Gateway server as configured in `gateway.yaml`. It initiates the Micro-Channel Protocol (MCP) API server using standard input/output (stdio) streams. This is another alternative interface for interacting with the generated API. ```bash ./gateway start --config gateway.yaml mcp-stdio ``` -------------------------------- ### PostgreSQL Connector DSN Configuration Example - YAML Source: https://github.com/centralmind/gateway/blob/main/connectors/postgres/readme.md This snippet provides an alternative configuration example for the PostgreSQL connector using a single connection string (DSN) instead of listing individual connection parameters. ```yaml type: postgres conn_string: postgresql://my_user:my_pass@localhost:5432/mydb ``` -------------------------------- ### PostgreSQL Connector Configuration Example - YAML Source: https://github.com/centralmind/gateway/blob/main/connectors/postgres/readme.md This snippet shows a basic configuration example for the PostgreSQL connector using individual fields such as type, hosts, database, user, password, and port, with optional schema and TLS settings. ```yaml type: postgres hosts: - localhost database: mydb user: postgres password: secret port: 5432 schema: sales tls_file: "" # Optional PEM-encoded certificate enable_tls: false # Enable TLS/SSL connection ``` -------------------------------- ### Example Gateway Custom Values Configuration YAML Source: https://github.com/centralmind/gateway/blob/main/helm/gateway/README.md This YAML snippet provides an example of a custom 'values.yaml' file used to configure the Gateway Helm chart. It demonstrates setting the container image and tag, service type and port, enabling Ingress with a hostname and path, and providing basic Gateway API configuration. ```yaml image: repository: ghcr.io/centralmind/gateway tag: "latest" service: type: ClusterIP port: 8080 ingress: enabled: true hosts: - host: gateway.example.com paths: - path: / pathType: Prefix gateway: api: name: My API version: "1.0" ``` -------------------------------- ### Starting Gateway MCP SSE Server Bash Source: https://github.com/centralmind/gateway/blob/main/connectors/supabase/README.md This command starts the CentralMind Gateway server based on the `gateway.yaml` configuration. It launches the Micro-Channel Protocol (MCP) API server utilizing Server-Sent Events (SSE) for real-time communication. This provides an alternative interface to the standard REST API. ```bash ./gateway start --config gateway.yaml mcp ``` -------------------------------- ### Configuring Database Connection | YAML Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/generating-api/README.md Provides an example YAML configuration file (`connection.yaml`) for specifying database connection details like type, host, user, password, database name, and port. ```yaml # Example connection.yaml type: postgres hosts: - localhost user: postgres password: mysecretpassword database: sampledb port: 5432 ``` -------------------------------- ### Configuring Claude Desktop for Gateway Tool (JSON) Source: https://github.com/centralmind/gateway/blob/main/docs/content/integration/claude-desktop/README.md This JSON snippet provides the structure for adding the Central Mind Gateway as a custom tool in the Claude Desktop configuration file. It defines a new entry under 'mcpServers' named 'gateway', specifying the path to the Gateway binary and the command-line arguments required to start it in 'mcp-stdio' mode with a specific configuration file. Replace the placeholder paths with your actual Gateway installation and configuration file locations. ```json { "mcpServers": { "gateway": { "command": "PATH_TO_GATEWAY_BINARY", "args": [ "start", "--config", "PATH_TO_GATEWAY_YAML_CONFIG", "mcp-stdio" ] } } } ``` -------------------------------- ### Running Gateway Discover with Gemini Provider and Config - Bash Source: https://github.com/centralmind/gateway/blob/main/providers/gemini/README.md Basic example of executing the `./gateway discover` command using the `gemini` AI provider and a connection configuration file. This command initiates the process of discovering or interacting with AI capabilities based on the settings defined in the specified `connection.yaml` file. ```bash ./gateway discover \ --ai-provider gemini \ --config connection.yaml ``` -------------------------------- ### Starting Gateway REST API Server Source: https://github.com/centralmind/gateway/blob/main/providers/local-models/README.md Starts the Gateway REST API server based on a previously generated configuration file (typically 'gateway.yaml'). This command makes the defined API endpoints available for use. It assumes the configuration file exists and is correctly formatted. ```bash ./gateway start rest --config gateway.yaml ``` -------------------------------- ### Starting REST API Server | Bash Source: https://github.com/centralmind/gateway/blob/main/connectors/neon/README.md This command starts the CentralMind Gateway server in REST API mode. It utilizes the configuration generated during the discovery phase (`gateway.yaml`) to expose the database tables and associated API methods over HTTP. The server will be accessible, by default, at `http://localhost:9090`. ```Bash ./gateway start --config gateway.yaml rest ``` -------------------------------- ### Running Gateway with OpenAI Provider and Config (Bash) Source: https://github.com/centralmind/gateway/blob/main/providers/openai/README.md Shows a basic command-line example of invoking the `./gateway` tool, specifying the `openai` provider using `--ai-provider` and referencing a connection configuration file (`connection.yaml`) using `--config`. This is a fundamental command for utilizing the OpenAI provider. ```bash ./gateway discover \ --ai-provider openai \ --config connection.yaml ``` -------------------------------- ### Generating API Configuration using Discover Command (Shell) Source: https://github.com/centralmind/gateway/blob/main/README.md This command executes the `discover` function of the CentralMind Gateway binary. It instructs the gateway to connect to the specified database using the provided connection string, utilize the Google Gemini AI provider, and use the given prompt to guide the API generation process. The process analyzes the database schema and sampled data to create an optimized API configuration. ```shell ./gateway discover \ --ai-provider gemini \ --connection-string "postgresql://neondb_owner:MY_PASSWORD@MY_HOST.neon.tech/neondb?sslmode=require" \ --prompt "Generate for me awesome readonly API" ``` -------------------------------- ### Copying Database Dump into Container - Bash Source: https://github.com/centralmind/gateway/blob/main/example/postgresql-dvdstore-sample/README.md This command copies the extracted `dvdrental.tar` file from the local filesystem into the `/tmp/` directory inside the running `some-postgres` Docker container. This makes the dump file accessible within the container for restoration. ```bash docker cp dvdrental.tar some-postgres:/tmp/ ``` -------------------------------- ### Setting Up and Running LangChain Agent with API Tools - Python Source: https://github.com/centralmind/gateway/blob/main/docs/content/integration/langchain/README.md Initializes a LangChain agent with the tools provided by the `OpenAPIToolkit` (derived from the API spec) and the configured LLM. It uses the 'zero-shot-react-description' agent type for reasoning. The agent is then invoked with a natural language query, prompting it to select and use the appropriate API tools to fulfill the user's request. ```python agent = initialize_agent(toolkit.get_tools(), llm, agent="zero-shot-react-description", verbose=True) result = agent.run(f"Find specs and pricing for instance c6g.large, use {BASE_API_URL}") ``` -------------------------------- ### Running Gateway Discover with Bedrock Provider (Bash) Source: https://github.com/centralmind/gateway/blob/main/providers/bedrock/README.md Demonstrates how to execute the ./gateway discover command using the Amazon Bedrock AI provider. This command requires a connection.yaml configuration file and assumes the ./gateway executable is present and AWS credentials/region are configured via environment variables, credentials file, or default settings. ```bash ./gateway discover \ --ai-provider bedrock \ --config connection.yaml ``` -------------------------------- ### Example In-Memory SQLite Configuration YAML Source: https://github.com/centralmind/gateway/blob/main/connectors/sqlite/readme.md Shows how to configure the SQLite connector to create and use a temporary, in-memory database. When 'memory' is set to true, 'hosts' and 'database' settings are ignored. ```yaml sqlite: memory: true ``` -------------------------------- ### Starting MCP Stdio API Server | Bash Source: https://github.com/centralmind/gateway/blob/main/connectors/neon/README.md This optional command starts the CentralMind Gateway server in Message Control Protocol (MCP) mode using standard input/output (stdio). It uses the `gateway.yaml` configuration file. This mode is typically used for programmatic interaction via stdio streams rather than network protocols. ```Bash ./gateway start --config gateway.yaml mcp-stdio ``` -------------------------------- ### Starting MCP SSE API Server | Bash Source: https://github.com/centralmind/gateway/blob/main/connectors/neon/README.md This optional command starts the CentralMind Gateway server in Message Control Protocol (MCP) mode using Server-Sent Events (SSE). It uses the `gateway.yaml` configuration file. This mode is used for specific communication patterns and is an alternative to the standard REST API. ```Bash ./gateway start --config gateway.yaml mcp ``` -------------------------------- ### Example File-Based SQLite Configuration YAML Source: https://github.com/centralmind/gateway/blob/main/connectors/sqlite/readme.md Demonstrates configuring the SQLite connector to connect to a specific database file ('mydb.db') located within a designated directory ('/data') using the detailed configuration structure. ```yaml sqlite: hosts: ["/data"] database: "mydb.db" ``` -------------------------------- ### Stopping Database Containers with Docker Compose (Bash) Source: https://github.com/centralmind/gateway/blob/main/example/README.md This command uses Docker Compose to stop and remove all services (database containers), networks, and volumes defined in the `docker-compose.yml` file. This effectively tears down the entire environment. ```bash docker-compose down ``` -------------------------------- ### Generating API Configuration with AI | Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/generating-api/README.md Executes the Gateway `discover` command with AI assistance. It uses the specified AI provider, database connection config, and a custom prompt to guide the AI in generating the `gateway.yaml` API definition. ```bash ./gateway discover \ --ai-provider gemini \ --config connection.yaml \ --prompt "Develop an API that enables a chatbot to retrieve information about data. \ Try to place yourself as analyst and think what kind of data you will require, \ based on that come up with useful API methods for that" ``` -------------------------------- ### Running CentralMind Gateway Binary Shell Source: https://github.com/centralmind/gateway/blob/main/docs/..md Provides the shell commands necessary to build the CentralMind Gateway executable from its source code and subsequently start the gateway using a specified configuration file, exposing the generated APIs via the REST protocol. ```shell go build . ./gateway start --config ./example/gateway.yaml rest ``` -------------------------------- ### Setting Environment Variables and Launching Gateway Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/launching-api/README.md This bash script demonstrates how to set environment variables before launching the Gateway server. It assigns values to variables like `DB_HOST`, `DB_USER`, `DB_PASSWORD`, `DB_NAME`, and `API_SECRET_KEY` using the `export` command, which are then picked up by the `gateway start` command when using the corresponding `${VARIABLE_NAME}` syntax in the configuration file. Requires the environment variables to be set. ```bash export DB_HOST=localhost export DB_USER=myuser export DB_PASSWORD=mysecret export DB_NAME=mydb export API_SECRET_KEY=your-secret-key # Launch the API ./gateway start --config gateway.yaml ``` -------------------------------- ### Starting MCP Raw Server using Gateway Bash Command Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/running-mcp-raw/README.md This bash command is used to launch the Gateway server specifically configured for MCP Raw mode. It requires specifying the path to the generated `gateway.yaml` configuration file using the `--config` flag and enabling the raw mode feature with the `--raw` flag. ```bash ./gateway start --config gateway.yaml --raw ``` -------------------------------- ### Verifying Pod Status with kubectl Source: https://github.com/centralmind/gateway/blob/main/example/k8s/README.md Lists all pods within the 'demo' namespace to check their current status (e.g., Running, Pending, Failed). This helps confirm that the Gateway application pods have started successfully after deployment. ```bash kubectl get pods -n demo ``` -------------------------------- ### Configure Google OAuth Provider - YAML Source: https://github.com/centralmind/gateway/blob/main/plugins/oauth/README.md Example YAML configuration snippet specifically for setting up the OAuth plugin to use Google as the identity provider, including client credentials and recommended scopes. ```YAML oauth: provider: "google" client_id: "xxx.apps.googleusercontent.com" client_secret: "xxx" scopes: - "https://www.googleapis.com/auth/userinfo.profile" - "https://www.googleapis.com/auth/userinfo.email" ``` -------------------------------- ### Configuring OAuth Plugin YAML Source: https://github.com/centralmind/gateway/blob/main/plugins/README.md This snippet provides a YAML configuration example for the 'oauth' plugin. It shows how to specify the OAuth provider, client credentials (client_id, client_secret), the redirect URL for callbacks, and required access scopes for the OAuth flow. ```yaml oauth: provider: "github" # OAuth provider (google, github, auth0, keycloak, okta) client_id: "xxx" # OAuth Client ID client_secret: "xxx" # OAuth Client Secret redirect_url: "http://localhost:8080/oauth/callback" scopes: # Required access scopes - "profile" - "email" ``` -------------------------------- ### Listing Helm Releases in Namespace Bash Source: https://github.com/centralmind/gateway/blob/main/helm/gateway/README.md This command lists all Helm releases deployed within the specified namespace ('gateway-system'). It helps verify that the Helm installation was successful and shows the release name, chart version, and status. ```bash helm list -n gateway-system ``` -------------------------------- ### Example SQLite Configuration with Connection String YAML Source: https://github.com/centralmind/gateway/blob/main/connectors/sqlite/readme.md Illustrates configuring the SQLite connector using a single connection string that specifies the absolute path to the database file. This format overrides all other detailed configuration options. ```yaml sqlite: "/absolute/path/to/database.db" ``` -------------------------------- ### DuckDB Connector Config with Current Directory (YAML) Source: https://github.com/centralmind/gateway/blob/main/connectors/duckdb/readme.md Example configuration using '.' in the 'hosts' field to specify the current working directory as the base path and providing the database file name separately in the 'database' field. ```yaml connection: type: duckdb hosts: - . database: analytics.duckdb ``` -------------------------------- ### Discover DuckDB Memory Connection (Shell) Source: https://github.com/centralmind/gateway/blob/main/connectors/duckdb/readme.md Shell command example for running the gateway's discovery process using an in-memory DuckDB database by providing the ':memory:' connection string via the '--connection-string' parameter. ```shell ./gateway discover --ai-provider openai --connection-string "duckdb://:memory:" ``` -------------------------------- ### Configuring OpenTelemetry Plugin YAML Source: https://github.com/centralmind/gateway/blob/main/plugins/otel/README.md This YAML snippet provides a configuration example for the OpenTelemetry plugin. It defines exporter type, service identification details (name, version, environment), endpoint for the OpenTelemetry collector, TLS mode, and parameters for span batching and queueing, along with custom resource attributes. ```yaml otel: exporter_type: "oltp" # "oltp" or "stdout" service_name: "my-gateway" service_version: "1.0.0" environment: "production" endpoint: "localhost:4317" tls_mode: "insecure" span_max_queue_size: 5000 span_max_export_batch: 512 batch_timeout: "1s" resource_attributes: # Additional trace attributes team: "backend" region: "us-east-1" ``` -------------------------------- ### Configure Auth0 OAuth Provider - YAML Source: https://github.com/centralmind/gateway/blob/main/plugins/oauth/README.md Example YAML configuration snippet specifically for setting up the OAuth plugin to use Auth0, requiring the provider name, client credentials, a user info URL, and standard OpenID Connect scopes. ```YAML oauth: provider: "auth0" client_id: "xxx" client_secret: "xxx" user_info_url: "https://your-tenant.auth0.com/userinfo" scopes: - "openid" - "profile" - "email" ``` -------------------------------- ### Configuring Gateway for Anthropic Vertex AI (Bash) Source: https://github.com/centralmind/gateway/blob/main/providers/anthropic-vertexai/README.md These bash examples illustrate various ways to configure the 'gateway' tool to use the `anthropic-vertexai` provider. They show how to specify the Google Cloud project, region, model, and advanced parameters (reasoning, max tokens, temperature) using command-line flags or environment variables. ```bash ./gateway discover \ --ai-provider anthropic-vertexai \ --vertexai-region your-gcp-region \ --vertexai-project your-gcp-project-id \ --config connection.yaml ``` ```bash ./gateway discover \ --ai-provider anthropic-vertexai \ --vertexai-project your-gcp-project-id \ --vertexai-region us-central1 \ --config connection.yaml ``` ```bash export ANTHROPIC_VERTEXAI_PROJECT="your-gcp-project-id" export ANTHROPIC_VERTEXAI_REGION="us-central1" ./gateway discover \ --ai-provider anthropic-vertexai \ --config connection.yaml ``` ```bash # Specify model via command line ./gateway discover \ --ai-provider anthropic-vertexai \ --ai-model claude-3-7-sonnet@20250219 \ --config connection.yaml ``` ```bash # Or via environment variable export ANTHROPIC_MODEL_ID=claude-3-7-sonnet@20250219 ./gateway discover \ --ai-provider anthropic-vertexai \ --config connection.yaml ``` ```bash ./gateway discover \ --ai-provider anthropic-vertexai \ --ai-reasoning=true \ --config connection.yaml ``` ```bash ./gateway discover \ --ai-provider anthropic-vertexai \ --ai-max-tokens 8192 \ --config connection.yaml ``` ```bash ./gateway discover \ --ai-provider anthropic-vertexai \ --ai-temperature 0.5 \ --config connection.yaml ``` -------------------------------- ### Configuring BigQuery Connector with Direct Parameters YAML Source: https://github.com/centralmind/gateway/blob/main/connectors/bigquery/readme.md Example YAML configuration for the BigQuery connector using direct fields like `project_id`, `dataset`, and `credentials`. The credentials must be provided as a multiline JSON string. ```YAML type: bigquery project_id: your-project-id dataset: your_dataset credentials: | { "type": "service_account", ... } ``` -------------------------------- ### Configure Okta OAuth Provider - YAML Source: https://github.com/centralmind/gateway/blob/main/plugins/oauth/README.md Example YAML configuration snippet specifically for setting up the OAuth plugin to use Okta, requiring the provider name, client credentials, an introspection URL for token validation, and standard OpenID Connect scopes. ```YAML oauth: provider: "okta" client_id: "xxx" client_secret: "xxx" introspection_url: "https://your-org.okta.com/oauth2/v1/introspect" scopes: - "openid" - "profile" ``` -------------------------------- ### Configure GitHub OAuth Provider - YAML Source: https://github.com/centralmind/gateway/blob/main/plugins/oauth/README.md Example YAML configuration snippet specifically for setting up the OAuth plugin to use GitHub as the identity provider, including client credentials and recommended scopes for user and email access. ```YAML oauth: provider: "github" client_id: "xxx" client_secret: "xxx" scopes: - "read:user" - "user:email" ``` -------------------------------- ### Enabling Reasoning Mode for Bedrock Provider (Bash) Source: https://github.com/centralmind/gateway/blob/main/providers/bedrock/README.md Demonstrates how to activate the "reasoning" mode for the Bedrock provider using the --ai-reasoning=true flag. Enabling this mode modifies configuration parameters like token budget and temperature to optimize for complex reasoning tasks when interacting with capable models like Claude. It requires a connection.yaml file. ```bash ./gateway discover \ --ai-provider bedrock \ --ai-reasoning=true \ --config connection.yaml ``` -------------------------------- ### Displaying Gateway Help | Bash Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/generating-api/README.md Shows the command-line help for the Gateway executable, listing available commands and options. ```bash ./gateway --help ``` -------------------------------- ### Initializing LangChain LLM and OpenAPI Toolkit - Python Source: https://github.com/centralmind/gateway/blob/main/docs/content/integration/langchain/README.md Initializes the core LangChain components needed for agent interaction: the Large Language Model (`ChatOpenAI`), configured here to use GPT-4, and the `OpenAPIToolkit`. The toolkit is linked to the LLM, the loaded API specification (`json_spec`), and a `RequestsWrapper` to handle making HTTP calls to the API based on the agent's decisions. ```python llm = ChatOpenAI(model_name="gpt-4", temperature=0.0) toolkit = OpenAPIToolkit.from_llm(llm, json_spec, RequestsWrapper(headers=None), allow_dangerous_requests=True) ``` -------------------------------- ### Configuring Gateway with Environment Variables YAML Source: https://github.com/centralmind/gateway/blob/main/docs/content/getting-started/launching-api/README.md This YAML snippet shows how to use environment variables within the `gateway.yaml` configuration file. It uses the `${VARIABLE_NAME}` syntax to reference values that will be provided externally, typically through environment variables, for sensitive settings like database credentials or API keys. This is a configuration example, not executable code. ```yaml database: connection: host: ${DB_HOST} user: ${DB_USER} password: ${DB_PASSWORD} database: ${DB_NAME} api: auth: secret_key: ${API_SECRET_KEY} ``` -------------------------------- ### DuckDB Connector Config with Full Path (YAML) Source: https://github.com/centralmind/gateway/blob/main/connectors/duckdb/readme.md Example configuration for the DuckDB connector providing the full absolute file path to the database file directly in the 'hosts' field, showing syntax for both Unix and Windows operating systems. ```yaml connection: type: duckdb hosts: - /absolute/path/to/analytics.duckdb # Unix-style path # or - C:/Users/MyUser/data/analytics.duckdb # Windows-style path ```