Files
genai-toolbox/docs/en/resources/sources/_index.md
Wenxin Du eadb678a7b feat: Support env replacement for tool.yaml (#462)
Environment variable replacement is needed so that users don't have to
hardcode their secrets in configuring `tools.yaml`.
Both formats `$ENV_NAME` and `${ENV_NAME}` are standard ways to declare
an environment variable.
However, some database statement placeholders that are already using the
`$ENV_NAME` format.
Therefore, we only support env var declaration using `${ENV_NAME}` to
disambiguate it from other usages.

Fixes issue: https://github.com/googleapis/genai-toolbox/issues/431
2025-04-23 07:33:02 -04:00

984 B

title, type, weight, description
title type weight description
Sources docs 1 Sources represent your different data sources that a tool can interact with.

A Source represents a data sources that a tool can interact with. You can define Sources as a map in the sources section of your tools.yaml file. Typically, a source configuration will contain any information needed to connect with and interact with the database.

{{< notice tip >}} Use environment variable replacement with the format ${ENV_NAME} instead of hardcoding your secrets into the configuration file. {{< /notice >}}

sources:
    my-cloud-sql-source:
        kind: cloud-sql-postgres
        project: my-project-id
        region: us-central1
        instance: my-instance-name
        database: my_db
        user: ${USER_NAME}
        password: ${PASSWORD}

In implementation, each source is a different connection pool or client that used to connect to the database and execute the tool.

Available Sources