mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-30 09:48:27 -05:00
Compare commits
29 Commits
binary-npx
...
processing
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82502ddfb4 | ||
|
|
42d9cd0e42 | ||
|
|
e0245946ea | ||
|
|
6e49ba436e | ||
|
|
4cff979491 | ||
|
|
e995349ea0 | ||
|
|
4c9765f1fb | ||
|
|
321a8835fc | ||
|
|
7d9946026e | ||
|
|
d1358916d8 | ||
|
|
2d5d33388c | ||
|
|
252fc3091a | ||
|
|
10c445b05c | ||
|
|
341316bb63 | ||
|
|
44da09300c | ||
|
|
0dfcf24859 | ||
|
|
be0b7fc96e | ||
|
|
d7016d2251 | ||
|
|
d44283ffcf | ||
|
|
69e3f2eb24 | ||
|
|
c724bea786 | ||
|
|
4bc684d3ed | ||
|
|
9434450a65 | ||
|
|
362ed8df41 | ||
|
|
293c1d6889 | ||
|
|
cf477b529a | ||
|
|
cdc4d0d304 | ||
|
|
3aa1b79c13 | ||
|
|
941ed689b4 |
@@ -171,6 +171,23 @@ steps:
|
|||||||
alloydbainl \
|
alloydbainl \
|
||||||
alloydbainl
|
alloydbainl
|
||||||
|
|
||||||
|
- id: "alloydb-omni"
|
||||||
|
name: golang:1
|
||||||
|
waitFor: ["compile-test-binary"]
|
||||||
|
entrypoint: /bin/bash
|
||||||
|
env:
|
||||||
|
- "GOPATH=/gopath"
|
||||||
|
volumes:
|
||||||
|
- name: "go"
|
||||||
|
path: "/gopath"
|
||||||
|
args:
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
.ci/test_with_coverage.sh \
|
||||||
|
"AlloyDB Omni" \
|
||||||
|
alloydbomni \
|
||||||
|
postgres
|
||||||
|
|
||||||
- id: "bigtable"
|
- id: "bigtable"
|
||||||
name: golang:1
|
name: golang:1
|
||||||
waitFor: ["compile-test-binary"]
|
waitFor: ["compile-test-binary"]
|
||||||
@@ -295,6 +312,25 @@ steps:
|
|||||||
cloudhealthcare \
|
cloudhealthcare \
|
||||||
cloudhealthcare
|
cloudhealthcare
|
||||||
|
|
||||||
|
- id: "cloud-logging-admin"
|
||||||
|
name: golang:1
|
||||||
|
waitFor: ["compile-test-binary"]
|
||||||
|
entrypoint: /bin/bash
|
||||||
|
env:
|
||||||
|
- "GOPATH=/gopath"
|
||||||
|
- "LOGADMIN_PROJECT=$PROJECT_ID"
|
||||||
|
secretEnv: ["CLIENT_ID"]
|
||||||
|
volumes:
|
||||||
|
- name: "go"
|
||||||
|
path: "/gopath"
|
||||||
|
args:
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
.ci/test_with_coverage.sh \
|
||||||
|
"Cloud Logging Admin" \
|
||||||
|
cloudloggingadmin \
|
||||||
|
cloudloggingadmin
|
||||||
|
|
||||||
- id: "postgres"
|
- id: "postgres"
|
||||||
name: golang:1
|
name: golang:1
|
||||||
waitFor: ["compile-test-binary"]
|
waitFor: ["compile-test-binary"]
|
||||||
@@ -657,7 +693,7 @@ steps:
|
|||||||
"Looker" \
|
"Looker" \
|
||||||
looker \
|
looker \
|
||||||
looker
|
looker
|
||||||
|
|
||||||
- id: "mindsdb"
|
- id: "mindsdb"
|
||||||
name: golang:1
|
name: golang:1
|
||||||
waitFor: ["compile-test-binary"]
|
waitFor: ["compile-test-binary"]
|
||||||
@@ -845,7 +881,7 @@ steps:
|
|||||||
"Snowflake" \
|
"Snowflake" \
|
||||||
snowflake \
|
snowflake \
|
||||||
snowflake
|
snowflake
|
||||||
|
|
||||||
- id: "cassandra"
|
- id: "cassandra"
|
||||||
name: golang:1
|
name: golang:1
|
||||||
waitFor: ["compile-test-binary"]
|
waitFor: ["compile-test-binary"]
|
||||||
@@ -887,16 +923,16 @@ steps:
|
|||||||
tar -C /usr/local -xzf go.tar.gz
|
tar -C /usr/local -xzf go.tar.gz
|
||||||
export PATH="/usr/local/go/bin:$$PATH"
|
export PATH="/usr/local/go/bin:$$PATH"
|
||||||
|
|
||||||
go test -v ./internal/sources/oracle/... \
|
go test -v ./tests/oracle/... \
|
||||||
-coverprofile=oracle_coverage.out \
|
-coverprofile=oracle_coverage.out \
|
||||||
-coverpkg=./internal/sources/oracle/...,./internal/tools/oracle/...
|
-coverpkg=./internal/sources/oracle/...,./internal/tools/oracle/...
|
||||||
|
|
||||||
# Coverage check
|
# Coverage check
|
||||||
total_coverage=$(go tool cover -func=oracle_coverage.out | grep "total:" | awk '{print $3}')
|
total_coverage=$(go tool cover -func=oracle_coverage.out | grep "total:" | awk '{print $3}')
|
||||||
echo "Oracle total coverage: $total_coverage"
|
echo "Oracle total coverage: $total_coverage"
|
||||||
coverage_numeric=$(echo "$total_coverage" | sed 's/%//')
|
coverage_numeric=$(echo "$total_coverage" | sed 's/%//')
|
||||||
if awk -v cov="$coverage_numeric" 'BEGIN {exit !(cov < 20)}'; then
|
if awk -v cov="$coverage_numeric" 'BEGIN {exit !(cov < 60)}'; then
|
||||||
echo "Coverage failure: $total_coverage is below 20%."
|
echo "Coverage failure: $total_coverage is below 60%."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -92,11 +92,11 @@ implementation](https://github.com/googleapis/genai-toolbox/blob/main/internal/s
|
|||||||
`newdb.go`. Create a `Config` struct to include all the necessary parameters
|
`newdb.go`. Create a `Config` struct to include all the necessary parameters
|
||||||
for connecting to the database (e.g., host, port, username, password, database
|
for connecting to the database (e.g., host, port, username, password, database
|
||||||
name) and a `Source` struct to store necessary parameters for tools (e.g.,
|
name) and a `Source` struct to store necessary parameters for tools (e.g.,
|
||||||
Name, Kind, connection object, additional config).
|
Name, Type, connection object, additional config).
|
||||||
* **Implement the
|
* **Implement the
|
||||||
[`SourceConfig`](https://github.com/googleapis/genai-toolbox/blob/fd300dc606d88bf9f7bba689e2cee4e3565537dd/internal/sources/sources.go#L57)
|
[`SourceConfig`](https://github.com/googleapis/genai-toolbox/blob/fd300dc606d88bf9f7bba689e2cee4e3565537dd/internal/sources/sources.go#L57)
|
||||||
interface**. This interface requires two methods:
|
interface**. This interface requires two methods:
|
||||||
* `SourceConfigKind() string`: Returns a unique string identifier for your
|
* `SourceConfigType() string`: Returns a unique string identifier for your
|
||||||
data source (e.g., `"newdb"`).
|
data source (e.g., `"newdb"`).
|
||||||
* `Initialize(ctx context.Context, tracer trace.Tracer) (Source, error)`:
|
* `Initialize(ctx context.Context, tracer trace.Tracer) (Source, error)`:
|
||||||
Creates a new instance of your data source and establishes a connection to
|
Creates a new instance of your data source and establishes a connection to
|
||||||
@@ -104,7 +104,7 @@ implementation](https://github.com/googleapis/genai-toolbox/blob/main/internal/s
|
|||||||
* **Implement the
|
* **Implement the
|
||||||
[`Source`](https://github.com/googleapis/genai-toolbox/blob/fd300dc606d88bf9f7bba689e2cee4e3565537dd/internal/sources/sources.go#L63)
|
[`Source`](https://github.com/googleapis/genai-toolbox/blob/fd300dc606d88bf9f7bba689e2cee4e3565537dd/internal/sources/sources.go#L63)
|
||||||
interface**. This interface requires one method:
|
interface**. This interface requires one method:
|
||||||
* `SourceKind() string`: Returns the same string identifier as `SourceConfigKind()`.
|
* `SourceType() string`: Returns the same string identifier as `SourceConfigType()`.
|
||||||
* **Implement `init()`** to register the new Source.
|
* **Implement `init()`** to register the new Source.
|
||||||
* **Implement Unit Tests** in a file named `newdb_test.go`.
|
* **Implement Unit Tests** in a file named `newdb_test.go`.
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ tools.
|
|||||||
* **Implement the
|
* **Implement the
|
||||||
[`ToolConfig`](https://github.com/googleapis/genai-toolbox/blob/fd300dc606d88bf9f7bba689e2cee4e3565537dd/internal/tools/tools.go#L61)
|
[`ToolConfig`](https://github.com/googleapis/genai-toolbox/blob/fd300dc606d88bf9f7bba689e2cee4e3565537dd/internal/tools/tools.go#L61)
|
||||||
interface**. This interface requires one method:
|
interface**. This interface requires one method:
|
||||||
* `ToolConfigKind() string`: Returns a unique string identifier for your tool
|
* `ToolConfigType() string`: Returns a unique string identifier for your tool
|
||||||
(e.g., `"newdb-tool"`).
|
(e.g., `"newdb-tool"`).
|
||||||
* `Initialize(sources map[string]Source) (Tool, error)`: Creates a new
|
* `Initialize(sources map[string]Source) (Tool, error)`: Creates a new
|
||||||
instance of your tool and validates that it can connect to the specified
|
instance of your tool and validates that it can connect to the specified
|
||||||
@@ -243,7 +243,7 @@ resources.
|
|||||||
| style | Update src code, with only formatting and whitespace updates (e.g. code formatter or linter changes). |
|
| style | Update src code, with only formatting and whitespace updates (e.g. code formatter or linter changes). |
|
||||||
|
|
||||||
Pull requests should always add scope whenever possible. The scope is
|
Pull requests should always add scope whenever possible. The scope is
|
||||||
formatted as `<scope-type>/<scope-kind>` (e.g., `sources/postgres`, or
|
formatted as `<scope-resource>/<scope-type>` (e.g., `sources/postgres`, or
|
||||||
`tools/mssql-sql`).
|
`tools/mssql-sql`).
|
||||||
|
|
||||||
Ideally, **each PR covers only one scope**, if this is
|
Ideally, **each PR covers only one scope**, if this is
|
||||||
|
|||||||
19
DEVELOPER.md
19
DEVELOPER.md
@@ -47,12 +47,13 @@ Before you begin, ensure you have the following:
|
|||||||
### Tool Naming Conventions
|
### Tool Naming Conventions
|
||||||
|
|
||||||
This section details the purpose and conventions for MCP Toolbox's tools naming
|
This section details the purpose and conventions for MCP Toolbox's tools naming
|
||||||
properties, **tool name** and **tool kind**.
|
properties, **tool name** and **tool type**.
|
||||||
|
|
||||||
```
|
```
|
||||||
cancel_hotel: <- tool name
|
kind: tools
|
||||||
kind: postgres-sql <- tool kind
|
name: cancel_hotel <- tool name
|
||||||
source: my_pg_source
|
type: postgres-sql <- tool type
|
||||||
|
source: my_pg_source
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Tool Name
|
#### Tool Name
|
||||||
@@ -76,17 +77,17 @@ The following guidelines apply to tool names:
|
|||||||
to a function) until they can be validated through extensive testing to ensure
|
to a function) until they can be validated through extensive testing to ensure
|
||||||
they do not negatively impact agent's performances.
|
they do not negatively impact agent's performances.
|
||||||
|
|
||||||
#### Tool Kind
|
#### Tool Type
|
||||||
|
|
||||||
Tool kind serves as a category or type that a user can assign to a tool.
|
Tool type serves as a category or type that a user can assign to a tool.
|
||||||
|
|
||||||
The following guidelines apply to tool kinds:
|
The following guidelines apply to tool types:
|
||||||
|
|
||||||
* Should user hyphens over underscores (e.g. `firestore-list-collections` or
|
* Should use hyphens over underscores (e.g. `firestore-list-collections` or
|
||||||
`firestore_list_colelctions`).
|
`firestore_list_colelctions`).
|
||||||
* Should use product name in name (e.g. `firestore-list-collections` over
|
* Should use product name in name (e.g. `firestore-list-collections` over
|
||||||
`list-collections`).
|
`list-collections`).
|
||||||
* Changes to tool kind are breaking changes and should be avoided.
|
* Changes to tool type are breaking changes and should be avoided.
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
|
|||||||
42
README.md
42
README.md
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
# MCP Toolbox for Databases
|
# MCP Toolbox for Databases
|
||||||
|
|
||||||
|
<a href="https://trendshift.io/repositories/13019" target="_blank"><img src="https://trendshift.io/api/badge/repositories/13019" alt="googleapis%2Fgenai-toolbox | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||||
|
|
||||||
[](https://googleapis.github.io/genai-toolbox/)
|
[](https://googleapis.github.io/genai-toolbox/)
|
||||||
[](https://discord.gg/Dmm69peqjh)
|
[](https://discord.gg/Dmm69peqjh)
|
||||||
[](https://medium.com/@mcp_toolbox)
|
[](https://medium.com/@mcp_toolbox)
|
||||||
@@ -105,7 +107,7 @@ redeploying your application.
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
### (Non-production) Running Toolbox
|
### Quickstart: Running Toolbox using NPX
|
||||||
|
|
||||||
You can run Toolbox directly with a [configuration file](#configuration):
|
You can run Toolbox directly with a [configuration file](#configuration):
|
||||||
|
|
||||||
@@ -938,14 +940,14 @@ Toolbox should have access to. Most tools will have at least one source to
|
|||||||
execute against.
|
execute against.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-pg-source:
|
name: my-pg-source
|
||||||
kind: postgres
|
type: postgres
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 5432
|
port: 5432
|
||||||
database: toolbox_db
|
database: toolbox_db
|
||||||
user: toolbox_user
|
user: toolbox_user
|
||||||
password: my-password
|
password: my-password
|
||||||
```
|
```
|
||||||
|
|
||||||
For more details on configuring different types of sources, see the
|
For more details on configuring different types of sources, see the
|
||||||
@@ -954,19 +956,19 @@ For more details on configuring different types of sources, see the
|
|||||||
### Tools
|
### Tools
|
||||||
|
|
||||||
The `tools` section of a `tools.yaml` define the actions an agent can take: what
|
The `tools` section of a `tools.yaml` define the actions an agent can take: what
|
||||||
kind of tool it is, which source(s) it affects, what parameters it uses, etc.
|
type of tool it is, which source(s) it affects, what parameters it uses, etc.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
search-hotels-by-name:
|
name: search-hotels-by-name
|
||||||
kind: postgres-sql
|
type: postgres-sql
|
||||||
source: my-pg-source
|
source: my-pg-source
|
||||||
description: Search for hotels based on name.
|
description: Search for hotels based on name.
|
||||||
parameters:
|
parameters:
|
||||||
- name: name
|
- name: name
|
||||||
type: string
|
type: string
|
||||||
description: The name of the hotel.
|
description: The name of the hotel.
|
||||||
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
||||||
```
|
```
|
||||||
|
|
||||||
For more details on configuring different types of tools, see the
|
For more details on configuring different types of tools, see the
|
||||||
|
|||||||
131
cmd/invoke_tool_test.go
Normal file
131
cmd/invoke_tool_test.go
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
// Copyright 2026 Google LLC
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestInvokeTool(t *testing.T) {
|
||||||
|
// Create a temporary tools file
|
||||||
|
tmpDir := t.TempDir()
|
||||||
|
|
||||||
|
toolsFileContent := `
|
||||||
|
sources:
|
||||||
|
my-sqlite:
|
||||||
|
kind: sqlite
|
||||||
|
database: test.db
|
||||||
|
tools:
|
||||||
|
hello-sqlite:
|
||||||
|
kind: sqlite-sql
|
||||||
|
source: my-sqlite
|
||||||
|
description: "hello tool"
|
||||||
|
statement: "SELECT 'hello' as greeting"
|
||||||
|
echo-tool:
|
||||||
|
kind: sqlite-sql
|
||||||
|
source: my-sqlite
|
||||||
|
description: "echo tool"
|
||||||
|
statement: "SELECT ? as msg"
|
||||||
|
parameters:
|
||||||
|
- name: message
|
||||||
|
type: string
|
||||||
|
description: message to echo
|
||||||
|
`
|
||||||
|
|
||||||
|
toolsFilePath := filepath.Join(tmpDir, "tools.yaml")
|
||||||
|
if err := os.WriteFile(toolsFilePath, []byte(toolsFileContent), 0644); err != nil {
|
||||||
|
t.Fatalf("failed to write tools file: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
tcs := []struct {
|
||||||
|
desc string
|
||||||
|
args []string
|
||||||
|
want string
|
||||||
|
wantErr bool
|
||||||
|
errStr string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
desc: "success - basic tool call",
|
||||||
|
args: []string{"invoke", "hello-sqlite", "--tools-file", toolsFilePath},
|
||||||
|
want: `"greeting": "hello"`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc: "success - tool call with parameters",
|
||||||
|
args: []string{"invoke", "echo-tool", `{"message": "world"}`, "--tools-file", toolsFilePath},
|
||||||
|
want: `"msg": "world"`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc: "error - tool not found",
|
||||||
|
args: []string{"invoke", "non-existent", "--tools-file", toolsFilePath},
|
||||||
|
wantErr: true,
|
||||||
|
errStr: `tool "non-existent" not found`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc: "error - invalid JSON params",
|
||||||
|
args: []string{"invoke", "echo-tool", `invalid-json`, "--tools-file", toolsFilePath},
|
||||||
|
wantErr: true,
|
||||||
|
errStr: `params must be a valid JSON string`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range tcs {
|
||||||
|
t.Run(tc.desc, func(t *testing.T) {
|
||||||
|
_, got, err := invokeCommandWithContext(context.Background(), tc.args)
|
||||||
|
if (err != nil) != tc.wantErr {
|
||||||
|
t.Fatalf("got error %v, wantErr %v", err, tc.wantErr)
|
||||||
|
}
|
||||||
|
if tc.wantErr && !strings.Contains(err.Error(), tc.errStr) {
|
||||||
|
t.Fatalf("got error %v, want error containing %q", err, tc.errStr)
|
||||||
|
}
|
||||||
|
if !tc.wantErr && !strings.Contains(got, tc.want) {
|
||||||
|
t.Fatalf("got %q, want it to contain %q", got, tc.want)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestInvokeTool_AuthUnsupported(t *testing.T) {
|
||||||
|
tmpDir := t.TempDir()
|
||||||
|
toolsFileContent := `
|
||||||
|
sources:
|
||||||
|
my-bq:
|
||||||
|
kind: bigquery
|
||||||
|
project: my-project
|
||||||
|
useClientOAuth: true
|
||||||
|
tools:
|
||||||
|
bq-tool:
|
||||||
|
kind: bigquery-sql
|
||||||
|
source: my-bq
|
||||||
|
description: "bq tool"
|
||||||
|
statement: "SELECT 1"
|
||||||
|
`
|
||||||
|
toolsFilePath := filepath.Join(tmpDir, "auth_tools.yaml")
|
||||||
|
if err := os.WriteFile(toolsFilePath, []byte(toolsFileContent), 0644); err != nil {
|
||||||
|
t.Fatalf("failed to write tools file: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
args := []string{"invoke", "bq-tool", "--tools-file", toolsFilePath}
|
||||||
|
_, _, err := invokeCommandWithContext(context.Background(), args)
|
||||||
|
if err == nil {
|
||||||
|
t.Fatal("expected error for tool requiring client auth, but got nil")
|
||||||
|
}
|
||||||
|
if !strings.Contains(err.Error(), "client authorization is not supported") {
|
||||||
|
t.Fatalf("unexpected error message: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
369
cmd/root.go
369
cmd/root.go
@@ -15,6 +15,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -33,6 +34,7 @@ import (
|
|||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
yaml "github.com/goccy/go-yaml"
|
yaml "github.com/goccy/go-yaml"
|
||||||
"github.com/googleapis/genai-toolbox/internal/auth"
|
"github.com/googleapis/genai-toolbox/internal/auth"
|
||||||
|
"github.com/googleapis/genai-toolbox/internal/cli/invoke"
|
||||||
"github.com/googleapis/genai-toolbox/internal/embeddingmodels"
|
"github.com/googleapis/genai-toolbox/internal/embeddingmodels"
|
||||||
"github.com/googleapis/genai-toolbox/internal/log"
|
"github.com/googleapis/genai-toolbox/internal/log"
|
||||||
"github.com/googleapis/genai-toolbox/internal/prebuiltconfigs"
|
"github.com/googleapis/genai-toolbox/internal/prebuiltconfigs"
|
||||||
@@ -90,6 +92,9 @@ import (
|
|||||||
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudhealthcare/cloudhealthcaresearchdicominstances"
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudhealthcare/cloudhealthcaresearchdicominstances"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudhealthcare/cloudhealthcaresearchdicomseries"
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudhealthcare/cloudhealthcaresearchdicomseries"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudhealthcare/cloudhealthcaresearchdicomstudies"
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudhealthcare/cloudhealthcaresearchdicomstudies"
|
||||||
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudloggingadmin/cloudloggingadminlistlognames"
|
||||||
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudloggingadmin/cloudloggingadminlistresourcetypes"
|
||||||
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudloggingadmin/cloudloggingadminquerylogs"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudmonitoring"
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudmonitoring"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudsql/cloudsqlcloneinstance"
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudsql/cloudsqlcloneinstance"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudsql/cloudsqlcreatebackup"
|
_ "github.com/googleapis/genai-toolbox/internal/tools/cloudsql/cloudsqlcreatebackup"
|
||||||
@@ -243,6 +248,7 @@ import (
|
|||||||
_ "github.com/googleapis/genai-toolbox/internal/sources/clickhouse"
|
_ "github.com/googleapis/genai-toolbox/internal/sources/clickhouse"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudgda"
|
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudgda"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudhealthcare"
|
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudhealthcare"
|
||||||
|
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudloggingadmin"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudmonitoring"
|
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudmonitoring"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudsqladmin"
|
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudsqladmin"
|
||||||
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudsqlmssql"
|
_ "github.com/googleapis/genai-toolbox/internal/sources/cloudsqlmssql"
|
||||||
@@ -360,43 +366,47 @@ func NewCommand(opts ...Option) *Command {
|
|||||||
baseCmd.SetErr(cmd.errStream)
|
baseCmd.SetErr(cmd.errStream)
|
||||||
|
|
||||||
flags := cmd.Flags()
|
flags := cmd.Flags()
|
||||||
|
persistentFlags := cmd.PersistentFlags()
|
||||||
|
|
||||||
flags.StringVarP(&cmd.cfg.Address, "address", "a", "127.0.0.1", "Address of the interface the server will listen on.")
|
flags.StringVarP(&cmd.cfg.Address, "address", "a", "127.0.0.1", "Address of the interface the server will listen on.")
|
||||||
flags.IntVarP(&cmd.cfg.Port, "port", "p", 5000, "Port the server will listen on.")
|
flags.IntVarP(&cmd.cfg.Port, "port", "p", 5000, "Port the server will listen on.")
|
||||||
|
|
||||||
flags.StringVar(&cmd.tools_file, "tools_file", "", "File path specifying the tool configuration. Cannot be used with --tools-files, or --tools-folder.")
|
flags.StringVar(&cmd.tools_file, "tools_file", "", "File path specifying the tool configuration. Cannot be used with --tools-files, or --tools-folder.")
|
||||||
// deprecate tools_file
|
// deprecate tools_file
|
||||||
_ = flags.MarkDeprecated("tools_file", "please use --tools-file instead")
|
_ = flags.MarkDeprecated("tools_file", "please use --tools-file instead")
|
||||||
flags.StringVar(&cmd.tools_file, "tools-file", "", "File path specifying the tool configuration. Cannot be used with --tools-files, or --tools-folder.")
|
persistentFlags.StringVar(&cmd.tools_file, "tools-file", "", "File path specifying the tool configuration. Cannot be used with --tools-files, or --tools-folder.")
|
||||||
flags.StringSliceVar(&cmd.tools_files, "tools-files", []string{}, "Multiple file paths specifying tool configurations. Files will be merged. Cannot be used with --tools-file, or --tools-folder.")
|
persistentFlags.StringSliceVar(&cmd.tools_files, "tools-files", []string{}, "Multiple file paths specifying tool configurations. Files will be merged. Cannot be used with --tools-file, or --tools-folder.")
|
||||||
flags.StringVar(&cmd.tools_folder, "tools-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --tools-file, or --tools-files.")
|
persistentFlags.StringVar(&cmd.tools_folder, "tools-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --tools-file, or --tools-files.")
|
||||||
flags.Var(&cmd.cfg.LogLevel, "log-level", "Specify the minimum level logged. Allowed: 'DEBUG', 'INFO', 'WARN', 'ERROR'.")
|
persistentFlags.Var(&cmd.cfg.LogLevel, "log-level", "Specify the minimum level logged. Allowed: 'DEBUG', 'INFO', 'WARN', 'ERROR'.")
|
||||||
flags.Var(&cmd.cfg.LoggingFormat, "logging-format", "Specify logging format to use. Allowed: 'standard' or 'JSON'.")
|
persistentFlags.Var(&cmd.cfg.LoggingFormat, "logging-format", "Specify logging format to use. Allowed: 'standard' or 'JSON'.")
|
||||||
flags.BoolVar(&cmd.cfg.TelemetryGCP, "telemetry-gcp", false, "Enable exporting directly to Google Cloud Monitoring.")
|
persistentFlags.BoolVar(&cmd.cfg.TelemetryGCP, "telemetry-gcp", false, "Enable exporting directly to Google Cloud Monitoring.")
|
||||||
flags.StringVar(&cmd.cfg.TelemetryOTLP, "telemetry-otlp", "", "Enable exporting using OpenTelemetry Protocol (OTLP) to the specified endpoint (e.g. 'http://127.0.0.1:4318')")
|
persistentFlags.StringVar(&cmd.cfg.TelemetryOTLP, "telemetry-otlp", "", "Enable exporting using OpenTelemetry Protocol (OTLP) to the specified endpoint (e.g. 'http://127.0.0.1:4318')")
|
||||||
flags.StringVar(&cmd.cfg.TelemetryServiceName, "telemetry-service-name", "toolbox", "Sets the value of the service.name resource attribute for telemetry data.")
|
persistentFlags.StringVar(&cmd.cfg.TelemetryServiceName, "telemetry-service-name", "toolbox", "Sets the value of the service.name resource attribute for telemetry data.")
|
||||||
// Fetch prebuilt tools sources to customize the help description
|
// Fetch prebuilt tools sources to customize the help description
|
||||||
prebuiltHelp := fmt.Sprintf(
|
prebuiltHelp := fmt.Sprintf(
|
||||||
"Use a prebuilt tool configuration by source type. Allowed: '%s'. Can be specified multiple times.",
|
"Use a prebuilt tool configuration by source type. Allowed: '%s'. Can be specified multiple times.",
|
||||||
strings.Join(prebuiltconfigs.GetPrebuiltSources(), "', '"),
|
strings.Join(prebuiltconfigs.GetPrebuiltSources(), "', '"),
|
||||||
)
|
)
|
||||||
flags.StringSliceVar(&cmd.prebuiltConfigs, "prebuilt", []string{}, prebuiltHelp)
|
persistentFlags.StringSliceVar(&cmd.prebuiltConfigs, "prebuilt", []string{}, prebuiltHelp)
|
||||||
flags.BoolVar(&cmd.cfg.Stdio, "stdio", false, "Listens via MCP STDIO instead of acting as a remote HTTP server.")
|
flags.BoolVar(&cmd.cfg.Stdio, "stdio", false, "Listens via MCP STDIO instead of acting as a remote HTTP server.")
|
||||||
flags.BoolVar(&cmd.cfg.DisableReload, "disable-reload", false, "Disables dynamic reloading of tools file.")
|
flags.BoolVar(&cmd.cfg.DisableReload, "disable-reload", false, "Disables dynamic reloading of tools file.")
|
||||||
flags.BoolVar(&cmd.cfg.UI, "ui", false, "Launches the Toolbox UI web server.")
|
flags.BoolVar(&cmd.cfg.UI, "ui", false, "Launches the Toolbox UI web server.")
|
||||||
// TODO: Insecure by default. Might consider updating this for v1.0.0
|
// TODO: Insecure by default. Might consider updating this for v1.0.0
|
||||||
flags.StringSliceVar(&cmd.cfg.AllowedOrigins, "allowed-origins", []string{"*"}, "Specifies a list of origins permitted to access this server. Defaults to '*'.")
|
flags.StringSliceVar(&cmd.cfg.AllowedOrigins, "allowed-origins", []string{"*"}, "Specifies a list of origins permitted to access this server. Defaults to '*'.")
|
||||||
flags.StringSliceVar(&cmd.cfg.AllowedHosts, "allowed-hosts", []string{"*"}, "Specifies a list of hosts permitted to access this server. Defaults to '*'.")
|
flags.StringSliceVar(&cmd.cfg.AllowedHosts, "allowed-hosts", []string{"*"}, "Specifies a list of hosts permitted to access this server. Defaults to '*'.")
|
||||||
flags.StringSliceVar(&cmd.cfg.UserAgentMetadata, "user-agent-metadata", []string{}, "Appends additional metadata to the User-Agent.")
|
persistentFlags.StringSliceVar(&cmd.cfg.UserAgentMetadata, "user-agent-metadata", []string{}, "Appends additional metadata to the User-Agent.")
|
||||||
|
|
||||||
// wrap RunE command so that we have access to original Command object
|
// wrap RunE command so that we have access to original Command object
|
||||||
cmd.RunE = func(*cobra.Command, []string) error { return run(cmd) }
|
cmd.RunE = func(*cobra.Command, []string) error { return run(cmd) }
|
||||||
|
|
||||||
|
// Register subcommands for tool invocation
|
||||||
|
baseCmd.AddCommand(invoke.NewCommand(cmd))
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
type ToolsFile struct {
|
type ToolsFile struct {
|
||||||
Sources server.SourceConfigs `yaml:"sources"`
|
Sources server.SourceConfigs `yaml:"sources"`
|
||||||
AuthSources server.AuthServiceConfigs `yaml:"authSources"` // Deprecated: Kept for compatibility.
|
|
||||||
AuthServices server.AuthServiceConfigs `yaml:"authServices"`
|
AuthServices server.AuthServiceConfigs `yaml:"authServices"`
|
||||||
EmbeddingModels server.EmbeddingModelConfigs `yaml:"embeddingModels"`
|
EmbeddingModels server.EmbeddingModelConfigs `yaml:"embeddingModels"`
|
||||||
Tools server.ToolConfigs `yaml:"tools"`
|
Tools server.ToolConfigs `yaml:"tools"`
|
||||||
@@ -427,6 +437,129 @@ func parseEnv(input string) (string, error) {
|
|||||||
return output, err
|
return output, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func convertToolsFile(raw []byte) ([]byte, error) {
|
||||||
|
var input yaml.MapSlice
|
||||||
|
decoder := yaml.NewDecoder(bytes.NewReader(raw), yaml.UseOrderedMap())
|
||||||
|
|
||||||
|
// convert to tools file v2
|
||||||
|
var buf bytes.Buffer
|
||||||
|
encoder := yaml.NewEncoder(&buf)
|
||||||
|
|
||||||
|
v1keys := []string{"sources", "authSources", "authServices", "embeddingModels", "tools", "toolsets", "prompts"}
|
||||||
|
for {
|
||||||
|
if err := decoder.Decode(&input); err != nil {
|
||||||
|
if err == io.EOF {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for _, item := range input {
|
||||||
|
key, ok := item.Key.(string)
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("unexpected non-string key in input: %v", item.Key)
|
||||||
|
}
|
||||||
|
// check if the key is config file v1's key
|
||||||
|
if slices.Contains(v1keys, key) {
|
||||||
|
// check if value conversion to yaml.MapSlice successfully
|
||||||
|
// fields such as "tools" in toolsets might pass the first check but
|
||||||
|
// fail to convert to MapSlice
|
||||||
|
if slice, ok := item.Value.(yaml.MapSlice); ok {
|
||||||
|
// Deprecated: convert authSources to authServices
|
||||||
|
if key == "authSources" {
|
||||||
|
key = "authServices"
|
||||||
|
}
|
||||||
|
transformed, err := transformDocs(key, slice)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// encode per-doc
|
||||||
|
for _, doc := range transformed {
|
||||||
|
if err := encoder.Encode(doc); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// invalid input will be ignored
|
||||||
|
// we don't want to throw error here since the config could
|
||||||
|
// be valid but with a different order such as:
|
||||||
|
// ---
|
||||||
|
// tools:
|
||||||
|
// - tool_a
|
||||||
|
// kind: toolsets
|
||||||
|
// ---
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// this doc is already v2, encode to buf
|
||||||
|
if err := encoder.Encode(input); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return buf.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// transformDocs transforms the configuration file from v1 format to v2
|
||||||
|
// yaml.MapSlice will preserve the order in a map
|
||||||
|
func transformDocs(kind string, input yaml.MapSlice) ([]yaml.MapSlice, error) {
|
||||||
|
var transformed []yaml.MapSlice
|
||||||
|
for _, entry := range input {
|
||||||
|
entryName, ok := entry.Key.(string)
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("unexpected non-string key for entry in '%s': %v", kind, entry.Key)
|
||||||
|
}
|
||||||
|
entryBody := ProcessValue(entry.Value, kind == "toolsets")
|
||||||
|
|
||||||
|
currentTransformed := yaml.MapSlice{
|
||||||
|
{Key: "kind", Value: kind},
|
||||||
|
{Key: "name", Value: entryName},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Merge the transformed body into our result
|
||||||
|
if bodySlice, ok := entryBody.(yaml.MapSlice); ok {
|
||||||
|
currentTransformed = append(currentTransformed, bodySlice...)
|
||||||
|
} else {
|
||||||
|
return nil, fmt.Errorf("unable to convert entryBody to MapSlice")
|
||||||
|
}
|
||||||
|
transformed = append(transformed, currentTransformed)
|
||||||
|
}
|
||||||
|
return transformed, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProcessValue recursively looks for MapSlices to rename 'kind' -> 'type'
|
||||||
|
func ProcessValue(v any, isToolset bool) any {
|
||||||
|
switch val := v.(type) {
|
||||||
|
case yaml.MapSlice:
|
||||||
|
// creating a new MapSlice is safer for recursive transformation
|
||||||
|
newVal := make(yaml.MapSlice, len(val))
|
||||||
|
for i, item := range val {
|
||||||
|
// Perform renaming
|
||||||
|
if item.Key == "kind" {
|
||||||
|
item.Key = "type"
|
||||||
|
}
|
||||||
|
// Recursive call for nested values (e.g., nested objects or lists)
|
||||||
|
item.Value = ProcessValue(item.Value, false)
|
||||||
|
newVal[i] = item
|
||||||
|
}
|
||||||
|
return newVal
|
||||||
|
case []any:
|
||||||
|
// Process lists: If it's a toolset top-level list, wrap it.
|
||||||
|
if isToolset {
|
||||||
|
return yaml.MapSlice{{Key: "tools", Value: val}}
|
||||||
|
}
|
||||||
|
// Otherwise, recurse into list items (to catch nested objects)
|
||||||
|
newVal := make([]any, len(val))
|
||||||
|
for i := range val {
|
||||||
|
newVal[i] = ProcessValue(val[i], false)
|
||||||
|
}
|
||||||
|
return newVal
|
||||||
|
default:
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// parseToolsFile parses the provided yaml into appropriate configs.
|
// parseToolsFile parses the provided yaml into appropriate configs.
|
||||||
func parseToolsFile(ctx context.Context, raw []byte) (ToolsFile, error) {
|
func parseToolsFile(ctx context.Context, raw []byte) (ToolsFile, error) {
|
||||||
var toolsFile ToolsFile
|
var toolsFile ToolsFile
|
||||||
@@ -437,8 +570,13 @@ func parseToolsFile(ctx context.Context, raw []byte) (ToolsFile, error) {
|
|||||||
}
|
}
|
||||||
raw = []byte(output)
|
raw = []byte(output)
|
||||||
|
|
||||||
|
raw, err = convertToolsFile(raw)
|
||||||
|
if err != nil {
|
||||||
|
return toolsFile, fmt.Errorf("error converting tools file: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Parse contents
|
// Parse contents
|
||||||
err = yaml.UnmarshalContext(ctx, raw, &toolsFile, yaml.Strict())
|
toolsFile.Sources, toolsFile.AuthServices, toolsFile.EmbeddingModels, toolsFile.Tools, toolsFile.Toolsets, toolsFile.Prompts, err = server.UnmarshalResourceConfig(ctx, raw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return toolsFile, err
|
return toolsFile, err
|
||||||
}
|
}
|
||||||
@@ -470,18 +608,6 @@ func mergeToolsFiles(files ...ToolsFile) (ToolsFile, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for conflicts and merge authSources (deprecated, but still support)
|
|
||||||
for name, authSource := range file.AuthSources {
|
|
||||||
if _, exists := merged.AuthSources[name]; exists {
|
|
||||||
conflicts = append(conflicts, fmt.Sprintf("authSource '%s' (file #%d)", name, fileIndex+1))
|
|
||||||
} else {
|
|
||||||
if merged.AuthSources == nil {
|
|
||||||
merged.AuthSources = make(server.AuthServiceConfigs)
|
|
||||||
}
|
|
||||||
merged.AuthSources[name] = authSource
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for conflicts and merge authServices
|
// Check for conflicts and merge authServices
|
||||||
for name, authService := range file.AuthServices {
|
for name, authService := range file.AuthServices {
|
||||||
if _, exists := merged.AuthServices[name]; exists {
|
if _, exists := merged.AuthServices[name]; exists {
|
||||||
@@ -799,70 +925,23 @@ func resolveWatcherInputs(toolsFile string, toolsFiles []string, toolsFolder str
|
|||||||
return watchDirs, watchedFiles
|
return watchDirs, watchedFiles
|
||||||
}
|
}
|
||||||
|
|
||||||
func run(cmd *Command) error {
|
func (cmd *Command) Config() server.ServerConfig {
|
||||||
ctx, cancel := context.WithCancel(cmd.Context())
|
return cmd.cfg
|
||||||
defer cancel()
|
}
|
||||||
|
|
||||||
// watch for sigterm / sigint signals
|
func (cmd *Command) Out() io.Writer {
|
||||||
signals := make(chan os.Signal, 1)
|
return cmd.outStream
|
||||||
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT)
|
}
|
||||||
go func(sCtx context.Context) {
|
|
||||||
var s os.Signal
|
|
||||||
select {
|
|
||||||
case <-sCtx.Done():
|
|
||||||
// this should only happen when the context supplied when testing is canceled
|
|
||||||
return
|
|
||||||
case s = <-signals:
|
|
||||||
}
|
|
||||||
switch s {
|
|
||||||
case syscall.SIGINT:
|
|
||||||
cmd.logger.DebugContext(sCtx, "Received SIGINT signal to shutdown.")
|
|
||||||
case syscall.SIGTERM:
|
|
||||||
cmd.logger.DebugContext(sCtx, "Sending SIGTERM signal to shutdown.")
|
|
||||||
}
|
|
||||||
cancel()
|
|
||||||
}(ctx)
|
|
||||||
|
|
||||||
// If stdio, set logger's out stream (usually DEBUG and INFO logs) to errStream
|
func (cmd *Command) Logger() log.Logger {
|
||||||
loggerOut := cmd.outStream
|
return cmd.logger
|
||||||
if cmd.cfg.Stdio {
|
}
|
||||||
loggerOut = cmd.errStream
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle logger separately from config
|
func (cmd *Command) LoadConfig(ctx context.Context) error {
|
||||||
switch strings.ToLower(cmd.cfg.LoggingFormat.String()) {
|
logger, err := util.LoggerFromContext(ctx)
|
||||||
case "json":
|
|
||||||
logger, err := log.NewStructuredLogger(loggerOut, cmd.errStream, cmd.cfg.LogLevel.String())
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("unable to initialize logger: %w", err)
|
|
||||||
}
|
|
||||||
cmd.logger = logger
|
|
||||||
case "standard":
|
|
||||||
logger, err := log.NewStdLogger(loggerOut, cmd.errStream, cmd.cfg.LogLevel.String())
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("unable to initialize logger: %w", err)
|
|
||||||
}
|
|
||||||
cmd.logger = logger
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("logging format invalid")
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx = util.WithLogger(ctx, cmd.logger)
|
|
||||||
|
|
||||||
// Set up OpenTelemetry
|
|
||||||
otelShutdown, err := telemetry.SetupOTel(ctx, cmd.cfg.Version, cmd.cfg.TelemetryOTLP, cmd.cfg.TelemetryGCP, cmd.cfg.TelemetryServiceName)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errMsg := fmt.Errorf("error setting up OpenTelemetry: %w", err)
|
return err
|
||||||
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
|
||||||
return errMsg
|
|
||||||
}
|
}
|
||||||
defer func() {
|
|
||||||
err := otelShutdown(ctx)
|
|
||||||
if err != nil {
|
|
||||||
errMsg := fmt.Errorf("error shutting down OpenTelemetry: %w", err)
|
|
||||||
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
var allToolsFiles []ToolsFile
|
var allToolsFiles []ToolsFile
|
||||||
|
|
||||||
@@ -872,23 +951,20 @@ func run(cmd *Command) error {
|
|||||||
slices.Sort(cmd.prebuiltConfigs)
|
slices.Sort(cmd.prebuiltConfigs)
|
||||||
sourcesList := strings.Join(cmd.prebuiltConfigs, ", ")
|
sourcesList := strings.Join(cmd.prebuiltConfigs, ", ")
|
||||||
logMsg := fmt.Sprintf("Using prebuilt tool configurations for: %s", sourcesList)
|
logMsg := fmt.Sprintf("Using prebuilt tool configurations for: %s", sourcesList)
|
||||||
cmd.logger.InfoContext(ctx, logMsg)
|
logger.InfoContext(ctx, logMsg)
|
||||||
|
|
||||||
for _, configName := range cmd.prebuiltConfigs {
|
for _, configName := range cmd.prebuiltConfigs {
|
||||||
buf, err := prebuiltconfigs.Get(configName)
|
buf, err := prebuiltconfigs.Get(configName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.logger.ErrorContext(ctx, err.Error())
|
logger.ErrorContext(ctx, err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update version string
|
|
||||||
cmd.cfg.Version += "+prebuilt." + configName
|
|
||||||
|
|
||||||
// Parse into ToolsFile struct
|
// Parse into ToolsFile struct
|
||||||
parsed, err := parseToolsFile(ctx, buf)
|
parsed, err := parseToolsFile(ctx, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errMsg := fmt.Errorf("unable to parse prebuilt tool configuration for '%s': %w", configName, err)
|
errMsg := fmt.Errorf("unable to parse prebuilt tool configuration for '%s': %w", configName, err)
|
||||||
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
logger.ErrorContext(ctx, errMsg.Error())
|
||||||
return errMsg
|
return errMsg
|
||||||
}
|
}
|
||||||
allToolsFiles = append(allToolsFiles, parsed)
|
allToolsFiles = append(allToolsFiles, parsed)
|
||||||
@@ -914,7 +990,7 @@ func run(cmd *Command) error {
|
|||||||
(cmd.tools_file != "" && cmd.tools_folder != "") ||
|
(cmd.tools_file != "" && cmd.tools_folder != "") ||
|
||||||
(len(cmd.tools_files) > 0 && cmd.tools_folder != "") {
|
(len(cmd.tools_files) > 0 && cmd.tools_folder != "") {
|
||||||
errMsg := fmt.Errorf("--tools-file, --tools-files, and --tools-folder flags cannot be used simultaneously")
|
errMsg := fmt.Errorf("--tools-file, --tools-files, and --tools-folder flags cannot be used simultaneously")
|
||||||
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
logger.ErrorContext(ctx, errMsg.Error())
|
||||||
return errMsg
|
return errMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -923,18 +999,18 @@ func run(cmd *Command) error {
|
|||||||
|
|
||||||
if len(cmd.tools_files) > 0 {
|
if len(cmd.tools_files) > 0 {
|
||||||
// Use tools-files
|
// Use tools-files
|
||||||
cmd.logger.InfoContext(ctx, fmt.Sprintf("Loading and merging %d tool configuration files", len(cmd.tools_files)))
|
logger.InfoContext(ctx, fmt.Sprintf("Loading and merging %d tool configuration files", len(cmd.tools_files)))
|
||||||
customTools, err = loadAndMergeToolsFiles(ctx, cmd.tools_files)
|
customTools, err = loadAndMergeToolsFiles(ctx, cmd.tools_files)
|
||||||
} else if cmd.tools_folder != "" {
|
} else if cmd.tools_folder != "" {
|
||||||
// Use tools-folder
|
// Use tools-folder
|
||||||
cmd.logger.InfoContext(ctx, fmt.Sprintf("Loading and merging all YAML files from directory: %s", cmd.tools_folder))
|
logger.InfoContext(ctx, fmt.Sprintf("Loading and merging all YAML files from directory: %s", cmd.tools_folder))
|
||||||
customTools, err = loadAndMergeToolsFolder(ctx, cmd.tools_folder)
|
customTools, err = loadAndMergeToolsFolder(ctx, cmd.tools_folder)
|
||||||
} else {
|
} else {
|
||||||
// Use single file (tools-file or default `tools.yaml`)
|
// Use single file (tools-file or default `tools.yaml`)
|
||||||
buf, readFileErr := os.ReadFile(cmd.tools_file)
|
buf, readFileErr := os.ReadFile(cmd.tools_file)
|
||||||
if readFileErr != nil {
|
if readFileErr != nil {
|
||||||
errMsg := fmt.Errorf("unable to read tool file at %q: %w", cmd.tools_file, readFileErr)
|
errMsg := fmt.Errorf("unable to read tool file at %q: %w", cmd.tools_file, readFileErr)
|
||||||
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
logger.ErrorContext(ctx, errMsg.Error())
|
||||||
return errMsg
|
return errMsg
|
||||||
}
|
}
|
||||||
customTools, err = parseToolsFile(ctx, buf)
|
customTools, err = parseToolsFile(ctx, buf)
|
||||||
@@ -944,17 +1020,29 @@ func run(cmd *Command) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.logger.ErrorContext(ctx, err.Error())
|
logger.ErrorContext(ctx, err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
allToolsFiles = append(allToolsFiles, customTools)
|
allToolsFiles = append(allToolsFiles, customTools)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Modify version string based on loaded configurations
|
||||||
|
if len(cmd.prebuiltConfigs) > 0 {
|
||||||
|
tag := "prebuilt"
|
||||||
|
if isCustomConfigured {
|
||||||
|
tag = "custom"
|
||||||
|
}
|
||||||
|
// cmd.prebuiltConfigs is already sorted above
|
||||||
|
for _, configName := range cmd.prebuiltConfigs {
|
||||||
|
cmd.cfg.Version += fmt.Sprintf("+%s.%s", tag, configName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Merge Everything
|
// Merge Everything
|
||||||
// This will error if custom tools collide with prebuilt tools
|
// This will error if custom tools collide with prebuilt tools
|
||||||
finalToolsFile, err := mergeToolsFiles(allToolsFiles...)
|
finalToolsFile, err := mergeToolsFiles(allToolsFiles...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.logger.ErrorContext(ctx, err.Error())
|
logger.ErrorContext(ctx, err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -965,29 +1053,91 @@ func run(cmd *Command) error {
|
|||||||
cmd.cfg.ToolsetConfigs = finalToolsFile.Toolsets
|
cmd.cfg.ToolsetConfigs = finalToolsFile.Toolsets
|
||||||
cmd.cfg.PromptConfigs = finalToolsFile.Prompts
|
cmd.cfg.PromptConfigs = finalToolsFile.Prompts
|
||||||
|
|
||||||
authSourceConfigs := finalToolsFile.AuthSources
|
return nil
|
||||||
if authSourceConfigs != nil {
|
}
|
||||||
cmd.logger.WarnContext(ctx, "`authSources` is deprecated, use `authServices` instead")
|
|
||||||
|
|
||||||
for k, v := range authSourceConfigs {
|
func (cmd *Command) Setup(ctx context.Context) (context.Context, func(context.Context) error, error) {
|
||||||
if _, exists := cmd.cfg.AuthServiceConfigs[k]; exists {
|
// If stdio, set logger's out stream (usually DEBUG and INFO logs) to errStream
|
||||||
errMsg := fmt.Errorf("resource conflict detected: authSource '%s' has the same name as an existing authService. Please rename your authSource", k)
|
loggerOut := cmd.outStream
|
||||||
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
if cmd.cfg.Stdio {
|
||||||
return errMsg
|
loggerOut = cmd.errStream
|
||||||
}
|
|
||||||
cmd.cfg.AuthServiceConfigs[k] = v
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
instrumentation, err := telemetry.CreateTelemetryInstrumentation(versionString)
|
// Handle logger separately from config
|
||||||
|
logger, err := log.NewLogger(cmd.cfg.LoggingFormat.String(), cmd.cfg.LogLevel.String(), loggerOut, cmd.errStream)
|
||||||
|
if err != nil {
|
||||||
|
return ctx, nil, fmt.Errorf("unable to initialize logger: %w", err)
|
||||||
|
}
|
||||||
|
cmd.logger = logger
|
||||||
|
|
||||||
|
ctx = util.WithLogger(ctx, cmd.logger)
|
||||||
|
|
||||||
|
// Set up OpenTelemetry
|
||||||
|
otelShutdown, err := telemetry.SetupOTel(ctx, cmd.cfg.Version, cmd.cfg.TelemetryOTLP, cmd.cfg.TelemetryGCP, cmd.cfg.TelemetryServiceName)
|
||||||
|
if err != nil {
|
||||||
|
errMsg := fmt.Errorf("error setting up OpenTelemetry: %w", err)
|
||||||
|
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
||||||
|
return ctx, nil, errMsg
|
||||||
|
}
|
||||||
|
|
||||||
|
shutdownFunc := func(ctx context.Context) error {
|
||||||
|
err := otelShutdown(ctx)
|
||||||
|
if err != nil {
|
||||||
|
errMsg := fmt.Errorf("error shutting down OpenTelemetry: %w", err)
|
||||||
|
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
instrumentation, err := telemetry.CreateTelemetryInstrumentation(cmd.cfg.Version)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errMsg := fmt.Errorf("unable to create telemetry instrumentation: %w", err)
|
errMsg := fmt.Errorf("unable to create telemetry instrumentation: %w", err)
|
||||||
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
cmd.logger.ErrorContext(ctx, errMsg.Error())
|
||||||
return errMsg
|
return ctx, shutdownFunc, errMsg
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = util.WithInstrumentation(ctx, instrumentation)
|
ctx = util.WithInstrumentation(ctx, instrumentation)
|
||||||
|
|
||||||
|
return ctx, shutdownFunc, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func run(cmd *Command) error {
|
||||||
|
ctx, cancel := context.WithCancel(cmd.Context())
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
// watch for sigterm / sigint signals
|
||||||
|
signals := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT)
|
||||||
|
go func(sCtx context.Context) {
|
||||||
|
var s os.Signal
|
||||||
|
select {
|
||||||
|
case <-sCtx.Done():
|
||||||
|
// this should only happen when the context supplied when testing is canceled
|
||||||
|
return
|
||||||
|
case s = <-signals:
|
||||||
|
}
|
||||||
|
switch s {
|
||||||
|
case syscall.SIGINT:
|
||||||
|
cmd.logger.DebugContext(sCtx, "Received SIGINT signal to shutdown.")
|
||||||
|
case syscall.SIGTERM:
|
||||||
|
cmd.logger.DebugContext(sCtx, "Sending SIGTERM signal to shutdown.")
|
||||||
|
}
|
||||||
|
cancel()
|
||||||
|
}(ctx)
|
||||||
|
|
||||||
|
ctx, shutdown, err := cmd.Setup(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
_ = shutdown(ctx)
|
||||||
|
}()
|
||||||
|
|
||||||
|
if err := cmd.LoadConfig(ctx); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// start server
|
// start server
|
||||||
s, err := server.NewServer(ctx, cmd.cfg)
|
s, err := server.NewServer(ctx, cmd.cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -1027,6 +1177,9 @@ func run(cmd *Command) error {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine if Custom Files are configured (re-check as loadAndMergeConfig might have updated defaults)
|
||||||
|
isCustomConfigured := cmd.tools_file != "" || len(cmd.tools_files) > 0 || cmd.tools_folder != ""
|
||||||
|
|
||||||
if isCustomConfigured && !cmd.cfg.DisableReload {
|
if isCustomConfigured && !cmd.cfg.DisableReload {
|
||||||
watchDirs, watchedFiles := resolveWatcherInputs(cmd.tools_file, cmd.tools_files, cmd.tools_folder)
|
watchDirs, watchedFiles := resolveWatcherInputs(cmd.tools_file, cmd.tools_files, cmd.tools_folder)
|
||||||
// start watching the file(s) or folder for changes to trigger dynamic reloading
|
// start watching the file(s) or folder for changes to trigger dynamic reloading
|
||||||
|
|||||||
1061
cmd/root_test.go
1061
cmd/root_test.go
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,14 @@ To connect to the database to explore and query data, search the MCP store for t
|
|||||||
|
|
||||||
In the Antigravity MCP Store, click the "Install" button.
|
In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt alloydb-postgres-admin```.
|
||||||
|
|
||||||
You'll now be able to see all enabled tools in the "Tools" tab.
|
You'll now be able to see all enabled tools in the "Tools" tab.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ For AlloyDB infrastructure management, search the MCP store for the AlloyDB for
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the "Install" button.
|
1. In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt alloydb-postgres```.
|
||||||
|
|
||||||
2. Add the required inputs for your [cluster](https://docs.cloud.google.com/alloydb/docs/cluster-list) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
2. Add the required inputs for your [cluster](https://docs.cloud.google.com/alloydb/docs/cluster-list) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ An editor configured to use the BigQuery MCP server can use its AI capabilities
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the "Install" button.
|
1. In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt bigquery```.
|
||||||
|
|
||||||
2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,14 @@ To connect to the database to explore and query data, search the MCP store for t
|
|||||||
|
|
||||||
In the Antigravity MCP Store, click the "Install" button.
|
In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt cloud-sql-mssql-admin```.
|
||||||
|
|
||||||
You'll now be able to see all enabled tools in the "Tools" tab.
|
You'll now be able to see all enabled tools in the "Tools" tab.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the "Install" button.
|
1. In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt cloud-sql-mssql```.
|
||||||
|
|
||||||
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/sqlserver/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/sqlserver/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,14 @@ To connect to the database to explore and query data, search the MCP store for t
|
|||||||
|
|
||||||
In the Antigravity MCP Store, click the "Install" button.
|
In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt cloud-sql-mysql-admin```.
|
||||||
|
|
||||||
You'll now be able to see all enabled tools in the "Tools" tab.
|
You'll now be able to see all enabled tools in the "Tools" tab.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
|
|||||||
@@ -26,6 +26,13 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the "Install" button.
|
1. In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt cloud-sql-mysql```.
|
||||||
|
|
||||||
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/mysql/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/mysql/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,14 @@ To connect to the database to explore and query data, search the MCP store for t
|
|||||||
|
|
||||||
In the Antigravity MCP Store, click the "Install" button.
|
In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt cloud-sql-postgres-admin```.
|
||||||
|
|
||||||
You'll now be able to see all enabled tools in the "Tools" tab.
|
You'll now be able to see all enabled tools in the "Tools" tab.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
|
|||||||
@@ -26,6 +26,13 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the "Install" button.
|
1. In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt cloud-sql-postgres```.
|
||||||
|
|
||||||
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/postgres/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/postgres/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ An editor configured to use the Dataplex MCP server can use its AI capabilities
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the "Install" button.
|
1. In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt dataplex```.
|
||||||
|
|
||||||
2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ An editor configured to use the Looker MCP server can use its AI capabilities to
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the "Install" button.
|
1. In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt looker```.
|
||||||
|
|
||||||
2. Add the required inputs for your [instance](https://docs.cloud.google.com/looker/docs/set-up-and-administer-looker) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
2. Add the required inputs for your [instance](https://docs.cloud.google.com/looker/docs/set-up-and-administer-looker) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ An editor configured to use the Cloud Spanner MCP server can use its AI capabili
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the "Install" button.
|
1. In the Antigravity MCP Store, click the "Install" button.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest --prebuilt spanner```.
|
||||||
|
|
||||||
2. Add the required inputs for your [instance](https://docs.cloud.google.com/spanner/docs/instances) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
2. Add the required inputs for your [instance](https://docs.cloud.google.com/spanner/docs/instances) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,17 @@ The MCP Toolbox for Databases Server gives AI-powered development tools the abil
|
|||||||
## Install & Configuration
|
## Install & Configuration
|
||||||
|
|
||||||
1. In the Antigravity MCP Store, click the **Install** button. A configuration window will appear.
|
1. In the Antigravity MCP Store, click the **Install** button. A configuration window will appear.
|
||||||
|
> [!NOTE]
|
||||||
|
> On first use, the installation process automatically downloads and uses
|
||||||
|
> [MCP Toolbox](https://www.npmjs.com/package/@toolbox-sdk/server)
|
||||||
|
> `>=0.26.0`. To update MCP Toolbox, use:
|
||||||
|
> ```npm i -g @toolbox-sdk/server@latest```
|
||||||
|
> To always run the latest version, update the MCP server configuration to use:
|
||||||
|
> ```npx -y @toolbox-sdk/server@latest```.
|
||||||
|
|
||||||
2. Create your [`tools.yaml` configuration file](https://googleapis.github.io/genai-toolbox/getting-started/configure/).
|
3. Create your [`tools.yaml` configuration file](https://googleapis.github.io/genai-toolbox/getting-started/configure/).
|
||||||
|
|
||||||
3. In the configuration window, enter the full absolute path to your `tools.yaml` file and click **Save**.
|
4. In the configuration window, enter the full absolute path to your `tools.yaml` file and click **Save**.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> If you encounter issues with Windows Defender blocking the execution, you may need to configure an allowlist. See [Configure exclusions for Microsoft Defender Antivirus](https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-exclusions-microsoft-defender-antivirus?view=o365-worldwide) for more details.
|
> If you encounter issues with Windows Defender blocking the execution, you may need to configure an allowlist. See [Configure exclusions for Microsoft Defender Antivirus](https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-exclusions-microsoft-defender-antivirus?view=o365-worldwide) for more details.
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ most popular issues, so make sure to +1 ones you are the most interested in.
|
|||||||
## Can Toolbox be used for non-database tools?
|
## Can Toolbox be used for non-database tools?
|
||||||
|
|
||||||
**Yes!** While Toolbox is primarily focused on databases, it also supports generic
|
**Yes!** While Toolbox is primarily focused on databases, it also supports generic
|
||||||
**HTTP tools** (`kind: http`). These allow you to connect your agents to REST APIs
|
**HTTP tools** (`type: http`). These allow you to connect your agents to REST APIs
|
||||||
and other web services, enabling workflows that extend beyond database interactions.
|
and other web services, enabling workflows that extend beyond database interactions.
|
||||||
|
|
||||||
For configuration details, see the [HTTP Tools documentation](../resources/tools/http/http.md).
|
For configuration details, see the [HTTP Tools documentation](../resources/tools/http/http.md).
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ The structured logging outputs log as JSON:
|
|||||||
"timestamp":"2024-11-04T16:45:11.987299-08:00",
|
"timestamp":"2024-11-04T16:45:11.987299-08:00",
|
||||||
"severity":"ERROR",
|
"severity":"ERROR",
|
||||||
"logging.googleapis.com/sourceLocation":{...},
|
"logging.googleapis.com/sourceLocation":{...},
|
||||||
"message":"unable to parse tool file at \"tools.yaml\": \"cloud-sql-postgres1\" is not a valid kind of data source"
|
"message":"unable to parse tool file at \"tools.yaml\": \"cloud-sql-postgres1\" is not a valid type of data source"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -300,78 +300,89 @@
|
|||||||
"# You can also upload a tools file and use that to run toolbox.\n",
|
"# You can also upload a tools file and use that to run toolbox.\n",
|
||||||
"tools_file_name = \"tools.yml\"\n",
|
"tools_file_name = \"tools.yml\"\n",
|
||||||
"file_content = f\"\"\"\n",
|
"file_content = f\"\"\"\n",
|
||||||
"sources:\n",
|
"kind: sources\n",
|
||||||
" my-pg-source:\n",
|
"name: my-pg-source\n",
|
||||||
" kind: postgres\n",
|
"type: postgres\n",
|
||||||
" host: 127.0.0.1\n",
|
"host: 127.0.0.1\n",
|
||||||
" port: 5432\n",
|
"port: 5432\n",
|
||||||
" database: toolbox_db\n",
|
"database: toolbox_db\n",
|
||||||
" user: toolbox_user\n",
|
"user: toolbox_user\n",
|
||||||
" password: my-password\n",
|
"password: my-password\n",
|
||||||
|
"---\n",
|
||||||
|
"kind: tools\n",
|
||||||
|
"name: search-hotels-by-name\n",
|
||||||
|
"type: postgres-sql\n",
|
||||||
|
"source: my-pg-source\n",
|
||||||
|
"description: Search for hotels based on name.\n",
|
||||||
|
"parameters:\n",
|
||||||
|
" - name: name\n",
|
||||||
|
" type: string\n",
|
||||||
|
" description: The name of the hotel.\n",
|
||||||
|
"statement: SELECT * FROM hotels WHERE name ILIKE '%' || \\$1 || '%';\n",
|
||||||
|
"---\n",
|
||||||
|
"kind: tools\n",
|
||||||
|
"name: search-hotels-by-location\n",
|
||||||
|
"type: postgres-sql\n",
|
||||||
|
"source: my-pg-source\n",
|
||||||
|
"description: Search for hotels based on location.\n",
|
||||||
|
"parameters:\n",
|
||||||
|
" - name: location\n",
|
||||||
|
" type: string\n",
|
||||||
|
" description: The location of the hotel.\n",
|
||||||
|
"statement: SELECT * FROM hotels WHERE location ILIKE '%' || \\$1 || '%';\n",
|
||||||
|
"---\n",
|
||||||
|
"kind: tools\n",
|
||||||
|
"name: book-hotel\n",
|
||||||
|
"type: postgres-sql\n",
|
||||||
|
"source: my-pg-source\n",
|
||||||
|
"description: >-\n",
|
||||||
|
" Book a hotel by its ID. If the hotel is successfully booked, returns a NULL, raises an error if not.\n",
|
||||||
|
"parameters:\n",
|
||||||
|
" - name: hotel_id\n",
|
||||||
|
" type: string\n",
|
||||||
|
" description: The ID of the hotel to book.\n",
|
||||||
|
"statement: UPDATE hotels SET booked = B'1' WHERE id = \\$1;\n",
|
||||||
|
"---\n",
|
||||||
|
"kind: tools\n",
|
||||||
|
"name: update-hotel\n",
|
||||||
|
"type: postgres-sql\n",
|
||||||
|
"source: my-pg-source\n",
|
||||||
|
"description: >-\n",
|
||||||
|
" Update a hotel's check-in and check-out dates by its ID. Returns a message\n",
|
||||||
|
" indicating whether the hotel was successfully updated or not.\n",
|
||||||
|
"parameters:\n",
|
||||||
|
" - name: hotel_id\n",
|
||||||
|
" type: string\n",
|
||||||
|
" description: The ID of the hotel to update.\n",
|
||||||
|
" - name: checkin_date\n",
|
||||||
|
" type: string\n",
|
||||||
|
" description: The new check-in date of the hotel.\n",
|
||||||
|
" - name: checkout_date\n",
|
||||||
|
" type: string\n",
|
||||||
|
" description: The new check-out date of the hotel.\n",
|
||||||
|
"statement: >-\n",
|
||||||
|
" UPDATE hotels SET checkin_date = CAST(\\$2 as date), checkout_date = CAST(\\$3\n",
|
||||||
|
" as date) WHERE id = \\$1;\n",
|
||||||
|
"---\n",
|
||||||
|
"kind: tools\n",
|
||||||
|
"name: cancel-hotel\n",
|
||||||
|
"type: postgres-sql\n",
|
||||||
|
"source: my-pg-source\n",
|
||||||
|
"description: Cancel a hotel by its ID.\n",
|
||||||
|
"parameters:\n",
|
||||||
|
" - name: hotel_id\n",
|
||||||
|
" type: string\n",
|
||||||
|
" description: The ID of the hotel to cancel.\n",
|
||||||
|
"statement: UPDATE hotels SET booked = B'0' WHERE id = \\$1;\n",
|
||||||
|
"---\n",
|
||||||
|
"kind: toolsets\n",
|
||||||
|
"name: my-toolset\n",
|
||||||
"tools:\n",
|
"tools:\n",
|
||||||
" search-hotels-by-name:\n",
|
" - search-hotels-by-name\n",
|
||||||
" kind: postgres-sql\n",
|
" - search-hotels-by-location\n",
|
||||||
" source: my-pg-source\n",
|
" - book-hotel\n",
|
||||||
" description: Search for hotels based on name.\n",
|
" - update-hotel\n",
|
||||||
" parameters:\n",
|
" - cancel-hotel\n",
|
||||||
" - name: name\n",
|
|
||||||
" type: string\n",
|
|
||||||
" description: The name of the hotel.\n",
|
|
||||||
" statement: SELECT * FROM hotels WHERE name ILIKE '%' || \\$1 || '%';\n",
|
|
||||||
" search-hotels-by-location:\n",
|
|
||||||
" kind: postgres-sql\n",
|
|
||||||
" source: my-pg-source\n",
|
|
||||||
" description: Search for hotels based on location.\n",
|
|
||||||
" parameters:\n",
|
|
||||||
" - name: location\n",
|
|
||||||
" type: string\n",
|
|
||||||
" description: The location of the hotel.\n",
|
|
||||||
" statement: SELECT * FROM hotels WHERE location ILIKE '%' || \\$1 || '%';\n",
|
|
||||||
" book-hotel:\n",
|
|
||||||
" kind: postgres-sql\n",
|
|
||||||
" source: my-pg-source\n",
|
|
||||||
" description: >-\n",
|
|
||||||
" Book a hotel by its ID. If the hotel is successfully booked, returns a NULL, raises an error if not.\n",
|
|
||||||
" parameters:\n",
|
|
||||||
" - name: hotel_id\n",
|
|
||||||
" type: string\n",
|
|
||||||
" description: The ID of the hotel to book.\n",
|
|
||||||
" statement: UPDATE hotels SET booked = B'1' WHERE id = \\$1;\n",
|
|
||||||
" update-hotel:\n",
|
|
||||||
" kind: postgres-sql\n",
|
|
||||||
" source: my-pg-source\n",
|
|
||||||
" description: >-\n",
|
|
||||||
" Update a hotel's check-in and check-out dates by its ID. Returns a message\n",
|
|
||||||
" indicating whether the hotel was successfully updated or not.\n",
|
|
||||||
" parameters:\n",
|
|
||||||
" - name: hotel_id\n",
|
|
||||||
" type: string\n",
|
|
||||||
" description: The ID of the hotel to update.\n",
|
|
||||||
" - name: checkin_date\n",
|
|
||||||
" type: string\n",
|
|
||||||
" description: The new check-in date of the hotel.\n",
|
|
||||||
" - name: checkout_date\n",
|
|
||||||
" type: string\n",
|
|
||||||
" description: The new check-out date of the hotel.\n",
|
|
||||||
" statement: >-\n",
|
|
||||||
" UPDATE hotels SET checkin_date = CAST(\\$2 as date), checkout_date = CAST(\\$3\n",
|
|
||||||
" as date) WHERE id = \\$1;\n",
|
|
||||||
" cancel-hotel:\n",
|
|
||||||
" kind: postgres-sql\n",
|
|
||||||
" source: my-pg-source\n",
|
|
||||||
" description: Cancel a hotel by its ID.\n",
|
|
||||||
" parameters:\n",
|
|
||||||
" - name: hotel_id\n",
|
|
||||||
" type: string\n",
|
|
||||||
" description: The ID of the hotel to cancel.\n",
|
|
||||||
" statement: UPDATE hotels SET booked = B'0' WHERE id = \\$1;\n",
|
|
||||||
"toolsets:\n",
|
|
||||||
" my-toolset:\n",
|
|
||||||
" - search-hotels-by-name\n",
|
|
||||||
" - search-hotels-by-location\n",
|
|
||||||
" - book-hotel\n",
|
|
||||||
" - update-hotel\n",
|
|
||||||
" - cancel-hotel\n",
|
|
||||||
"\"\"\""
|
"\"\"\""
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -509,8 +520,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"! pip install toolbox-core --quiet\n",
|
"! pip install google-adk[toolbox] --quiet"
|
||||||
"! pip install google-adk --quiet"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -525,14 +535,18 @@
|
|||||||
"from google.adk.runners import Runner\n",
|
"from google.adk.runners import Runner\n",
|
||||||
"from google.adk.sessions import InMemorySessionService\n",
|
"from google.adk.sessions import InMemorySessionService\n",
|
||||||
"from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService\n",
|
"from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService\n",
|
||||||
|
"from google.adk.tools.toolbox_toolset import ToolboxToolset\n",
|
||||||
"from google.genai import types\n",
|
"from google.genai import types\n",
|
||||||
"from toolbox_core import ToolboxSyncClient\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"import os\n",
|
"import os\n",
|
||||||
"# TODO(developer): replace this with your Google API key\n",
|
"# TODO(developer): replace this with your Google API key\n",
|
||||||
"os.environ['GOOGLE_API_KEY'] = \"<GOOGLE_API_KEY>\"\n",
|
"os.environ['GOOGLE_API_KEY'] = \"<GOOGLE_API_KEY>\"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"toolbox_client = ToolboxSyncClient(\"http://127.0.0.1:5000\")\n",
|
"# Configure toolset\n",
|
||||||
|
"toolset = ToolboxToolset(\n",
|
||||||
|
" server_url=\"http://127.0.0.1:5000\",\n",
|
||||||
|
" toolset_name=\"my-toolset\"\n",
|
||||||
|
")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"prompt = \"\"\"\n",
|
"prompt = \"\"\"\n",
|
||||||
" You're a helpful hotel assistant. You handle hotel searching, booking and\n",
|
" You're a helpful hotel assistant. You handle hotel searching, booking and\n",
|
||||||
@@ -549,7 +563,7 @@
|
|||||||
" name='hotel_agent',\n",
|
" name='hotel_agent',\n",
|
||||||
" description='A helpful AI assistant.',\n",
|
" description='A helpful AI assistant.',\n",
|
||||||
" instruction=prompt,\n",
|
" instruction=prompt,\n",
|
||||||
" tools=toolbox_client.load_toolset(\"my-toolset\"),\n",
|
" tools=[toolset],\n",
|
||||||
")\n",
|
")\n",
|
||||||
"\n",
|
"\n",
|
||||||
"session_service = InMemorySessionService()\n",
|
"session_service = InMemorySessionService()\n",
|
||||||
|
|||||||
@@ -36,14 +36,14 @@ Toolbox should have access to. Most tools will have at least one source to
|
|||||||
execute against.
|
execute against.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-pg-source:
|
name: my-pg-source
|
||||||
kind: postgres
|
type: postgres
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 5432
|
port: 5432
|
||||||
database: toolbox_db
|
database: toolbox_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
```
|
```
|
||||||
|
|
||||||
For more details on configuring different types of sources, see the
|
For more details on configuring different types of sources, see the
|
||||||
@@ -52,20 +52,20 @@ For more details on configuring different types of sources, see the
|
|||||||
### Tools
|
### Tools
|
||||||
|
|
||||||
The `tools` section of your `tools.yaml` defines the actions your agent can
|
The `tools` section of your `tools.yaml` defines the actions your agent can
|
||||||
take: what kind of tool it is, which source(s) it affects, what parameters it
|
take: what type of tool it is, which source(s) it affects, what parameters it
|
||||||
uses, etc.
|
uses, etc.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
search-hotels-by-name:
|
name: search-hotels-by-name
|
||||||
kind: postgres-sql
|
type: postgres-sql
|
||||||
source: my-pg-source
|
source: my-pg-source
|
||||||
description: Search for hotels based on name.
|
description: Search for hotels based on name.
|
||||||
parameters:
|
parameters:
|
||||||
- name: name
|
- name: name
|
||||||
type: string
|
type: string
|
||||||
description: The name of the hotel.
|
description: The name of the hotel.
|
||||||
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
||||||
```
|
```
|
||||||
|
|
||||||
For more details on configuring different types of tools, see the
|
For more details on configuring different types of tools, see the
|
||||||
@@ -78,13 +78,17 @@ that you want to be able to load together. This can be useful for defining
|
|||||||
different sets for different agents or different applications.
|
different sets for different agents or different applications.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
toolsets:
|
kind: toolsets
|
||||||
my_first_toolset:
|
name: my_first_toolset
|
||||||
- my_first_tool
|
tools:
|
||||||
- my_second_tool
|
- my_first_tool
|
||||||
my_second_toolset:
|
- my_second_tool
|
||||||
- my_second_tool
|
---
|
||||||
- my_third_tool
|
kind: toolsets
|
||||||
|
name: my_second_toolset
|
||||||
|
tools:
|
||||||
|
- my_second_tool
|
||||||
|
- my_third_tool
|
||||||
```
|
```
|
||||||
|
|
||||||
You can load toolsets by name:
|
You can load toolsets by name:
|
||||||
@@ -103,14 +107,14 @@ The `prompts` section of your `tools.yaml` defines the templates containing
|
|||||||
structured messages and instructions for interacting with language models.
|
structured messages and instructions for interacting with language models.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
prompts:
|
kind: prompts
|
||||||
code_review:
|
name: code_review
|
||||||
description: "Asks the LLM to analyze code quality and suggest improvements."
|
description: "Asks the LLM to analyze code quality and suggest improvements."
|
||||||
messages:
|
messages:
|
||||||
- content: "Please review the following code for quality, correctness, and potential improvements: \n\n{{.code}}"
|
- content: "Please review the following code for quality, correctness, and potential improvements: \n\n{{.code}}"
|
||||||
arguments:
|
arguments:
|
||||||
- name: "code"
|
- name: "code"
|
||||||
description: "The code to review"
|
description: "The code to review"
|
||||||
```
|
```
|
||||||
|
|
||||||
For more details on configuring different types of prompts, see the
|
For more details on configuring different types of prompts, see the
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ Databases” as its initial development predated MCP, but was renamed to align
|
|||||||
with recently added MCP compatibility.
|
with recently added MCP compatibility.
|
||||||
{{< /notice >}}
|
{{< /notice >}}
|
||||||
|
|
||||||
|
{{< notice note >}}
|
||||||
|
This document has been updated to support the configuration file v2 format. To
|
||||||
|
view documentation with configuration file v1 format, please navigate to the
|
||||||
|
top-right menu and select versions v0.26.0 or older.
|
||||||
|
{{< /notice >}}
|
||||||
|
|
||||||
## Why Toolbox?
|
## Why Toolbox?
|
||||||
|
|
||||||
Toolbox helps you build Gen AI tools that let your agents access data in your
|
Toolbox helps you build Gen AI tools that let your agents access data in your
|
||||||
@@ -71,7 +77,7 @@ redeploying your application.
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
### (Non-production) Running Toolbox
|
### Quickstart: Running Toolbox using NPX
|
||||||
|
|
||||||
You can run Toolbox directly with a [configuration file](../configure.md):
|
You can run Toolbox directly with a [configuration file](../configure.md):
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ runtime](https://research.google.com/colaboratory/local-runtimes.html).
|
|||||||
{{< tabpane persist=header >}}
|
{{< tabpane persist=header >}}
|
||||||
{{< tab header="ADK" lang="bash" >}}
|
{{< tab header="ADK" lang="bash" >}}
|
||||||
|
|
||||||
pip install toolbox-core
|
pip install google-adk[toolbox]
|
||||||
{{< /tab >}}
|
{{< /tab >}}
|
||||||
{{< tab header="Langchain" lang="bash" >}}
|
{{< tab header="Langchain" lang="bash" >}}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ pip install toolbox-core
|
|||||||
{{< tabpane persist=header >}}
|
{{< tabpane persist=header >}}
|
||||||
{{< tab header="ADK" lang="bash" >}}
|
{{< tab header="ADK" lang="bash" >}}
|
||||||
|
|
||||||
pip install google-adk
|
# No other dependencies required for ADK
|
||||||
{{< /tab >}}
|
{{< /tab >}}
|
||||||
{{< tab header="Langchain" lang="bash" >}}
|
{{< tab header="Langchain" lang="bash" >}}
|
||||||
|
|
||||||
|
|||||||
@@ -125,78 +125,89 @@ In this section, we will download Toolbox, configure our tools in a
|
|||||||
{{< /notice >}}
|
{{< /notice >}}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-pg-source:
|
name: my-pg-source
|
||||||
kind: postgres
|
type: postgres
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 5432
|
port: 5432
|
||||||
database: toolbox_db
|
database: toolbox_db
|
||||||
user: toolbox_user
|
user: toolbox_user
|
||||||
password: my-password
|
password: my-password
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: search-hotels-by-name
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: Search for hotels based on name.
|
||||||
|
parameters:
|
||||||
|
- name: name
|
||||||
|
type: string
|
||||||
|
description: The name of the hotel.
|
||||||
|
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: search-hotels-by-location
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: Search for hotels based on location.
|
||||||
|
parameters:
|
||||||
|
- name: location
|
||||||
|
type: string
|
||||||
|
description: The location of the hotel.
|
||||||
|
statement: SELECT * FROM hotels WHERE location ILIKE '%' || $1 || '%';
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: book-hotel
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: >-
|
||||||
|
Book a hotel by its ID. If the hotel is successfully booked, returns a NULL, raises an error if not.
|
||||||
|
parameters:
|
||||||
|
- name: hotel_id
|
||||||
|
type: string
|
||||||
|
description: The ID of the hotel to book.
|
||||||
|
statement: UPDATE hotels SET booked = B'1' WHERE id = $1;
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: update-hotel
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: >-
|
||||||
|
Update a hotel's check-in and check-out dates by its ID. Returns a message
|
||||||
|
indicating whether the hotel was successfully updated or not.
|
||||||
|
parameters:
|
||||||
|
- name: hotel_id
|
||||||
|
type: string
|
||||||
|
description: The ID of the hotel to update.
|
||||||
|
- name: checkin_date
|
||||||
|
type: string
|
||||||
|
description: The new check-in date of the hotel.
|
||||||
|
- name: checkout_date
|
||||||
|
type: string
|
||||||
|
description: The new check-out date of the hotel.
|
||||||
|
statement: >-
|
||||||
|
UPDATE hotels SET checkin_date = CAST($2 as date), checkout_date = CAST($3
|
||||||
|
as date) WHERE id = $1;
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: cancel-hotel
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: Cancel a hotel by its ID.
|
||||||
|
parameters:
|
||||||
|
- name: hotel_id
|
||||||
|
type: string
|
||||||
|
description: The ID of the hotel to cancel.
|
||||||
|
statement: UPDATE hotels SET booked = B'0' WHERE id = $1;
|
||||||
|
---
|
||||||
|
kind: toolsets
|
||||||
|
name: my-toolset
|
||||||
tools:
|
tools:
|
||||||
search-hotels-by-name:
|
- search-hotels-by-name
|
||||||
kind: postgres-sql
|
- search-hotels-by-location
|
||||||
source: my-pg-source
|
- book-hotel
|
||||||
description: Search for hotels based on name.
|
- update-hotel
|
||||||
parameters:
|
- cancel-hotel
|
||||||
- name: name
|
|
||||||
type: string
|
|
||||||
description: The name of the hotel.
|
|
||||||
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
|
||||||
search-hotels-by-location:
|
|
||||||
kind: postgres-sql
|
|
||||||
source: my-pg-source
|
|
||||||
description: Search for hotels based on location.
|
|
||||||
parameters:
|
|
||||||
- name: location
|
|
||||||
type: string
|
|
||||||
description: The location of the hotel.
|
|
||||||
statement: SELECT * FROM hotels WHERE location ILIKE '%' || $1 || '%';
|
|
||||||
book-hotel:
|
|
||||||
kind: postgres-sql
|
|
||||||
source: my-pg-source
|
|
||||||
description: >-
|
|
||||||
Book a hotel by its ID. If the hotel is successfully booked, returns a NULL, raises an error if not.
|
|
||||||
parameters:
|
|
||||||
- name: hotel_id
|
|
||||||
type: string
|
|
||||||
description: The ID of the hotel to book.
|
|
||||||
statement: UPDATE hotels SET booked = B'1' WHERE id = $1;
|
|
||||||
update-hotel:
|
|
||||||
kind: postgres-sql
|
|
||||||
source: my-pg-source
|
|
||||||
description: >-
|
|
||||||
Update a hotel's check-in and check-out dates by its ID. Returns a message
|
|
||||||
indicating whether the hotel was successfully updated or not.
|
|
||||||
parameters:
|
|
||||||
- name: hotel_id
|
|
||||||
type: string
|
|
||||||
description: The ID of the hotel to update.
|
|
||||||
- name: checkin_date
|
|
||||||
type: string
|
|
||||||
description: The new check-in date of the hotel.
|
|
||||||
- name: checkout_date
|
|
||||||
type: string
|
|
||||||
description: The new check-out date of the hotel.
|
|
||||||
statement: >-
|
|
||||||
UPDATE hotels SET checkin_date = CAST($2 as date), checkout_date = CAST($3
|
|
||||||
as date) WHERE id = $1;
|
|
||||||
cancel-hotel:
|
|
||||||
kind: postgres-sql
|
|
||||||
source: my-pg-source
|
|
||||||
description: Cancel a hotel by its ID.
|
|
||||||
parameters:
|
|
||||||
- name: hotel_id
|
|
||||||
type: string
|
|
||||||
description: The ID of the hotel to cancel.
|
|
||||||
statement: UPDATE hotels SET booked = B'0' WHERE id = $1;
|
|
||||||
toolsets:
|
|
||||||
my-toolset:
|
|
||||||
- search-hotels-by-name
|
|
||||||
- search-hotels-by-location
|
|
||||||
- book-hotel
|
|
||||||
- update-hotel
|
|
||||||
- cancel-hotel
|
|
||||||
```
|
```
|
||||||
|
|
||||||
For more info on tools, check out the
|
For more info on tools, check out the
|
||||||
|
|||||||
@@ -157,61 +157,67 @@ Create a file named `tools.yaml`. This file defines the database connection, the
|
|||||||
SQL tools available, and the prompts the agents will use.
|
SQL tools available, and the prompts the agents will use.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-foodiefind-db:
|
name: my-foodiefind-db
|
||||||
kind: postgres
|
type: postgres
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 5432
|
port: 5432
|
||||||
database: toolbox_db
|
database: toolbox_db
|
||||||
user: toolbox_user
|
user: toolbox_user
|
||||||
password: my-password
|
password: my-password
|
||||||
tools:
|
---
|
||||||
find_user_by_email:
|
kind: tools
|
||||||
kind: postgres-sql
|
name: find_user_by_email
|
||||||
source: my-foodiefind-db
|
type: postgres-sql
|
||||||
description: Find a user's ID by their email address.
|
source: my-foodiefind-db
|
||||||
parameters:
|
description: Find a user's ID by their email address.
|
||||||
- name: email
|
parameters:
|
||||||
type: string
|
- name: email
|
||||||
description: The email address of the user to find.
|
type: string
|
||||||
statement: SELECT id FROM users WHERE email = $1;
|
description: The email address of the user to find.
|
||||||
find_restaurant_by_name:
|
statement: SELECT id FROM users WHERE email = $1;
|
||||||
kind: postgres-sql
|
---
|
||||||
source: my-foodiefind-db
|
kind: tools
|
||||||
description: Find a restaurant's ID by its exact name.
|
name: find_restaurant_by_name
|
||||||
parameters:
|
type: postgres-sql
|
||||||
- name: name
|
source: my-foodiefind-db
|
||||||
type: string
|
description: Find a restaurant's ID by its exact name.
|
||||||
description: The name of the restaurant to find.
|
parameters:
|
||||||
statement: SELECT id FROM restaurants WHERE name = $1;
|
- name: name
|
||||||
find_review_by_user_and_restaurant:
|
type: string
|
||||||
kind: postgres-sql
|
description: The name of the restaurant to find.
|
||||||
source: my-foodiefind-db
|
statement: SELECT id FROM restaurants WHERE name = $1;
|
||||||
description: Find the full record for a specific review using the user's ID and the restaurant's ID.
|
---
|
||||||
parameters:
|
kind: tools
|
||||||
- name: user_id
|
name: find_review_by_user_and_restaurant
|
||||||
type: integer
|
type: postgres-sql
|
||||||
description: The numerical ID of the user.
|
source: my-foodiefind-db
|
||||||
- name: restaurant_id
|
description: Find the full record for a specific review using the user's ID and the restaurant's ID.
|
||||||
type: integer
|
parameters:
|
||||||
description: The numerical ID of the restaurant.
|
- name: user_id
|
||||||
statement: SELECT * FROM reviews WHERE user_id = $1 AND restaurant_id = $2;
|
type: integer
|
||||||
prompts:
|
description: The numerical ID of the user.
|
||||||
investigate_missing_review:
|
- name: restaurant_id
|
||||||
description: "Investigates a user's missing review by finding the user, restaurant, and the review itself, then analyzing its status."
|
type: integer
|
||||||
arguments:
|
description: The numerical ID of the restaurant.
|
||||||
- name: "user_email"
|
statement: SELECT * FROM reviews WHERE user_id = $1 AND restaurant_id = $2;
|
||||||
description: "The email of the user who wrote the review."
|
---
|
||||||
- name: "restaurant_name"
|
kind: prompts
|
||||||
description: "The name of the restaurant being reviewed."
|
name: investigate_missing_review
|
||||||
messages:
|
description: "Investigates a user's missing review by finding the user, restaurant, and the review itself, then analyzing its status."
|
||||||
- content: >-
|
arguments:
|
||||||
**Goal:** Find the review written by the user with email '{{.user_email}}' for the restaurant named '{{.restaurant_name}}' and understand its status.
|
- name: "user_email"
|
||||||
**Workflow:**
|
description: "The email of the user who wrote the review."
|
||||||
1. Use the `find_user_by_email` tool with the email '{{.user_email}}' to get the `user_id`.
|
- name: "restaurant_name"
|
||||||
2. Use the `find_restaurant_by_name` tool with the name '{{.restaurant_name}}' to get the `restaurant_id`.
|
description: "The name of the restaurant being reviewed."
|
||||||
3. Use the `find_review_by_user_and_restaurant` tool with the `user_id` and `restaurant_id` you just found.
|
messages:
|
||||||
4. Analyze the results from the final tool call. Examine the `is_published` and `moderation_status` fields and explain the review's status to the user in a clear, human-readable sentence.
|
- content: >-
|
||||||
|
**Goal:** Find the review written by the user with email '{{.user_email}}' for the restaurant named '{{.restaurant_name}}' and understand its status.
|
||||||
|
**Workflow:**
|
||||||
|
1. Use the `find_user_by_email` tool with the email '{{.user_email}}' to get the `user_id`.
|
||||||
|
2. Use the `find_restaurant_by_name` tool with the name '{{.restaurant_name}}' to get the `restaurant_id`.
|
||||||
|
3. Use the `find_review_by_user_and_restaurant` tool with the `user_id` and `restaurant_id` you just found.
|
||||||
|
4. Analyze the results from the final tool call. Examine the `is_published` and `moderation_status` fields and explain the review's status to the user in a clear, human-readable sentence.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 3: Connect to Gemini CLI
|
## Step 3: Connect to Gemini CLI
|
||||||
|
|||||||
@@ -24,12 +24,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dabh/diagnostics": {
|
"node_modules/@dabh/diagnostics": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.8.tgz",
|
||||||
"integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==",
|
"integrity": "sha512-R4MSXTVnuMzGD7bzHdW2ZhhdPC/igELENcq5IjEverBvq5hn1SXCWcsi6eSsdWP0/Ur+SItRRjAktmdoX/8R/Q==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"colorspace": "1.1.x",
|
"@so-ric/colorspace": "^1.1.6",
|
||||||
"enabled": "2.0.x",
|
"enabled": "2.0.x",
|
||||||
"kuler": "^2.0.0"
|
"kuler": "^2.0.0"
|
||||||
}
|
}
|
||||||
@@ -578,9 +579,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@google-cloud/firestore": {
|
"node_modules/@google-cloud/firestore": {
|
||||||
"version": "7.11.3",
|
"version": "7.11.6",
|
||||||
"resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.11.3.tgz",
|
"resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.11.6.tgz",
|
||||||
"integrity": "sha512-qsM3/WHpawF07SRVvEJJVRwhYzM7o9qtuksyuqnrMig6fxIrwWnsezECWsG/D5TyYru51Fv5c/RTqNDQ2yU+4w==",
|
"integrity": "sha512-EW/O8ktzwLfyWBOsNuhRoMi8lrC3clHM5LVFhGvO1HCsLozCOOXRAlHrYBoE6HL42Sc8yYMuCb2XqcnJ4OOEpw==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2887,6 +2889,17 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
|
||||||
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
|
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/@so-ric/colorspace": {
|
||||||
|
"version": "1.1.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@so-ric/colorspace/-/colorspace-1.1.6.tgz",
|
||||||
|
"integrity": "sha512-/KiKkpHNOBgkFJwu9sh48LkHSMYGyuTcSFK/qMBdnOAlrRJzRSXAOFB5qwzaVQuDl8wAvHVMkaASQDReTahxuw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"dependencies": {
|
||||||
|
"color": "^5.0.2",
|
||||||
|
"text-hex": "1.0.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@toolbox-sdk/core": {
|
"node_modules/@toolbox-sdk/core": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@toolbox-sdk/core/-/core-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@toolbox-sdk/core/-/core-0.1.2.tgz",
|
||||||
@@ -3515,38 +3528,53 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/color": {
|
"node_modules/color": {
|
||||||
"version": "3.2.1",
|
"version": "5.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/color/-/color-5.0.3.tgz",
|
||||||
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
|
"integrity": "sha512-ezmVcLR3xAVp8kYOm4GS45ZLLgIE6SPAFoduLr6hTDajwb3KZ2F46gulK3XpcwRFb5KKGCSezCBAY4Dw4HsyXA==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"color-convert": "^1.9.3",
|
"color-convert": "^3.1.3",
|
||||||
"color-string": "^1.6.0"
|
"color-string": "^2.1.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/color-convert": {
|
"node_modules/color-convert": {
|
||||||
"version": "1.9.3",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-3.1.3.tgz",
|
||||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
"integrity": "sha512-fasDH2ont2GqF5HpyO4w0+BcewlhHEZOFn9c1ckZdHpJ56Qb7MHhH/IcJZbBGgvdtwdwNbLvxiBEdg336iA9Sg==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"color-name": "1.1.3"
|
"color-name": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/color-name": {
|
"node_modules/color-name": {
|
||||||
"version": "1.1.3",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-2.1.0.tgz",
|
||||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
"integrity": "sha512-1bPaDNFm0axzE4MEAzKPuqKWeRaT43U/hyxKPBdqTfmPF+d6n7FSoTFxLVULUJOmiLp01KjhIPPH+HrXZJN4Rg==",
|
||||||
"optional": true
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.20"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/color-string": {
|
"node_modules/color-string": {
|
||||||
"version": "1.9.1",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/color-string/-/color-string-2.1.4.tgz",
|
||||||
"integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
|
"integrity": "sha512-Bb6Cq8oq0IjDOe8wJmi4JeNn763Xs9cfrBcaylK1tPypWzyoy2G3l90v9k64kjphl/ZJjPIShFztenRomi8WTg==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"color-name": "^1.0.0",
|
"color-name": "^2.0.0"
|
||||||
"simple-swizzle": "^0.2.2"
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/colorette": {
|
"node_modules/colorette": {
|
||||||
@@ -3554,16 +3582,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
|
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
|
||||||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
|
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
|
||||||
},
|
},
|
||||||
"node_modules/colorspace": {
|
|
||||||
"version": "1.1.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz",
|
|
||||||
"integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==",
|
|
||||||
"optional": true,
|
|
||||||
"dependencies": {
|
|
||||||
"color": "^3.1.3",
|
|
||||||
"text-hex": "1.0.x"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/combined-stream": {
|
"node_modules/combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
@@ -4968,12 +4986,6 @@
|
|||||||
"node": ">= 0.10"
|
"node": ">= 0.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-arrayish": {
|
|
||||||
"version": "0.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
|
|
||||||
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"node_modules/is-core-module": {
|
"node_modules/is-core-module": {
|
||||||
"version": "2.16.1",
|
"version": "2.16.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
|
||||||
@@ -5114,13 +5126,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jsonwebtoken/node_modules/jws": {
|
"node_modules/jsonwebtoken/node_modules/jws": {
|
||||||
"version": "3.2.2",
|
"version": "3.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz",
|
||||||
"integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
|
"integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jwa": "^1.4.1",
|
"jwa": "^1.4.2",
|
||||||
"safe-buffer": "^5.0.1"
|
"safe-buffer": "^5.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -5153,11 +5166,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jws": {
|
"node_modules/jws": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
|
||||||
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
|
"integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jwa": "^2.0.0",
|
"jwa": "^2.0.1",
|
||||||
"safe-buffer": "^5.0.1"
|
"safe-buffer": "^5.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -5424,9 +5438,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-forge": {
|
"node_modules/node-forge": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz",
|
||||||
"integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
|
"integrity": "sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==",
|
||||||
|
"license": "(BSD-3-Clause OR GPL-2.0)",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -6038,15 +6053,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/simple-swizzle": {
|
|
||||||
"version": "0.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
|
|
||||||
"integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
|
|
||||||
"optional": true,
|
|
||||||
"dependencies": {
|
|
||||||
"is-arrayish": "^0.3.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/source-map": {
|
"node_modules/source-map": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
@@ -6233,6 +6239,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
|
||||||
"integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==",
|
"integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"node_modules/thriftrw": {
|
"node_modules/thriftrw": {
|
||||||
@@ -6416,13 +6423,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/winston": {
|
"node_modules/winston": {
|
||||||
"version": "3.17.0",
|
"version": "3.19.0",
|
||||||
"resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/winston/-/winston-3.19.0.tgz",
|
||||||
"integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==",
|
"integrity": "sha512-LZNJgPzfKR+/J3cHkxcpHKpKKvGfDZVPS4hfJCc4cCG0CgYzvlD6yE/S3CIL/Yt91ak327YCpiF/0MyeZHEHKA==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@colors/colors": "^1.6.0",
|
"@colors/colors": "^1.6.0",
|
||||||
"@dabh/diagnostics": "^2.0.2",
|
"@dabh/diagnostics": "^2.0.8",
|
||||||
"async": "^3.2.3",
|
"async": "^3.2.3",
|
||||||
"is-stream": "^2.0.0",
|
"is-stream": "^2.0.0",
|
||||||
"logform": "^2.7.0",
|
"logform": "^2.7.0",
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
from google.adk import Agent
|
from google.adk import Agent
|
||||||
from google.adk.apps import App
|
from google.adk.apps import App
|
||||||
from toolbox_core import ToolboxSyncClient
|
from google.adk.tools.toolbox_toolset import ToolboxToolset
|
||||||
|
|
||||||
# TODO(developer): update the TOOLBOX_URL to your toolbox endpoint
|
# TODO(developer): update the TOOLBOX_URL to your toolbox endpoint
|
||||||
client = ToolboxSyncClient("http://127.0.0.1:5000")
|
toolset = ToolboxToolset(
|
||||||
|
server_url="http://127.0.0.1:5000",
|
||||||
|
)
|
||||||
|
|
||||||
root_agent = Agent(
|
root_agent = Agent(
|
||||||
name='root_agent',
|
name='root_agent',
|
||||||
model='gemini-2.5-flash',
|
model='gemini-2.5-flash',
|
||||||
instruction="You are a helpful AI assistant designed to provide accurate and useful information.",
|
instruction="You are a helpful AI assistant designed to provide accurate and useful information.",
|
||||||
tools=client.load_toolset(),
|
tools=[toolset],
|
||||||
)
|
)
|
||||||
|
|
||||||
app = App(root_agent=root_agent, name="my_agent")
|
app = App(root_agent=root_agent, name="my_agent")
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
google-adk==1.21.0
|
google-adk[toolbox]==1.23.0
|
||||||
toolbox-core==0.5.4
|
|
||||||
pytest==9.0.2
|
pytest==9.0.2
|
||||||
@@ -33,78 +33,89 @@ In this section, we will download Toolbox, configure our tools in a
|
|||||||
{{< /notice >}}
|
{{< /notice >}}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-pg-source:
|
name: my-pg-source
|
||||||
kind: postgres
|
type: postgres
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 5432
|
port: 5432
|
||||||
database: toolbox_db
|
database: toolbox_db
|
||||||
user: ${USER_NAME}
|
user: toolbox_user
|
||||||
password: ${PASSWORD}
|
password: my-password
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: search-hotels-by-name
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: Search for hotels based on name.
|
||||||
|
parameters:
|
||||||
|
- name: name
|
||||||
|
type: string
|
||||||
|
description: The name of the hotel.
|
||||||
|
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: search-hotels-by-location
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: Search for hotels based on location.
|
||||||
|
parameters:
|
||||||
|
- name: location
|
||||||
|
type: string
|
||||||
|
description: The location of the hotel.
|
||||||
|
statement: SELECT * FROM hotels WHERE location ILIKE '%' || $1 || '%';
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: book-hotel
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: >-
|
||||||
|
Book a hotel by its ID. If the hotel is successfully booked, returns a NULL, raises an error if not.
|
||||||
|
parameters:
|
||||||
|
- name: hotel_id
|
||||||
|
type: string
|
||||||
|
description: The ID of the hotel to book.
|
||||||
|
statement: UPDATE hotels SET booked = B'1' WHERE id = $1;
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: update-hotel
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: >-
|
||||||
|
Update a hotel's check-in and check-out dates by its ID. Returns a message
|
||||||
|
indicating whether the hotel was successfully updated or not.
|
||||||
|
parameters:
|
||||||
|
- name: hotel_id
|
||||||
|
type: string
|
||||||
|
description: The ID of the hotel to update.
|
||||||
|
- name: checkin_date
|
||||||
|
type: string
|
||||||
|
description: The new check-in date of the hotel.
|
||||||
|
- name: checkout_date
|
||||||
|
type: string
|
||||||
|
description: The new check-out date of the hotel.
|
||||||
|
statement: >-
|
||||||
|
UPDATE hotels SET checkin_date = CAST($2 as date), checkout_date = CAST($3
|
||||||
|
as date) WHERE id = $1;
|
||||||
|
---
|
||||||
|
kind: tools
|
||||||
|
name: cancel-hotel
|
||||||
|
type: postgres-sql
|
||||||
|
source: my-pg-source
|
||||||
|
description: Cancel a hotel by its ID.
|
||||||
|
parameters:
|
||||||
|
- name: hotel_id
|
||||||
|
type: string
|
||||||
|
description: The ID of the hotel to cancel.
|
||||||
|
statement: UPDATE hotels SET booked = B'0' WHERE id = $1;
|
||||||
|
---
|
||||||
|
kind: toolsets
|
||||||
|
name: my-toolset
|
||||||
tools:
|
tools:
|
||||||
search-hotels-by-name:
|
- search-hotels-by-name
|
||||||
kind: postgres-sql
|
- search-hotels-by-location
|
||||||
source: my-pg-source
|
- book-hotel
|
||||||
description: Search for hotels based on name.
|
- update-hotel
|
||||||
parameters:
|
- cancel-hotel
|
||||||
- name: name
|
|
||||||
type: string
|
|
||||||
description: The name of the hotel.
|
|
||||||
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
|
||||||
search-hotels-by-location:
|
|
||||||
kind: postgres-sql
|
|
||||||
source: my-pg-source
|
|
||||||
description: Search for hotels based on location.
|
|
||||||
parameters:
|
|
||||||
- name: location
|
|
||||||
type: string
|
|
||||||
description: The location of the hotel.
|
|
||||||
statement: SELECT * FROM hotels WHERE location ILIKE '%' || $1 || '%';
|
|
||||||
book-hotel:
|
|
||||||
kind: postgres-sql
|
|
||||||
source: my-pg-source
|
|
||||||
description: >-
|
|
||||||
Book a hotel by its ID. If the hotel is successfully booked, returns a NULL, raises an error if not.
|
|
||||||
parameters:
|
|
||||||
- name: hotel_id
|
|
||||||
type: string
|
|
||||||
description: The ID of the hotel to book.
|
|
||||||
statement: UPDATE hotels SET booked = B'1' WHERE id = $1;
|
|
||||||
update-hotel:
|
|
||||||
kind: postgres-sql
|
|
||||||
source: my-pg-source
|
|
||||||
description: >-
|
|
||||||
Update a hotel's check-in and check-out dates by its ID. Returns a message
|
|
||||||
indicating whether the hotel was successfully updated or not.
|
|
||||||
parameters:
|
|
||||||
- name: hotel_id
|
|
||||||
type: string
|
|
||||||
description: The ID of the hotel to update.
|
|
||||||
- name: checkin_date
|
|
||||||
type: string
|
|
||||||
description: The new check-in date of the hotel.
|
|
||||||
- name: checkout_date
|
|
||||||
type: string
|
|
||||||
description: The new check-out date of the hotel.
|
|
||||||
statement: >-
|
|
||||||
UPDATE hotels SET checkin_date = CAST($2 as date), checkout_date = CAST($3
|
|
||||||
as date) WHERE id = $1;
|
|
||||||
cancel-hotel:
|
|
||||||
kind: postgres-sql
|
|
||||||
source: my-pg-source
|
|
||||||
description: Cancel a hotel by its ID.
|
|
||||||
parameters:
|
|
||||||
- name: hotel_id
|
|
||||||
type: string
|
|
||||||
description: The ID of the hotel to cancel.
|
|
||||||
statement: UPDATE hotels SET booked = B'0' WHERE id = $1;
|
|
||||||
toolsets:
|
|
||||||
my-toolset:
|
|
||||||
- search-hotels-by-name
|
|
||||||
- search-hotels-by-location
|
|
||||||
- book-hotel
|
|
||||||
- update-hotel
|
|
||||||
- cancel-hotel
|
|
||||||
```
|
```
|
||||||
|
|
||||||
For more info on tools, check out the `Resources` section of the docs.
|
For more info on tools, check out the `Resources` section of the docs.
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ with the necessary configuration for deployment to Vertex AI Agent Engine.
|
|||||||
process will generate deployment configuration files (like a `Makefile` and
|
process will generate deployment configuration files (like a `Makefile` and
|
||||||
`Dockerfile`) in your project directory.
|
`Dockerfile`) in your project directory.
|
||||||
|
|
||||||
4. Add `toolbox-core` as a dependency to the new project:
|
4. Add `google-adk[toolbox]` as a dependency to the new project:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
uv add toolbox-core
|
uv add google-adk[toolbox]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 3: Configure Google Cloud Authentication
|
## Step 3: Configure Google Cloud Authentication
|
||||||
@@ -95,22 +95,23 @@ authentication token.
|
|||||||
```python
|
```python
|
||||||
from google.adk import Agent
|
from google.adk import Agent
|
||||||
from google.adk.apps import App
|
from google.adk.apps import App
|
||||||
from toolbox_core import ToolboxSyncClient, auth_methods
|
from google.adk.tools.toolbox_toolset import ToolboxToolset
|
||||||
|
from toolbox_adk import CredentialStrategy
|
||||||
|
|
||||||
# TODO(developer): Replace with your Toolbox Cloud Run Service URL
|
# TODO(developer): Replace with your Toolbox Cloud Run Service URL
|
||||||
TOOLBOX_URL = "https://your-toolbox-service-xyz.a.run.app"
|
TOOLBOX_URL = "https://your-toolbox-service-xyz.a.run.app"
|
||||||
|
|
||||||
# Initialize the client with the Cloud Run URL and Auth headers
|
# Initialize the toolset with Workload Identity (generates ID token for the URL)
|
||||||
client = ToolboxSyncClient(
|
toolset = ToolboxToolset(
|
||||||
TOOLBOX_URL,
|
server_url=TOOLBOX_URL,
|
||||||
client_headers={"Authorization": auth_methods.get_google_id_token(TOOLBOX_URL)}
|
credentials=CredentialStrategy.workload_identity(target_audience=TOOLBOX_URL)
|
||||||
)
|
)
|
||||||
|
|
||||||
root_agent = Agent(
|
root_agent = Agent(
|
||||||
name='root_agent',
|
name='root_agent',
|
||||||
model='gemini-2.5-flash',
|
model='gemini-2.5-flash',
|
||||||
instruction="You are a helpful AI assistant designed to provide accurate and useful information.",
|
instruction="You are a helpful AI assistant designed to provide accurate and useful information.",
|
||||||
tools=client.load_toolset(),
|
tools=[toolset],
|
||||||
)
|
)
|
||||||
|
|
||||||
app = App(root_agent=root_agent, name="my_agent")
|
app = App(root_agent=root_agent, name="my_agent")
|
||||||
|
|||||||
74
docs/en/how-to/invoke_tool.md
Normal file
74
docs/en/how-to/invoke_tool.md
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
---
|
||||||
|
title: "Invoke Tools via CLI"
|
||||||
|
type: docs
|
||||||
|
weight: 10
|
||||||
|
description: >
|
||||||
|
Learn how to invoke your tools directly from the command line using the `invoke` command.
|
||||||
|
---
|
||||||
|
|
||||||
|
The `invoke` command allows you to invoke tools defined in your configuration directly from the CLI. This is useful for:
|
||||||
|
|
||||||
|
- **Ephemeral Invocation:** Executing a tool without spinning up a full MCP server/client.
|
||||||
|
- **Debugging:** Isolating tool execution logic and testing with various parameter combinations.
|
||||||
|
|
||||||
|
{{< notice tip >}}
|
||||||
|
**Keep configurations minimal:** The `invoke` command initializes *all* resources (sources, tools, etc.) defined in your configuration files during execution. To ensure fast response times, consider using a minimal configuration file containing only the tools you need for the specific invocation.
|
||||||
|
{{< notice tip >}}
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- You have the `toolbox` binary installed or built.
|
||||||
|
- You have a valid tool configuration file (e.g., `tools.yaml`).
|
||||||
|
|
||||||
|
## Basic Usage
|
||||||
|
|
||||||
|
The basic syntax for the command is:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
toolbox [--tools-file <path> | --prebuilt <name>] invoke <tool-name> [params]
|
||||||
|
```
|
||||||
|
|
||||||
|
- `<tool-name>`: The name of the tool you want to call. This must match the name defined in your `tools.yaml`.
|
||||||
|
- `[params]`: (Optional) A JSON string representing the arguments for the tool.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### 1. Calling a Tool without Parameters
|
||||||
|
|
||||||
|
If your tool takes no parameters, simply provide the tool name:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
toolbox --tools-file tools.yaml invoke my-simple-tool
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Calling a Tool with Parameters
|
||||||
|
|
||||||
|
For tools that require arguments, pass them as a JSON string. Ensure you escape quotes correctly for your shell.
|
||||||
|
|
||||||
|
**Example: A tool that takes parameters**
|
||||||
|
|
||||||
|
Assuming a tool named `mytool` taking `a` and `b`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
toolbox --tools-file tools.yaml invoke mytool '{"a": 10, "b": 20}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example: A tool that queries a database**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
toolbox --tools-file tools.yaml invoke db-query '{"sql": "SELECT * FROM users LIMIT 5"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Using Prebuilt Configurations
|
||||||
|
|
||||||
|
You can also use the `--prebuilt` flag to load prebuilt toolsets.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
toolbox --prebuilt cloudsql-postgres invoke cloudsql-postgres-list-instances
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
- **Tool not found:** Ensure the `<tool-name>` matches exactly what is in your YAML file and that the file is correctly loaded via `--tools-file`.
|
||||||
|
- **Invalid parameters:** Double-check your JSON syntax. The error message will usually indicate if the JSON parsing failed or if the parameters didn't match the tool's schema.
|
||||||
|
- **Auth errors:** The `invoke` command currently does not support flows requiring client-side authorization (like OAuth flow initiation via the CLI). It works best for tools using service-side authentication (e.g., Application Default Credentials).
|
||||||
@@ -27,9 +27,24 @@ description: >
|
|||||||
| | `--ui` | Launches the Toolbox UI web server. | |
|
| | `--ui` | Launches the Toolbox UI web server. | |
|
||||||
| | `--allowed-origins` | Specifies a list of origins permitted to access this server for CORs access. | `*` |
|
| | `--allowed-origins` | Specifies a list of origins permitted to access this server for CORs access. | `*` |
|
||||||
| | `--allowed-hosts` | Specifies a list of hosts permitted to access this server to prevent DNS rebinding attacks. | `*` |
|
| | `--allowed-hosts` | Specifies a list of hosts permitted to access this server to prevent DNS rebinding attacks. | `*` |
|
||||||
| | `--user-agent-extra` | Appends additional metadata to the User-Agent. | |
|
| | `--user-agent-metadata` | Appends additional metadata to the User-Agent. | |
|
||||||
| `-v` | `--version` | version for toolbox | |
|
| `-v` | `--version` | version for toolbox | |
|
||||||
|
|
||||||
|
## Sub Commands
|
||||||
|
|
||||||
|
### `invoke`
|
||||||
|
|
||||||
|
Executes a tool directly with the provided parameters. This is useful for testing tool configurations and parameters without needing a full client setup.
|
||||||
|
|
||||||
|
**Syntax:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
toolbox invoke <tool-name> [params]
|
||||||
|
```
|
||||||
|
|
||||||
|
- `<tool-name>`: The name of the tool to execute (as defined in your configuration).
|
||||||
|
- `[params]`: (Optional) A JSON string containing the parameters for the tool.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Transport Configuration
|
### Transport Configuration
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ See [Usage Examples](../reference/cli.md#examples).
|
|||||||
* `get_query_plan`: Generate the execution plan of a statement.
|
* `get_query_plan`: Generate the execution plan of a statement.
|
||||||
* `list_views`: Lists views in the database from pg_views with a default
|
* `list_views`: Lists views in the database from pg_views with a default
|
||||||
limit of 50 rows. Returns schemaname, viewname and the ownername.
|
limit of 50 rows. Returns schemaname, viewname and the ownername.
|
||||||
* `list_schemas`: Lists schemas in the database.
|
* `list_schemas`: Lists schemas in the database.
|
||||||
* `database_overview`: Fetches the current state of the PostgreSQL server.
|
* `database_overview`: Fetches the current state of the PostgreSQL server.
|
||||||
* `list_triggers`: Lists triggers in the database.
|
* `list_triggers`: Lists triggers in the database.
|
||||||
* `list_indexes`: List available user indexes in a PostgreSQL database.
|
* `list_indexes`: List available user indexes in a PostgreSQL database.
|
||||||
* `list_sequences`: List sequences in a PostgreSQL database.
|
* `list_sequences`: List sequences in a PostgreSQL database.
|
||||||
* `list_publication_tables`: List publication tables in a PostgreSQL database.
|
* `list_publication_tables`: List publication tables in a PostgreSQL database.
|
||||||
@@ -64,7 +64,7 @@ See [Usage Examples](../reference/cli.md#examples).
|
|||||||
* `list_pg_settings`: List configuration parameters for the PostgreSQL server.
|
* `list_pg_settings`: List configuration parameters for the PostgreSQL server.
|
||||||
* `list_database_stats`: Lists the key performance and activity statistics for
|
* `list_database_stats`: Lists the key performance and activity statistics for
|
||||||
each database in the AlloyDB instance.
|
each database in the AlloyDB instance.
|
||||||
* `list_roles`: Lists all the user-created roles in PostgreSQL database.
|
* `list_roles`: Lists all the user-created roles in PostgreSQL database.
|
||||||
|
|
||||||
## AlloyDB Postgres Admin
|
## AlloyDB Postgres Admin
|
||||||
|
|
||||||
@@ -100,6 +100,43 @@ See [Usage Examples](../reference/cli.md#examples).
|
|||||||
(timeseries metrics) for queries running in an AlloyDB instance using a
|
(timeseries metrics) for queries running in an AlloyDB instance using a
|
||||||
PromQL query.
|
PromQL query.
|
||||||
|
|
||||||
|
## AlloyDB Omni
|
||||||
|
|
||||||
|
* `--prebuilt` value: `alloydb-omni`
|
||||||
|
* **Environment Variables:**
|
||||||
|
* `ALLOYDB_OMNI_HOST`: (Optional) The hostname or IP address (Default: localhost).
|
||||||
|
* `ALLOYDB_OMNI_PORT`: (Optional) The port number (Default: 5432).
|
||||||
|
* `ALLOYDB_OMNI_DATABASE`: The name of the database to connect to.
|
||||||
|
* `ALLOYDB_OMNI_USER`: The database username.
|
||||||
|
* `ALLOYDB_OMNI_PASSWORD`: (Optional) The password for the database user.
|
||||||
|
* `ALLOYDB_OMNI_QUERY_PARAMS`: (Optional) Connection query parameters.
|
||||||
|
* **Tools:**
|
||||||
|
* `execute_sql`: Executes a SQL query.
|
||||||
|
* `list_tables`: Lists tables in the database.
|
||||||
|
* `list_autovacuum_configurations`: Lists autovacuum configurations in the
|
||||||
|
database.
|
||||||
|
* `list_columnar_configurations`: List AlloyDB Omni columnar-related configurations.
|
||||||
|
* `list_columnar_recommended_columns`: Lists columns that AlloyDB Omni recommends adding to the columnar engine.
|
||||||
|
* `list_memory_configurations`: Lists memory-related configurations in the
|
||||||
|
database.
|
||||||
|
* `list_top_bloated_tables`: List top bloated tables in the database.
|
||||||
|
* `list_replication_slots`: Lists replication slots in the database.
|
||||||
|
* `list_invalid_indexes`: Lists invalid indexes in the database.
|
||||||
|
* `get_query_plan`: Generate the execution plan of a statement.
|
||||||
|
* `list_views`: Lists views in the database from pg_views with a default
|
||||||
|
limit of 50 rows. Returns schemaname, viewname and the ownername.
|
||||||
|
* `list_schemas`: Lists schemas in the database.
|
||||||
|
* `database_overview`: Fetches the current state of the PostgreSQL server.
|
||||||
|
* `list_triggers`: Lists triggers in the database.
|
||||||
|
* `list_indexes`: List available user indexes in a PostgreSQL database.
|
||||||
|
* `list_sequences`: List sequences in a PostgreSQL database.
|
||||||
|
* `list_publication_tables`: List publication tables in a PostgreSQL database.
|
||||||
|
* `list_tablespaces`: Lists tablespaces in the database.
|
||||||
|
* `list_pg_settings`: List configuration parameters for the PostgreSQL server.
|
||||||
|
* `list_database_stats`: Lists the key performance and activity statistics for
|
||||||
|
each database in the AlloyDB instance.
|
||||||
|
* `list_roles`: Lists all the user-created roles in PostgreSQL database.
|
||||||
|
|
||||||
## BigQuery
|
## BigQuery
|
||||||
|
|
||||||
* `--prebuilt` value: `bigquery`
|
* `--prebuilt` value: `bigquery`
|
||||||
@@ -243,9 +280,9 @@ See [Usage Examples](../reference/cli.md#examples).
|
|||||||
* `get_query_plan`: Generate the execution plan of a statement.
|
* `get_query_plan`: Generate the execution plan of a statement.
|
||||||
* `list_views`: Lists views in the database from pg_views with a default
|
* `list_views`: Lists views in the database from pg_views with a default
|
||||||
limit of 50 rows. Returns schemaname, viewname and the ownername.
|
limit of 50 rows. Returns schemaname, viewname and the ownername.
|
||||||
* `list_schemas`: Lists schemas in the database.
|
* `list_schemas`: Lists schemas in the database.
|
||||||
* `database_overview`: Fetches the current state of the PostgreSQL server.
|
* `database_overview`: Fetches the current state of the PostgreSQL server.
|
||||||
* `list_triggers`: Lists triggers in the database.
|
* `list_triggers`: Lists triggers in the database.
|
||||||
* `list_indexes`: List available user indexes in a PostgreSQL database.
|
* `list_indexes`: List available user indexes in a PostgreSQL database.
|
||||||
* `list_sequences`: List sequences in a PostgreSQL database.
|
* `list_sequences`: List sequences in a PostgreSQL database.
|
||||||
* `list_publication_tables`: List publication tables in a PostgreSQL database.
|
* `list_publication_tables`: List publication tables in a PostgreSQL database.
|
||||||
@@ -253,7 +290,7 @@ See [Usage Examples](../reference/cli.md#examples).
|
|||||||
* `list_pg_settings`: List configuration parameters for the PostgreSQL server.
|
* `list_pg_settings`: List configuration parameters for the PostgreSQL server.
|
||||||
* `list_database_stats`: Lists the key performance and activity statistics for
|
* `list_database_stats`: Lists the key performance and activity statistics for
|
||||||
each database in the postgreSQL instance.
|
each database in the postgreSQL instance.
|
||||||
* `list_roles`: Lists all the user-created roles in PostgreSQL database.
|
* `list_roles`: Lists all the user-created roles in PostgreSQL database.
|
||||||
|
|
||||||
## Cloud SQL for PostgreSQL Observability
|
## Cloud SQL for PostgreSQL Observability
|
||||||
|
|
||||||
@@ -564,9 +601,9 @@ See [Usage Examples](../reference/cli.md#examples).
|
|||||||
* `get_query_plan`: Generate the execution plan of a statement.
|
* `get_query_plan`: Generate the execution plan of a statement.
|
||||||
* `list_views`: Lists views in the database from pg_views with a default
|
* `list_views`: Lists views in the database from pg_views with a default
|
||||||
limit of 50 rows. Returns schemaname, viewname and the ownername.
|
limit of 50 rows. Returns schemaname, viewname and the ownername.
|
||||||
* `list_schemas`: Lists schemas in the database.
|
* `list_schemas`: Lists schemas in the database.
|
||||||
* `database_overview`: Fetches the current state of the PostgreSQL server.
|
* `database_overview`: Fetches the current state of the PostgreSQL server.
|
||||||
* `list_triggers`: Lists triggers in the database.
|
* `list_triggers`: Lists triggers in the database.
|
||||||
* `list_indexes`: List available user indexes in a PostgreSQL database.
|
* `list_indexes`: List available user indexes in a PostgreSQL database.
|
||||||
* `list_sequences`: List sequences in a PostgreSQL database.
|
* `list_sequences`: List sequences in a PostgreSQL database.
|
||||||
* `list_publication_tables`: List publication tables in a PostgreSQL database.
|
* `list_publication_tables`: List publication tables in a PostgreSQL database.
|
||||||
@@ -574,7 +611,7 @@ See [Usage Examples](../reference/cli.md#examples).
|
|||||||
* `list_pg_settings`: List configuration parameters for the PostgreSQL server.
|
* `list_pg_settings`: List configuration parameters for the PostgreSQL server.
|
||||||
* `list_database_stats`: Lists the key performance and activity statistics for
|
* `list_database_stats`: Lists the key performance and activity statistics for
|
||||||
each database in the PostgreSQL server.
|
each database in the PostgreSQL server.
|
||||||
* `list_roles`: Lists all the user-created roles in PostgreSQL database.
|
* `list_roles`: Lists all the user-created roles in PostgreSQL database.
|
||||||
|
|
||||||
## Google Cloud Serverless for Apache Spark
|
## Google Cloud Serverless for Apache Spark
|
||||||
|
|
||||||
|
|||||||
@@ -28,17 +28,19 @@ The following configurations are placed at the top level of a `tools.yaml` file.
|
|||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
If you are accessing Toolbox with multiple applications, each
|
If you are accessing Toolbox with multiple applications, each
|
||||||
application should register their own Client ID even if they use the same
|
application should register their own Client ID even if they use the same
|
||||||
"kind" of auth provider.
|
"type" of auth provider.
|
||||||
{{< /notice >}}
|
{{< /notice >}}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
authServices:
|
kind: authServices
|
||||||
my_auth_app_1:
|
name: my_auth_app_1
|
||||||
kind: google
|
type: google
|
||||||
clientId: ${YOUR_CLIENT_ID_1}
|
clientId: ${YOUR_CLIENT_ID_1}
|
||||||
my_auth_app_2:
|
---
|
||||||
kind: google
|
kind: authServices
|
||||||
clientId: ${YOUR_CLIENT_ID_2}
|
name: my_auth_app_2
|
||||||
|
type: google
|
||||||
|
clientId: ${YOUR_CLIENT_ID_2}
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ id-token][provided-claims] can be used for the parameter.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
authServices:
|
kind: authServices
|
||||||
my-google-auth:
|
name: my-google-auth
|
||||||
kind: google
|
type: google
|
||||||
clientId: ${YOUR_GOOGLE_CLIENT_ID}
|
clientId: ${YOUR_GOOGLE_CLIENT_ID}
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -55,5 +55,5 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "google". |
|
| type | string | true | Must be "google". |
|
||||||
| clientId | string | true | Client ID of your application from registering your application. |
|
| clientId | string | true | Client ID of your application from registering your application. |
|
||||||
|
|||||||
@@ -54,12 +54,12 @@ ${ENV_NAME} instead of hardcoding your API keys into the configuration file.
|
|||||||
Define an embedding model in the `embeddingModels` section:
|
Define an embedding model in the `embeddingModels` section:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
embeddingModels:
|
kind: embeddingModels
|
||||||
gemini-model: # Name of the embedding model
|
name: gemini-model # Name of the embedding model
|
||||||
kind: gemini
|
type: gemini
|
||||||
model: gemini-embedding-001
|
model: gemini-embedding-001
|
||||||
apiKey: ${GOOGLE_API_KEY}
|
apiKey: ${GOOGLE_API_KEY}
|
||||||
dimension: 768
|
dimension: 768
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 2 - Embed Tool Parameters
|
### Step 2 - Embed Tool Parameters
|
||||||
@@ -68,38 +68,39 @@ Use the defined embedding model, embed your query parameters using the
|
|||||||
`embeddedBy` field. Only string-typed parameters can be embedded:
|
`embeddedBy` field. Only string-typed parameters can be embedded:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
# Vector ingestion tool
|
||||||
# Vector ingestion tool
|
kind: tools
|
||||||
insert_embedding:
|
name: insert_embedding
|
||||||
kind: postgres-sql
|
type: postgres-sql
|
||||||
source: my-pg-instance
|
source: my-pg-instance
|
||||||
statement: |
|
statement: |
|
||||||
INSERT INTO documents (content, embedding)
|
INSERT INTO documents (content, embedding)
|
||||||
VALUES ($1, $2);
|
VALUES ($1, $2);
|
||||||
parameters:
|
parameters:
|
||||||
- name: content
|
- name: content
|
||||||
type: string
|
type: string
|
||||||
description: The raw text content to be stored in the database.
|
description: The raw text content to be stored in the database.
|
||||||
- name: vector_string
|
- name: vector_string
|
||||||
type: string
|
type: string
|
||||||
# This parameter is hidden from the LLM.
|
# This parameter is hidden from the LLM.
|
||||||
# It automatically copies the value from 'content' and embeds it.
|
# It automatically copies the value from 'content' and embeds it.
|
||||||
valueFromParam: content
|
valueFromParam: content
|
||||||
embeddedBy: gemini-model
|
embeddedBy: gemini-model
|
||||||
|
---
|
||||||
# Semantic search tool
|
# Semantic search tool
|
||||||
search_embedding:
|
kind: tools
|
||||||
kind: postgres-sql
|
name: search_embedding
|
||||||
source: my-pg-instance
|
type: postgres-sql
|
||||||
statement: |
|
source: my-pg-instance
|
||||||
SELECT id, content, embedding <-> $1 AS distance
|
statement: |
|
||||||
FROM documents
|
SELECT id, content, embedding <-> $1 AS distance
|
||||||
ORDER BY distance LIMIT 1
|
FROM documents
|
||||||
parameters:
|
ORDER BY distance LIMIT 1
|
||||||
- name: semantic_search_string
|
parameters:
|
||||||
type: string
|
- name: semantic_search_string
|
||||||
description: The search query that will be converted to a vector.
|
type: string
|
||||||
embeddedBy: gemini-model # refers to the name of a defined embedding model
|
description: The search query that will be converted to a vector.
|
||||||
|
embeddedBy: gemini-model # refers to the name of a defined embedding model
|
||||||
```
|
```
|
||||||
|
|
||||||
## Kinds of Embedding Models
|
## Kinds of Embedding Models
|
||||||
|
|||||||
@@ -50,12 +50,12 @@ information.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
embeddingModels:
|
kind: embeddingModels
|
||||||
gemini-model:
|
name: gemini-model
|
||||||
kind: gemini
|
type: gemini
|
||||||
model: gemini-embedding-001
|
model: gemini-embedding-001
|
||||||
apiKey: ${GOOGLE_API_KEY}
|
apiKey: ${GOOGLE_API_KEY}
|
||||||
dimension: 768
|
dimension: 768
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -67,7 +67,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|--------------------------------------------------------------|
|
|-----------|:--------:|:------------:|--------------------------------------------------------------|
|
||||||
| kind | string | true | Must be `gemini`. |
|
| type | string | true | Must be `gemini`. |
|
||||||
| model | string | true | The Gemini model ID to use (e.g., `gemini-embedding-001`). |
|
| model | string | true | The Gemini model ID to use (e.g., `gemini-embedding-001`). |
|
||||||
| apiKey | string | false | Your API Key from Google AI Studio. |
|
| apiKey | string | false | Your API Key from Google AI Studio. |
|
||||||
| dimension | integer | false | The number of dimensions in the output vector (e.g., `768`). |
|
| dimension | integer | false | The number of dimensions in the output vector (e.g., `768`). |
|
||||||
|
|||||||
@@ -16,14 +16,14 @@ can be sent to a Large Language Model (LLM). The Toolbox server implements the
|
|||||||
specification, allowing clients to discover and retrieve these prompts.
|
specification, allowing clients to discover and retrieve these prompts.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
prompts:
|
kind: prompts
|
||||||
code_review:
|
name: code_review
|
||||||
description: "Asks the LLM to analyze code quality and suggest improvements."
|
description: "Asks the LLM to analyze code quality and suggest improvements."
|
||||||
messages:
|
messages:
|
||||||
- content: "Please review the following code for quality, correctness, and potential improvements: \n\n{{.code}}"
|
- content: "Please review the following code for quality, correctness, and potential improvements: \n\n{{.code}}"
|
||||||
arguments:
|
arguments:
|
||||||
- name: "code"
|
- name: "code"
|
||||||
description: "The code to review"
|
description: "The code to review"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Prompt Schema
|
## Prompt Schema
|
||||||
@@ -31,7 +31,7 @@ prompts:
|
|||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|--------------------------------|--------------|--------------------------------------------------------------------------|
|
|-------------|--------------------------------|--------------|--------------------------------------------------------------------------|
|
||||||
| description | string | No | A brief explanation of what the prompt does. |
|
| description | string | No | A brief explanation of what the prompt does. |
|
||||||
| kind | string | No | The kind of prompt. Defaults to `"custom"`. |
|
| type | string | No | The type of prompt. Defaults to `"custom"`. |
|
||||||
| messages | [][Message](#message-schema) | Yes | A list of one or more message objects that make up the prompt's content. |
|
| messages | [][Message](#message-schema) | Yes | A list of one or more message objects that make up the prompt's content. |
|
||||||
| arguments | [][Argument](#argument-schema) | No | A list of arguments that can be interpolated into the prompt's content. |
|
| arguments | [][Argument](#argument-schema) | No | A list of arguments that can be interpolated into the prompt's content. |
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ Here is an example of a simple prompt that takes a single argument, code, and
|
|||||||
asks an LLM to review it.
|
asks an LLM to review it.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
prompts:
|
kind: prompts
|
||||||
code_review:
|
name: code_review
|
||||||
description: "Asks the LLM to analyze code quality and suggest improvements."
|
description: "Asks the LLM to analyze code quality and suggest improvements."
|
||||||
messages:
|
messages:
|
||||||
- content: "Please review the following code for quality, correctness, and potential improvements: \n\n{{.code}}"
|
- content: "Please review the following code for quality, correctness, and potential improvements: \n\n{{.code}}"
|
||||||
arguments:
|
arguments:
|
||||||
- name: "code"
|
- name: "code"
|
||||||
description: "The code to review"
|
description: "The code to review"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Multi-message prompt
|
### Multi-message prompt
|
||||||
@@ -33,19 +33,19 @@ You can define prompts with multiple messages to set up more complex
|
|||||||
conversational contexts, like a role-playing scenario.
|
conversational contexts, like a role-playing scenario.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
prompts:
|
kind: prompts
|
||||||
roleplay_scenario:
|
name: roleplay_scenario
|
||||||
description: "Sets up a roleplaying scenario with initial messages."
|
description: "Sets up a roleplaying scenario with initial messages."
|
||||||
arguments:
|
arguments:
|
||||||
- name: "character"
|
- name: "character"
|
||||||
description: "The character the AI should embody."
|
description: "The character the AI should embody."
|
||||||
- name: "situation"
|
- name: "situation"
|
||||||
description: "The initial situation for the roleplay."
|
description: "The initial situation for the roleplay."
|
||||||
messages:
|
messages:
|
||||||
- role: "user"
|
- role: "user"
|
||||||
content: "Let's roleplay. You are {{.character}}. The situation is: {{.situation}}"
|
content: "Let's roleplay. You are {{.character}}. The situation is: {{.situation}}"
|
||||||
- role: "assistant"
|
- role: "assistant"
|
||||||
content: "Okay, I understand. I am ready. What happens next?"
|
content: "Okay, I understand. I am ready. What happens next?"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
@@ -54,7 +54,7 @@ prompts:
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|--------------------------------|--------------|--------------------------------------------------------------------------|
|
|-------------|--------------------------------|--------------|--------------------------------------------------------------------------|
|
||||||
| kind | string | No | The kind of prompt. Must be `"custom"`. |
|
| type | string | No | The type of prompt. Must be `"custom"`. |
|
||||||
| description | string | No | A brief explanation of what the prompt does. |
|
| description | string | No | A brief explanation of what the prompt does. |
|
||||||
| messages | [][Message](#message-schema) | Yes | A list of one or more message objects that make up the prompt's content. |
|
| messages | [][Message](#message-schema) | Yes | A list of one or more message objects that make up the prompt's content. |
|
||||||
| arguments | [][Argument](#argument-schema) | No | A list of arguments that can be interpolated into the prompt's content. |
|
| arguments | [][Argument](#argument-schema) | No | A list of arguments that can be interpolated into the prompt's content. |
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
{{< /notice >}}
|
{{< /notice >}}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-cloud-sql-source:
|
name: my-cloud-sql-source
|
||||||
kind: cloud-sql-postgres
|
type: cloud-sql-postgres
|
||||||
project: my-project-id
|
project: my-project-id
|
||||||
region: us-central1
|
region: us-central1
|
||||||
instance: my-instance-name
|
instance: my-instance-name
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
```
|
```
|
||||||
|
|
||||||
In implementation, each source is a different connection pool or client that used
|
In implementation, each source is a different connection pool or client that used
|
||||||
|
|||||||
@@ -25,19 +25,20 @@ Authentication can be handled in two ways:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-alloydb-admin:
|
name: my-alloydb-admin
|
||||||
kind: alloy-admin
|
type: alloydb-admin
|
||||||
|
---
|
||||||
my-oauth-alloydb-admin:
|
kind: sources
|
||||||
kind: alloydb-admin
|
name: my-oauth-alloydb-admin
|
||||||
useClientOAuth: true
|
type: alloydb-admin
|
||||||
|
useClientOAuth: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| -------------- | :------: | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
| -------------- | :------: | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| kind | string | true | Must be "alloydb-admin". |
|
| type | string | true | Must be "alloydb-admin". |
|
||||||
| defaultProject | string | false | The Google Cloud project ID to use for AlloyDB infrastructure tools. |
|
| defaultProject | string | false | The Google Cloud project ID to use for AlloyDB infrastructure tools. |
|
||||||
| useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. |
|
| useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. |
|
||||||
|
|||||||
@@ -176,17 +176,17 @@ To connect using IAM authentication:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-alloydb-pg-source:
|
name: my-alloydb-pg-source
|
||||||
kind: alloydb-postgres
|
type: alloydb-postgres
|
||||||
project: my-project-id
|
project: my-project-id
|
||||||
region: us-central1
|
region: us-central1
|
||||||
cluster: my-cluster
|
cluster: my-cluster
|
||||||
instance: my-instance
|
instance: my-instance
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
# ipType: "public"
|
# ipType: "public"
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -198,7 +198,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|--------------------------------------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|--------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "alloydb-postgres". |
|
| type | string | true | Must be "alloydb-postgres". |
|
||||||
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
||||||
| region | string | true | Name of the GCP region that the cluster was created in (e.g. "us-central1"). |
|
| region | string | true | Name of the GCP region that the cluster was created in (e.g. "us-central1"). |
|
||||||
| cluster | string | true | Name of the AlloyDB cluster (e.g. "my-cluster"). |
|
| cluster | string | true | Name of the AlloyDB cluster (e.g. "my-cluster"). |
|
||||||
|
|||||||
@@ -121,47 +121,47 @@ identity used has been granted the correct IAM permissions.
|
|||||||
Initialize a BigQuery source that uses ADC:
|
Initialize a BigQuery source that uses ADC:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-bigquery-source:
|
name: my-bigquery-source
|
||||||
kind: "bigquery"
|
type: "bigquery"
|
||||||
project: "my-project-id"
|
project: "my-project-id"
|
||||||
# location: "US" # Optional: Specifies the location for query jobs.
|
# location: "US" # Optional: Specifies the location for query jobs.
|
||||||
# writeMode: "allowed" # One of: allowed, blocked, protected. Defaults to "allowed".
|
# writeMode: "allowed" # One of: allowed, blocked, protected. Defaults to "allowed".
|
||||||
# allowedDatasets: # Optional: Restricts tool access to a specific list of datasets.
|
# allowedDatasets: # Optional: Restricts tool access to a specific list of datasets.
|
||||||
# - "my_dataset_1"
|
# - "my_dataset_1"
|
||||||
# - "other_project.my_dataset_2"
|
# - "other_project.my_dataset_2"
|
||||||
# impersonateServiceAccount: "service-account@project-id.iam.gserviceaccount.com" # Optional: Service account to impersonate
|
# impersonateServiceAccount: "service-account@project-id.iam.gserviceaccount.com" # Optional: Service account to impersonate
|
||||||
# scopes: # Optional: List of OAuth scopes to request.
|
# scopes: # Optional: List of OAuth scopes to request.
|
||||||
# - "https://www.googleapis.com/auth/bigquery"
|
# - "https://www.googleapis.com/auth/bigquery"
|
||||||
# - "https://www.googleapis.com/auth/drive.readonly"
|
# - "https://www.googleapis.com/auth/drive.readonly"
|
||||||
# maxQueryResultRows: 50 # Optional: Limits the number of rows returned by queries. Defaults to 50.
|
# maxQueryResultRows: 50 # Optional: Limits the number of rows returned by queries. Defaults to 50.
|
||||||
```
|
```
|
||||||
|
|
||||||
Initialize a BigQuery source that uses the client's access token:
|
Initialize a BigQuery source that uses the client's access token:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-bigquery-client-auth-source:
|
name: my-bigquery-client-auth-source
|
||||||
kind: "bigquery"
|
type: "bigquery"
|
||||||
project: "my-project-id"
|
project: "my-project-id"
|
||||||
useClientOAuth: true
|
useClientOAuth: true
|
||||||
# location: "US" # Optional: Specifies the location for query jobs.
|
# location: "US" # Optional: Specifies the location for query jobs.
|
||||||
# writeMode: "allowed" # One of: allowed, blocked, protected. Defaults to "allowed".
|
# writeMode: "allowed" # One of: allowed, blocked, protected. Defaults to "allowed".
|
||||||
# allowedDatasets: # Optional: Restricts tool access to a specific list of datasets.
|
# allowedDatasets: # Optional: Restricts tool access to a specific list of datasets.
|
||||||
# - "my_dataset_1"
|
# - "my_dataset_1"
|
||||||
# - "other_project.my_dataset_2"
|
# - "other_project.my_dataset_2"
|
||||||
# impersonateServiceAccount: "service-account@project-id.iam.gserviceaccount.com" # Optional: Service account to impersonate
|
# impersonateServiceAccount: "service-account@project-id.iam.gserviceaccount.com" # Optional: Service account to impersonate
|
||||||
# scopes: # Optional: List of OAuth scopes to request.
|
# scopes: # Optional: List of OAuth scopes to request.
|
||||||
# - "https://www.googleapis.com/auth/bigquery"
|
# - "https://www.googleapis.com/auth/bigquery"
|
||||||
# - "https://www.googleapis.com/auth/drive.readonly"
|
# - "https://www.googleapis.com/auth/drive.readonly"
|
||||||
# maxQueryResultRows: 50 # Optional: Limits the number of rows returned by queries. Defaults to 50.
|
# maxQueryResultRows: 50 # Optional: Limits the number of rows returned by queries. Defaults to 50.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|---------------------------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|---------------------------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "bigquery". |
|
| type | string | true | Must be "bigquery". |
|
||||||
| project | string | true | Id of the Google Cloud project to use for billing and as the default project for BigQuery resources. |
|
| project | string | true | Id of the Google Cloud project to use for billing and as the default project for BigQuery resources. |
|
||||||
| location | string | false | Specifies the location (e.g., 'us', 'asia-northeast1') in which to run the query job. This location must match the location of any tables referenced in the query. Defaults to the table's location or 'US' if the location cannot be determined. [Learn More](https://cloud.google.com/bigquery/docs/locations) |
|
| location | string | false | Specifies the location (e.g., 'us', 'asia-northeast1') in which to run the query job. This location must match the location of any tables referenced in the query. Defaults to the table's location or 'US' if the location cannot be determined. [Learn More](https://cloud.google.com/bigquery/docs/locations) |
|
||||||
| writeMode | string | false | Controls the write behavior for tools. `allowed` (default): All queries are permitted. `blocked`: Only `SELECT` statements are allowed for the `bigquery-execute-sql` tool. `protected`: Enables session-based execution where all tools associated with this source instance share the same [BigQuery session](https://cloud.google.com/bigquery/docs/sessions-intro). This allows for stateful operations using temporary tables (e.g., `CREATE TEMP TABLE`). For `bigquery-execute-sql`, `SELECT` statements can be used on all tables, but write operations are restricted to the session's temporary dataset. For tools like `bigquery-sql`, `bigquery-forecast`, and `bigquery-analyze-contribution`, the `writeMode` restrictions do not apply, but they will operate within the shared session. **Note:** The `protected` mode cannot be used with `useClientOAuth: true`. It is also not recommended for multi-user server environments, as all users would share the same session. A session is terminated automatically after 24 hours of inactivity or after 7 days, whichever comes first. A new session is created on the next request, and any temporary data from the previous session will be lost. |
|
| writeMode | string | false | Controls the write behavior for tools. `allowed` (default): All queries are permitted. `blocked`: Only `SELECT` statements are allowed for the `bigquery-execute-sql` tool. `protected`: Enables session-based execution where all tools associated with this source instance share the same [BigQuery session](https://cloud.google.com/bigquery/docs/sessions-intro). This allows for stateful operations using temporary tables (e.g., `CREATE TEMP TABLE`). For `bigquery-execute-sql`, `SELECT` statements can be used on all tables, but write operations are restricted to the session's temporary dataset. For tools like `bigquery-sql`, `bigquery-forecast`, and `bigquery-analyze-contribution`, the `writeMode` restrictions do not apply, but they will operate within the shared session. **Note:** The `protected` mode cannot be used with `useClientOAuth: true`. It is also not recommended for multi-user server environments, as all users would share the same session. A session is terminated automatically after 24 hours of inactivity or after 7 days, whichever comes first. A new session is created on the next request, and any temporary data from the previous session will be lost. |
|
||||||
|
|||||||
@@ -59,17 +59,17 @@ applying IAM permissions and roles to an identity.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-bigtable-source:
|
name: my-bigtable-source
|
||||||
kind: "bigtable"
|
type: "bigtable"
|
||||||
project: "my-project-id"
|
project: "my-project-id"
|
||||||
instance: "test-instance"
|
instance: "test-instance"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|-------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|-------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "bigtable". |
|
| type | string | true | Must be "bigtable". |
|
||||||
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
||||||
| instance | string | true | Name of the Bigtable instance. |
|
| instance | string | true | Name of the Bigtable instance. |
|
||||||
|
|||||||
@@ -23,19 +23,19 @@ distributed architectures, and a flexible approach to schema definition.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-cassandra-source:
|
name: my-cassandra-source
|
||||||
kind: cassandra
|
type: cassandra
|
||||||
hosts:
|
hosts:
|
||||||
- 127.0.0.1
|
- 127.0.0.1
|
||||||
keyspace: my_keyspace
|
keyspace: my_keyspace
|
||||||
protoVersion: 4
|
protoVersion: 4
|
||||||
username: ${USER_NAME}
|
username: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
caPath: /path/to/ca.crt # Optional: path to CA certificate
|
caPath: /path/to/ca.crt # Optional: path to CA certificate
|
||||||
certPath: /path/to/client.crt # Optional: path to client certificate
|
certPath: /path/to/client.crt # Optional: path to client certificate
|
||||||
keyPath: /path/to/client.key # Optional: path to client key
|
keyPath: /path/to/client.key # Optional: path to client key
|
||||||
enableHostVerification: true # Optional: enable host verification
|
enableHostVerification: true # Optional: enable host verification
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -47,7 +47,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|------------------------|:--------:|:------------:|----------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------|:--------:|:------------:|----------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "cassandra". |
|
| type | string | true | Must be "cassandra". |
|
||||||
| hosts | string[] | true | List of IP addresses to connect to (e.g., ["192.168.1.1:9042", "192.168.1.2:9042","192.168.1.3:9042"]). The default port is 9042 if not specified. |
|
| hosts | string[] | true | List of IP addresses to connect to (e.g., ["192.168.1.1:9042", "192.168.1.2:9042","192.168.1.3:9042"]). The default port is 9042 if not specified. |
|
||||||
| keyspace | string | true | Name of the Cassandra keyspace to connect to (e.g., "my_keyspace"). |
|
| keyspace | string | true | Name of the Cassandra keyspace to connect to (e.g., "my_keyspace"). |
|
||||||
| protoVersion | integer | false | Protocol version for the Cassandra connection (e.g., 4). |
|
| protoVersion | integer | false | Protocol version for the Cassandra connection (e.g., 4). |
|
||||||
|
|||||||
@@ -46,31 +46,31 @@ ClickHouse supports multiple protocols:
|
|||||||
### Secure Connection Example
|
### Secure Connection Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
secure-clickhouse-source:
|
name: secure-clickhouse-source
|
||||||
kind: clickhouse
|
type: clickhouse
|
||||||
host: clickhouse.example.com
|
host: clickhouse.example.com
|
||||||
port: "8443"
|
port: "8443"
|
||||||
database: analytics
|
database: analytics
|
||||||
user: ${CLICKHOUSE_USER}
|
user: ${CLICKHOUSE_USER}
|
||||||
password: ${CLICKHOUSE_PASSWORD}
|
password: ${CLICKHOUSE_PASSWORD}
|
||||||
protocol: https
|
protocol: https
|
||||||
secure: true
|
secure: true
|
||||||
```
|
```
|
||||||
|
|
||||||
### HTTP Protocol Example
|
### HTTP Protocol Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
http-clickhouse-source:
|
name: http-clickhouse-source
|
||||||
kind: clickhouse
|
type: clickhouse
|
||||||
host: localhost
|
host: localhost
|
||||||
port: "8123"
|
port: "8123"
|
||||||
database: logs
|
database: logs
|
||||||
user: ${CLICKHOUSE_USER}
|
user: ${CLICKHOUSE_USER}
|
||||||
password: ${CLICKHOUSE_PASSWORD}
|
password: ${CLICKHOUSE_PASSWORD}
|
||||||
protocol: http
|
protocol: http
|
||||||
secure: false
|
secure: false
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -82,7 +82,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|-------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|-------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "clickhouse". |
|
| type | string | true | Must be "clickhouse". |
|
||||||
| host | string | true | IP address or hostname to connect to (e.g. "127.0.0.1" or "clickhouse.example.com") |
|
| host | string | true | IP address or hostname to connect to (e.g. "127.0.0.1" or "clickhouse.example.com") |
|
||||||
| port | string | true | Port to connect to (e.g. "8443" for HTTPS, "8123" for HTTP) |
|
| port | string | true | Port to connect to (e.g. "8443" for HTTPS, "8123" for HTTP) |
|
||||||
| database | string | true | Name of the ClickHouse database to connect to (e.g. "my_database"). |
|
| database | string | true | Name of the ClickHouse database to connect to (e.g. "my_database"). |
|
||||||
|
|||||||
@@ -20,21 +20,22 @@ Authentication can be handled in two ways:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-gda-source:
|
name: my-gda-source
|
||||||
kind: cloud-gemini-data-analytics
|
type: cloud-gemini-data-analytics
|
||||||
projectId: my-project-id
|
projectId: my-project-id
|
||||||
|
---
|
||||||
my-oauth-gda-source:
|
kind: sources
|
||||||
kind: cloud-gemini-data-analytics
|
name: my-oauth-gda-source
|
||||||
projectId: my-project-id
|
type: cloud-gemini-data-analytics
|
||||||
useClientOAuth: true
|
projectId: my-project-id
|
||||||
|
useClientOAuth: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| -------------- | :------: | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| -------------- | :------: | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| kind | string | true | Must be "cloud-gemini-data-analytics". |
|
| type | string | true | Must be "cloud-gemini-data-analytics". |
|
||||||
| projectId | string | true | The Google Cloud Project ID where the API is enabled. |
|
| projectId | string | true | The Google Cloud Project ID where the API is enabled. |
|
||||||
| useClientOAuth | boolean | false | If true, the source uses the token provided by the caller (forwarded to the API). Otherwise, it uses server-side Application Default Credentials (ADC). Defaults to `false`. |
|
| useClientOAuth | boolean | false | If true, the source uses the token provided by the caller (forwarded to the API). Otherwise, it uses server-side Application Default Credentials (ADC). Defaults to `false`. |
|
||||||
|
|||||||
@@ -123,41 +123,41 @@ identity used has been granted the correct IAM permissions.
|
|||||||
Initialize a Cloud Healthcare API source that uses ADC:
|
Initialize a Cloud Healthcare API source that uses ADC:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-healthcare-source:
|
name: my-healthcare-source
|
||||||
kind: "cloud-healthcare"
|
type: "cloud-healthcare"
|
||||||
project: "my-project-id"
|
project: "my-project-id"
|
||||||
region: "us-central1"
|
region: "us-central1"
|
||||||
dataset: "my-healthcare-dataset-id"
|
dataset: "my-healthcare-dataset-id"
|
||||||
# allowedFhirStores: # Optional: Restricts tool access to a specific list of FHIR store IDs.
|
# allowedFhirStores: # Optional: Restricts tool access to a specific list of FHIR store IDs.
|
||||||
# - "my_fhir_store_1"
|
# - "my_fhir_store_1"
|
||||||
# allowedDicomStores: # Optional: Restricts tool access to a specific list of DICOM store IDs.
|
# allowedDicomStores: # Optional: Restricts tool access to a specific list of DICOM store IDs.
|
||||||
# - "my_dicom_store_1"
|
# - "my_dicom_store_1"
|
||||||
# - "my_dicom_store_2"
|
# - "my_dicom_store_2"
|
||||||
```
|
```
|
||||||
|
|
||||||
Initialize a Cloud Healthcare API source that uses the client's access token:
|
Initialize a Cloud Healthcare API source that uses the client's access token:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-healthcare-client-auth-source:
|
name: my-healthcare-client-auth-source
|
||||||
kind: "cloud-healthcare"
|
type: "cloud-healthcare"
|
||||||
project: "my-project-id"
|
project: "my-project-id"
|
||||||
region: "us-central1"
|
region: "us-central1"
|
||||||
dataset: "my-healthcare-dataset-id"
|
dataset: "my-healthcare-dataset-id"
|
||||||
useClientOAuth: true
|
useClientOAuth: true
|
||||||
# allowedFhirStores: # Optional: Restricts tool access to a specific list of FHIR store IDs.
|
# allowedFhirStores: # Optional: Restricts tool access to a specific list of FHIR store IDs.
|
||||||
# - "my_fhir_store_1"
|
# - "my_fhir_store_1"
|
||||||
# allowedDicomStores: # Optional: Restricts tool access to a specific list of DICOM store IDs.
|
# allowedDicomStores: # Optional: Restricts tool access to a specific list of DICOM store IDs.
|
||||||
# - "my_dicom_store_1"
|
# - "my_dicom_store_1"
|
||||||
# - "my_dicom_store_2"
|
# - "my_dicom_store_2"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|--------------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|--------------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "cloud-healthcare". |
|
| type | string | true | Must be "cloud-healthcare". |
|
||||||
| project | string | true | ID of the GCP project that the dataset lives in. |
|
| project | string | true | ID of the GCP project that the dataset lives in. |
|
||||||
| region | string | true | Specifies the region (e.g., 'us', 'asia-northeast1') of the healthcare dataset. [Learn More](https://cloud.google.com/healthcare-api/docs/regions) |
|
| region | string | true | Specifies the region (e.g., 'us', 'asia-northeast1') of the healthcare dataset. [Learn More](https://cloud.google.com/healthcare-api/docs/regions) |
|
||||||
| dataset | string | true | ID of the healthcare dataset. |
|
| dataset | string | true | ID of the healthcare dataset. |
|
||||||
|
|||||||
71
docs/en/resources/sources/cloud-logging-admin.md
Normal file
71
docs/en/resources/sources/cloud-logging-admin.md
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
---
|
||||||
|
title: "Cloud Logging Admin"
|
||||||
|
type: docs
|
||||||
|
weight: 1
|
||||||
|
description: >
|
||||||
|
The Cloud Logging Admin source enables tools to interact with the Cloud Logging API, allowing for the retrieval of log names, monitored resource types, and the querying of log data.
|
||||||
|
---
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
The Cloud Logging Admin source provides a client to interact with the [Google
|
||||||
|
Cloud Logging API](https://cloud.google.com/logging/docs). This allows tools to list log names, monitored resource types, and query log entries.
|
||||||
|
|
||||||
|
Authentication can be handled in two ways:
|
||||||
|
|
||||||
|
1. **Application Default Credentials (ADC):** By default, the source uses ADC
|
||||||
|
to authenticate with the API.
|
||||||
|
2. **Client-side OAuth:** If `useClientOAuth` is set to `true`, the source will
|
||||||
|
expect an OAuth 2.0 access token to be provided by the client (e.g., a web
|
||||||
|
browser) for each request.
|
||||||
|
|
||||||
|
## Available Tools
|
||||||
|
|
||||||
|
- [`cloud-logging-admin-list-log-names`](../tools/cloudloggingadmin/cloud-logging-admin-list-log-names.md)
|
||||||
|
Lists the log names in the project.
|
||||||
|
|
||||||
|
- [`cloud-logging-admin-list-resource-types`](../tools/cloudloggingadmin/cloud-logging-admin-list-resource-types.md)
|
||||||
|
Lists the monitored resource types.
|
||||||
|
|
||||||
|
- [`cloud-logging-admin-query-logs`](../tools/cloudloggingadmin/cloud-logging-admin-query-logs.md)
|
||||||
|
Queries log entries.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
Initialize a Cloud Logging Admin source that uses ADC:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
kind: sources
|
||||||
|
name: my-cloud-logging
|
||||||
|
type: cloud-logging-admin
|
||||||
|
project: my-project-id
|
||||||
|
```
|
||||||
|
|
||||||
|
Initialize a Cloud Logging Admin source that uses client-side OAuth:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
kind: sources
|
||||||
|
name: my-oauth-cloud-logging
|
||||||
|
type: cloud-logging-admin
|
||||||
|
project: my-project-id
|
||||||
|
useClientOAuth: true
|
||||||
|
```
|
||||||
|
|
||||||
|
Initialize a Cloud Logging Admin source that uses service account impersonation:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
kind: sources
|
||||||
|
name: my-impersonated-cloud-logging
|
||||||
|
type: cloud-logging-admin
|
||||||
|
project: my-project-id
|
||||||
|
impersonateServiceAccount: "my-service-account@my-project.iam.gserviceaccount.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
|
||||||
|
| **field** | **type** | **required** | **description** |
|
||||||
|
|-----------------------------|:--------:|:------------:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| type | string | true | Must be "cloud-logging-admin". |
|
||||||
|
| project | string | true | ID of the GCP project. |
|
||||||
|
| useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. Cannot be used with `impersonateServiceAccount`. |
|
||||||
|
| impersonateServiceAccount | string | false | The service account to impersonate for API calls. Cannot be used with `useClientOAuth`. |
|
||||||
@@ -25,18 +25,19 @@ Authentication can be handled in two ways:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-cloud-monitoring:
|
name: my-cloud-monitoring
|
||||||
kind: cloud-monitoring
|
type: cloud-monitoring
|
||||||
|
---
|
||||||
my-oauth-cloud-monitoring:
|
kind: sources
|
||||||
kind: cloud-monitoring
|
name: my-oauth-cloud-monitoring
|
||||||
useClientOAuth: true
|
type: cloud-monitoring
|
||||||
|
useClientOAuth: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|----------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------|
|
|----------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "cloud-monitoring". |
|
| type | string | true | Must be "cloud-monitoring". |
|
||||||
| useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. |
|
| useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. |
|
||||||
|
|||||||
@@ -24,19 +24,20 @@ Authentication can be handled in two ways:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-cloud-sql-admin:
|
name: my-cloud-sql-admin
|
||||||
kind: cloud-sql-admin
|
type: cloud-sql-admin
|
||||||
|
---
|
||||||
my-oauth-cloud-sql-admin:
|
kind: sources
|
||||||
kind: cloud-sql-admin
|
name: my-oauth-cloud-sql-admin
|
||||||
useClientOAuth: true
|
type: cloud-sql-admin
|
||||||
|
useClientOAuth: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| -------------- | :------: | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
| -------------- | :------: | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| kind | string | true | Must be "cloud-sql-admin". |
|
| type | string | true | Must be "cloud-sql-admin". |
|
||||||
| defaultProject | string | false | The Google Cloud project ID to use for Cloud SQL infrastructure tools. |
|
| defaultProject | string | false | The Google Cloud project ID to use for Cloud SQL infrastructure tools. |
|
||||||
| useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. |
|
| useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. |
|
||||||
|
|||||||
@@ -87,16 +87,16 @@ Currently, this source only uses standard authentication. You will need to
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-cloud-sql-mssql-instance:
|
name: my-cloud-sql-mssql-instance
|
||||||
kind: cloud-sql-mssql
|
type: cloud-sql-mssql
|
||||||
project: my-project
|
project: my-project
|
||||||
region: my-region
|
region: my-region
|
||||||
instance: my-instance
|
instance: my-instance
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
# ipType: private
|
# ipType: private
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -108,7 +108,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|------------------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "cloud-sql-mssql". |
|
| type | string | true | Must be "cloud-sql-mssql". |
|
||||||
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
||||||
| region | string | true | Name of the GCP region that the cluster was created in (e.g. "us-central1"). |
|
| region | string | true | Name of the GCP region that the cluster was created in (e.g. "us-central1"). |
|
||||||
| instance | string | true | Name of the Cloud SQL instance within the cluster (e.g. "my-instance"). |
|
| instance | string | true | Name of the Cloud SQL instance within the cluster (e.g. "my-instance"). |
|
||||||
|
|||||||
@@ -128,16 +128,16 @@ To connect using IAM authentication:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-cloud-sql-mysql-source:
|
name: my-cloud-sql-mysql-source
|
||||||
kind: cloud-sql-mysql
|
type: cloud-sql-mysql
|
||||||
project: my-project-id
|
project: my-project-id
|
||||||
region: us-central1
|
region: us-central1
|
||||||
instance: my-instance
|
instance: my-instance
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
# ipType: "private"
|
# ipType: "private"
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -149,7 +149,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|------------------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "cloud-sql-mysql". |
|
| type | string | true | Must be "cloud-sql-mysql". |
|
||||||
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
||||||
| region | string | true | Name of the GCP region that the cluster was created in (e.g. "us-central1"). |
|
| region | string | true | Name of the GCP region that the cluster was created in (e.g. "us-central1"). |
|
||||||
| instance | string | true | Name of the Cloud SQL instance within the cluster (e.g. "my-instance"). |
|
| instance | string | true | Name of the Cloud SQL instance within the cluster (e.g. "my-instance"). |
|
||||||
|
|||||||
@@ -178,16 +178,16 @@ To connect using IAM authentication:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-cloud-sql-pg-source:
|
name: my-cloud-sql-pg-source
|
||||||
kind: cloud-sql-postgres
|
type: cloud-sql-postgres
|
||||||
project: my-project-id
|
project: my-project-id
|
||||||
region: us-central1
|
region: us-central1
|
||||||
instance: my-instance
|
instance: my-instance
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
# ipType: "private"
|
# ipType: "private"
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -199,7 +199,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|--------------------------------------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|--------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "cloud-sql-postgres". |
|
| type | string | true | Must be "cloud-sql-postgres". |
|
||||||
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
||||||
| region | string | true | Name of the GCP region that the cluster was created in (e.g. "us-central1"). |
|
| region | string | true | Name of the GCP region that the cluster was created in (e.g. "us-central1"). |
|
||||||
| instance | string | true | Name of the Cloud SQL instance within the cluster (e.g. "my-instance"). |
|
| instance | string | true | Name of the Cloud SQL instance within the cluster (e.g. "my-instance"). |
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ allowing tools to execute SQL queries against it.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-couchbase-instance:
|
name: my-couchbase-instance
|
||||||
kind: couchbase
|
type: couchbase
|
||||||
connectionString: couchbase://localhost
|
connectionString: couchbase://localhost
|
||||||
bucket: travel-sample
|
bucket: travel-sample
|
||||||
scope: inventory
|
scope: inventory
|
||||||
username: Administrator
|
username: Administrator
|
||||||
password: password
|
password: password
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice note >}}
|
{{< notice note >}}
|
||||||
@@ -38,7 +38,7 @@ Connections](https://docs.couchbase.com/java-sdk/current/howtos/managing-connect
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|----------------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|----------------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "couchbase". |
|
| type | string | true | Must be "couchbase". |
|
||||||
| connectionString | string | true | Connection string for the Couchbase cluster. |
|
| connectionString | string | true | Connection string for the Couchbase cluster. |
|
||||||
| bucket | string | true | Name of the bucket to connect to. |
|
| bucket | string | true | Name of the bucket to connect to. |
|
||||||
| scope | string | true | Name of the scope within the bucket. |
|
| scope | string | true | Name of the scope within the bucket. |
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ applying artificial intelligence and machine learning.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-dataplex-source:
|
name: my-dataplex-source
|
||||||
kind: "dataplex"
|
type: "dataplex"
|
||||||
project: "my-project-id"
|
project: "my-project-id"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Sample System Prompt
|
## Sample System Prompt
|
||||||
@@ -355,5 +355,5 @@ This abbreviated syntax works for the qualified predicates except for `label` in
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|----------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|----------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "dataplex". |
|
| type | string | true | Must be "dataplex". |
|
||||||
| project | string | true | ID of the GCP project used for quota and billing purposes (e.g. "my-project-id").|
|
| project | string | true | ID of the GCP project used for quota and billing purposes (e.g. "my-project-id").|
|
||||||
|
|||||||
@@ -51,14 +51,14 @@ and user credentials for that namespace.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-dgraph-source:
|
name: my-dgraph-source
|
||||||
kind: dgraph
|
type: dgraph
|
||||||
dgraphUrl: https://xxxx.cloud.dgraph.io
|
dgraphUrl: https://xxxx.cloud.dgraph.io
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
apiKey: ${API_KEY}
|
apiKey: ${API_KEY}
|
||||||
namespace : 0
|
namespace : 0
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -70,7 +70,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **Field** | **Type** | **Required** | **Description** |
|
| **Field** | **Type** | **Required** | **Description** |
|
||||||
|-------------|:--------:|:------------:|--------------------------------------------------------------------------------------------------|
|
|-------------|:--------:|:------------:|--------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "dgraph". |
|
| type | string | true | Must be "dgraph". |
|
||||||
| dgraphUrl | string | true | Connection URI (e.g. "<https://xxx.cloud.dgraph.io>", "<https://localhost:8080>"). |
|
| dgraphUrl | string | true | Connection URI (e.g. "<https://xxx.cloud.dgraph.io>", "<https://localhost:8080>"). |
|
||||||
| user | string | false | Name of the Dgraph user to connect as (e.g., "groot"). |
|
| user | string | false | Name of the Dgraph user to connect as (e.g., "groot"). |
|
||||||
| password | string | false | Password of the Dgraph user (e.g., "password"). |
|
| password | string | false | Password of the Dgraph user (e.g., "password"). |
|
||||||
|
|||||||
@@ -59,18 +59,18 @@ applying permissions to an API key.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-elasticsearch-source:
|
name: my-elasticsearch-source
|
||||||
kind: "elasticsearch"
|
type: "elasticsearch"
|
||||||
addresses:
|
addresses:
|
||||||
- "http://localhost:9200"
|
- "http://localhost:9200"
|
||||||
apikey: "my-api-key"
|
apikey: "my-api-key"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|--------------------------------------------|
|
|-----------|:--------:|:------------:|--------------------------------------------|
|
||||||
| kind | string | true | Must be "elasticsearch". |
|
| type | string | true | Must be "elasticsearch". |
|
||||||
| addresses | []string | true | List of Elasticsearch hosts to connect to. |
|
| addresses | []string | true | List of Elasticsearch hosts to connect to. |
|
||||||
| apikey | string | true | The API key to use for authentication. |
|
| apikey | string | true | The API key to use for authentication. |
|
||||||
|
|||||||
@@ -36,14 +36,14 @@ user][fb-users] to login to the database with.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my_firebird_db:
|
name: my_firebird_db
|
||||||
kind: firebird
|
type: firebird
|
||||||
host: "localhost"
|
host: "localhost"
|
||||||
port: 3050
|
port: 3050
|
||||||
database: "/path/to/your/database.fdb"
|
database: "/path/to/your/database.fdb"
|
||||||
user: ${FIREBIRD_USER}
|
user: ${FIREBIRD_USER}
|
||||||
password: ${FIREBIRD_PASS}
|
password: ${FIREBIRD_PASS}
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -55,7 +55,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "firebird". |
|
| type | string | true | Must be "firebird". |
|
||||||
| host | string | true | IP address to connect to (e.g. "127.0.0.1") |
|
| host | string | true | IP address to connect to (e.g. "127.0.0.1") |
|
||||||
| port | string | true | Port to connect to (e.g. "3050") |
|
| port | string | true | Port to connect to (e.g. "3050") |
|
||||||
| database | string | true | Path to the Firebird database file (e.g. "/var/lib/firebird/data/test.fdb"). |
|
| database | string | true | Path to the Firebird database file (e.g. "/var/lib/firebird/data/test.fdb"). |
|
||||||
|
|||||||
@@ -61,17 +61,17 @@ database named `(default)` will be used.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-firestore-source:
|
name: my-firestore-source
|
||||||
kind: "firestore"
|
type: "firestore"
|
||||||
project: "my-project-id"
|
project: "my-project-id"
|
||||||
# database: "my-database" # Optional, defaults to "(default)"
|
# database: "my-database" # Optional, defaults to "(default)"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|----------------------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|----------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "firestore". |
|
| type | string | true | Must be "firestore". |
|
||||||
| project | string | true | Id of the GCP project that contains the Firestore database (e.g. "my-project-id"). |
|
| project | string | true | Id of the GCP project that contains the Firestore database (e.g. "my-project-id"). |
|
||||||
| database | string | false | Name of the Firestore database to connect to. Defaults to "(default)" if not specified. |
|
| database | string | false | Name of the Firestore database to connect to. Defaults to "(default)" if not specified. |
|
||||||
|
|||||||
@@ -21,18 +21,18 @@ and other HTTP-accessible resources.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-http-source:
|
name: my-http-source
|
||||||
kind: http
|
type: http
|
||||||
baseUrl: https://api.example.com/data
|
baseUrl: https://api.example.com/data
|
||||||
timeout: 10s # default to 30s
|
timeout: 10s # default to 30s
|
||||||
headers:
|
headers:
|
||||||
Authorization: Bearer ${API_KEY}
|
Authorization: Bearer ${API_KEY}
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
queryParams:
|
queryParams:
|
||||||
param1: value1
|
param1: value1
|
||||||
param2: value2
|
param2: value2
|
||||||
# disableSslVerification: false
|
# disableSslVerification: false
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -44,7 +44,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|------------------------|:-----------------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------|:-----------------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "http". |
|
| type | string | true | Must be "http". |
|
||||||
| baseUrl | string | true | The base URL for the HTTP requests (e.g., `https://api.example.com`). |
|
| baseUrl | string | true | The base URL for the HTTP requests (e.g., `https://api.example.com`). |
|
||||||
| timeout | string | false | The timeout for HTTP requests (e.g., "5s", "1m", refer to [ParseDuration][parse-duration-doc] for more examples). Defaults to 30s. |
|
| timeout | string | false | The timeout for HTTP requests (e.g., "5s", "1m", refer to [ParseDuration][parse-duration-doc] for more examples). Defaults to 30s. |
|
||||||
| headers | map[string]string | false | Default headers to include in the HTTP requests. |
|
| headers | map[string]string | false | Default headers to include in the HTTP requests. |
|
||||||
|
|||||||
@@ -56,16 +56,16 @@ To initialize the application default credential run `gcloud auth login
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-looker-source:
|
name: my-looker-source
|
||||||
kind: looker
|
type: looker
|
||||||
base_url: http://looker.example.com
|
base_url: http://looker.example.com
|
||||||
client_id: ${LOOKER_CLIENT_ID}
|
client_id: ${LOOKER_CLIENT_ID}
|
||||||
client_secret: ${LOOKER_CLIENT_SECRET}
|
client_secret: ${LOOKER_CLIENT_SECRET}
|
||||||
project: ${LOOKER_PROJECT}
|
project: ${LOOKER_PROJECT}
|
||||||
location: ${LOOKER_LOCATION}
|
location: ${LOOKER_LOCATION}
|
||||||
verify_ssl: true
|
verify_ssl: true
|
||||||
timeout: 600s
|
timeout: 600s
|
||||||
```
|
```
|
||||||
|
|
||||||
The Looker base url will look like "https://looker.example.com", don't include
|
The Looker base url will look like "https://looker.example.com", don't include
|
||||||
@@ -93,7 +93,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|----------------------|:--------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------|
|
|----------------------|:--------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "looker". |
|
| type | string | true | Must be "looker". |
|
||||||
| base_url | string | true | The URL of your Looker server with no trailing /. |
|
| base_url | string | true | The URL of your Looker server with no trailing /. |
|
||||||
| client_id | string | false | The client id assigned by Looker. |
|
| client_id | string | false | The client id assigned by Looker. |
|
||||||
| client_secret | string | false | The client secret assigned by Looker. |
|
| client_secret | string | false | The client secret assigned by Looker. |
|
||||||
|
|||||||
@@ -45,18 +45,18 @@ MariaDB user][mariadb-users] to log in to the database.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my_mariadb_db:
|
name: my_mariadb_db
|
||||||
kind: mysql
|
type: mysql
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 3306
|
port: 3306
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${MARIADB_USER}
|
user: ${MARIADB_USER}
|
||||||
password: ${MARIADB_PASS}
|
password: ${MARIADB_PASS}
|
||||||
# Optional TLS and other driver parameters. For example, enable preferred TLS:
|
# Optional TLS and other driver parameters. For example, enable preferred TLS:
|
||||||
# queryParams:
|
# queryParams:
|
||||||
# tls: preferred
|
# tls: preferred
|
||||||
queryTimeout: 30s # Optional: query timeout duration
|
queryTimeout: 30s # Optional: query timeout duration
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -68,7 +68,7 @@ Use environment variables instead of committing credentials to source files.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ------------ | :------: | :----------: | ----------------------------------------------------------------------------------------------- |
|
| ------------ | :------: | :----------: | ----------------------------------------------------------------------------------------------- |
|
||||||
| kind | string | true | Must be `mysql`. |
|
| type | string | true | Must be `mysql`. |
|
||||||
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
||||||
| port | string | true | Port to connect to (e.g. "3307"). |
|
| port | string | true | Port to connect to (e.g. "3307"). |
|
||||||
| database | string | true | Name of the MariaDB database to connect to (e.g. "my_db"). |
|
| database | string | true | Name of the MariaDB database to connect to (e.g. "my_db"). |
|
||||||
|
|||||||
@@ -125,15 +125,15 @@ can omit the password field.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-mindsdb-source:
|
name: my-mindsdb-source
|
||||||
kind: mindsdb
|
type: mindsdb
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 3306
|
port: 3306
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD} # Optional: omit if MindsDB is configured without authentication
|
password: ${PASSWORD} # Optional: omit if MindsDB is configured without authentication
|
||||||
queryTimeout: 30s # Optional: query timeout duration
|
queryTimeout: 30s # Optional: query timeout duration
|
||||||
```
|
```
|
||||||
|
|
||||||
### Working Configuration Example
|
### Working Configuration Example
|
||||||
@@ -141,13 +141,13 @@ sources:
|
|||||||
Here's a working configuration that has been tested:
|
Here's a working configuration that has been tested:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-pg-source:
|
name: my-pg-source
|
||||||
kind: mindsdb
|
type: mindsdb
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 47335
|
port: 47335
|
||||||
database: files
|
database: files
|
||||||
user: mindsdb
|
user: mindsdb
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -176,7 +176,7 @@ With MindsDB integration, you can:
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|--------------|:--------:|:------------:|--------------------------------------------------------------------------------------------------------------|
|
|--------------|:--------:|:------------:|--------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "mindsdb". |
|
| type | string | true | Must be "mindsdb". |
|
||||||
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
||||||
| port | string | true | Port to connect to (e.g. "3306"). |
|
| port | string | true | Port to connect to (e.g. "3306"). |
|
||||||
| database | string | true | Name of the MindsDB database to connect to (e.g. "my_db"). |
|
| database | string | true | Name of the MindsDB database to connect to (e.g. "my_db"). |
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ flexible, JSON-like documents, making it easy to develop and scale applications.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-mongodb:
|
name: my-mongodb
|
||||||
kind: mongodb
|
type: mongodb
|
||||||
uri: "mongodb+srv://username:password@host.mongodb.net"
|
uri: "mongodb+srv://username:password@host.mongodb.net"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -28,5 +28,5 @@ sources:
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|-------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|-------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "mongodb". |
|
| type | string | true | Must be "mongodb". |
|
||||||
| uri | string | true | connection string to connect to MongoDB |
|
| uri | string | true | connection string to connect to MongoDB |
|
||||||
|
|||||||
@@ -39,15 +39,15 @@ SQL Server user][mssql-users] to login to the database with.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-mssql-source:
|
name: my-mssql-source
|
||||||
kind: mssql
|
type: mssql
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 1433
|
port: 1433
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
# encrypt: strict
|
# encrypt: strict
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -59,7 +59,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "mssql". |
|
| type | string | true | Must be "mssql". |
|
||||||
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
||||||
| port | string | true | Port to connect to (e.g. "1433"). |
|
| port | string | true | Port to connect to (e.g. "1433"). |
|
||||||
| database | string | true | Name of the SQL Server database to connect to (e.g. "my_db"). |
|
| database | string | true | Name of the SQL Server database to connect to (e.g. "my_db"). |
|
||||||
|
|||||||
@@ -49,18 +49,18 @@ MySQL user][mysql-users] to login to the database with.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-mysql-source:
|
name: my-mysql-source
|
||||||
kind: mysql
|
type: mysql
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 3306
|
port: 3306
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
# Optional TLS and other driver parameters. For example, enable preferred TLS:
|
# Optional TLS and other driver parameters. For example, enable preferred TLS:
|
||||||
# queryParams:
|
# queryParams:
|
||||||
# tls: preferred
|
# tls: preferred
|
||||||
queryTimeout: 30s # Optional: query timeout duration
|
queryTimeout: 30s # Optional: query timeout duration
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -72,7 +72,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ------------ | :------: | :----------: | ----------------------------------------------------------------------------------------------- |
|
| ------------ | :------: | :----------: | ----------------------------------------------------------------------------------------------- |
|
||||||
| kind | string | true | Must be "mysql". |
|
| type | string | true | Must be "mysql". |
|
||||||
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
||||||
| port | string | true | Port to connect to (e.g. "3306"). |
|
| port | string | true | Port to connect to (e.g. "3306"). |
|
||||||
| database | string | true | Name of the MySQL database to connect to (e.g. "my_db"). |
|
| database | string | true | Name of the MySQL database to connect to (e.g. "my_db"). |
|
||||||
|
|||||||
@@ -33,13 +33,13 @@ user if available.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-neo4j-source:
|
name: my-neo4j-source
|
||||||
kind: neo4j
|
type: neo4j
|
||||||
uri: neo4j+s://xxxx.databases.neo4j.io:7687
|
uri: neo4j+s://xxxx.databases.neo4j.io:7687
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
database: "neo4j"
|
database: "neo4j"
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -51,7 +51,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|----------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|----------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "neo4j". |
|
| type | string | true | Must be "neo4j". |
|
||||||
| uri | string | true | Connect URI ("bolt://localhost", "neo4j+s://xxx.databases.neo4j.io") |
|
| uri | string | true | Connect URI ("bolt://localhost", "neo4j+s://xxx.databases.neo4j.io") |
|
||||||
| user | string | true | Name of the Neo4j user to connect as (e.g. "neo4j"). |
|
| user | string | true | Name of the Neo4j user to connect as (e.g. "neo4j"). |
|
||||||
| password | string | true | Password of the Neo4j user (e.g. "my-password"). |
|
| password | string | true | Password of the Neo4j user (e.g. "my-password"). |
|
||||||
|
|||||||
@@ -33,15 +33,15 @@ with SSL).
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-oceanbase-source:
|
name: my-oceanbase-source
|
||||||
kind: oceanbase
|
type: oceanbase
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 2881
|
port: 2881
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
queryTimeout: 30s # Optional: query timeout duration
|
queryTimeout: 30s # Optional: query timeout duration
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -53,7 +53,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ------------ | :------: | :----------: |-------------------------------------------------------------------------------------------------|
|
| ------------ | :------: | :----------: |-------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "oceanbase". |
|
| type | string | true | Must be "oceanbase". |
|
||||||
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
||||||
| port | string | true | Port to connect to (e.g. "2881"). |
|
| port | string | true | Port to connect to (e.g. "2881"). |
|
||||||
| database | string | true | Name of the OceanBase database to connect to (e.g. "my_db"). |
|
| database | string | true | Name of the OceanBase database to connect to (e.g. "my_db"). |
|
||||||
|
|||||||
@@ -90,27 +90,27 @@ using a TNS (Transparent Network Substrate) alias.
|
|||||||
This example demonstrates the four connection methods you could choose from:
|
This example demonstrates the four connection methods you could choose from:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-oracle-source:
|
name: my-oracle-source
|
||||||
kind: oracle
|
type: oracle
|
||||||
|
|
||||||
# --- Choose one connection method ---
|
|
||||||
# 1. Host, Port, and Service Name
|
|
||||||
host: 127.0.0.1
|
|
||||||
port: 1521
|
|
||||||
serviceName: XEPDB1
|
|
||||||
|
|
||||||
# 2. Direct Connection String
|
# --- Choose one connection method ---
|
||||||
connectionString: "127.0.0.1:1521/XEPDB1"
|
# 1. Host, Port, and Service Name
|
||||||
|
host: 127.0.0.1
|
||||||
|
port: 1521
|
||||||
|
serviceName: XEPDB1
|
||||||
|
|
||||||
# 3. TNS Alias (requires tnsnames.ora)
|
# 2. Direct Connection String
|
||||||
tnsAlias: "MY_DB_ALIAS"
|
connectionString: "127.0.0.1:1521/XEPDB1"
|
||||||
tnsAdmin: "/opt/oracle/network/admin" # Optional: overrides TNS_ADMIN env var
|
|
||||||
|
|
||||||
user: ${USER_NAME}
|
# 3. TNS Alias (requires tnsnames.ora)
|
||||||
password: ${PASSWORD}
|
tnsAlias: "MY_DB_ALIAS"
|
||||||
|
tnsAdmin: "/opt/oracle/network/admin" # Optional: overrides TNS_ADMIN env var
|
||||||
|
|
||||||
# Optional: Set to true to use the OCI-based driver for advanced features (Requires Oracle Instant Client)
|
user: ${USER_NAME}
|
||||||
|
password: ${PASSWORD}
|
||||||
|
|
||||||
|
# Optional: Set to true to use the OCI-based driver for advanced features (Requires Oracle Instant Client)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using an Oracle Wallet
|
### Using an Oracle Wallet
|
||||||
@@ -122,15 +122,15 @@ Oracle Wallet allows you to store credentails used for database connection. Depe
|
|||||||
The `go-ora` driver uses the `walletLocation` field to connect to a database secured with an Oracle Wallet without standard username and password.
|
The `go-ora` driver uses the `walletLocation` field to connect to a database secured with an Oracle Wallet without standard username and password.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
pure-go-wallet:
|
name: pure-go-wallet
|
||||||
kind: oracle
|
type: oracle
|
||||||
connectionString: "127.0.0.1:1521/XEPDB1"
|
connectionString: "127.0.0.1:1521/XEPDB1"
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
# The TNS Alias is often required to connect to a service registered in tnsnames.ora
|
# The TNS Alias is often required to connect to a service registered in tnsnames.ora
|
||||||
tnsAlias: "SECURE_DB_ALIAS"
|
tnsAlias: "SECURE_DB_ALIAS"
|
||||||
walletLocation: "/path/to/my/wallet/directory"
|
walletLocation: "/path/to/my/wallet/directory"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### OCI-Based Driver (`useOCI: true`) - Oracle Wallet
|
#### OCI-Based Driver (`useOCI: true`) - Oracle Wallet
|
||||||
@@ -138,15 +138,15 @@ sources:
|
|||||||
For the OCI-based driver, wallet authentication is triggered by setting tnsAdmin to the wallet directory and connecting via a tnsAlias.
|
For the OCI-based driver, wallet authentication is triggered by setting tnsAdmin to the wallet directory and connecting via a tnsAlias.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
oci-wallet:
|
name: oci-wallet
|
||||||
kind: oracle
|
type: oracle
|
||||||
connectionString: "127.0.0.1:1521/XEPDB1"
|
connectionString: "127.0.0.1:1521/XEPDB1"
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
tnsAlias: "WALLET_DB_ALIAS"
|
tnsAlias: "WALLET_DB_ALIAS"
|
||||||
tnsAdmin: "/opt/oracle/wallet" # Directory containing tnsnames.ora, sqlnet.ora, and wallet files
|
tnsAdmin: "/opt/oracle/wallet" # Directory containing tnsnames.ora, sqlnet.ora, and wallet files
|
||||||
useOCI: true
|
useOCI: true
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -158,7 +158,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|------------------|:--------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------|:--------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "oracle". |
|
| type | string | true | Must be "oracle". |
|
||||||
| user | string | true | Name of the Oracle user to connect as (e.g. "my-oracle-user"). |
|
| user | string | true | Name of the Oracle user to connect as (e.g. "my-oracle-user"). |
|
||||||
| password | string | true | Password of the Oracle user (e.g. "my-password"). |
|
| password | string | true | Password of the Oracle user (e.g. "my-password"). |
|
||||||
| host | string | false | IP address or hostname to connect to (e.g. "127.0.0.1"). Required if not using `connectionString` or `tnsAlias`. |
|
| host | string | false | IP address or hostname to connect to (e.g. "127.0.0.1"). Required if not using `connectionString` or `tnsAlias`. |
|
||||||
|
|||||||
@@ -107,14 +107,14 @@ PostgreSQL user][pg-users] to login to the database with.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-pg-source:
|
name: my-pg-source
|
||||||
kind: postgres
|
type: postgres
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 5432
|
port: 5432
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -126,7 +126,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|:------------------:|:------------:|------------------------------------------------------------------------|
|
|-------------|:------------------:|:------------:|------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "postgres". |
|
| type | string | true | Must be "postgres". |
|
||||||
| host | string | true | IP address to connect to (e.g. "127.0.0.1") |
|
| host | string | true | IP address to connect to (e.g. "127.0.0.1") |
|
||||||
| port | string | true | Port to connect to (e.g. "5432") |
|
| port | string | true | Port to connect to (e.g. "5432") |
|
||||||
| database | string | true | Name of the Postgres database to connect to (e.g. "my_db"). |
|
| database | string | true | Name of the Postgres database to connect to (e.g. "my_db"). |
|
||||||
|
|||||||
@@ -34,16 +34,16 @@ connections must authenticate in order to connect.
|
|||||||
Specify your AUTH string in the password field:
|
Specify your AUTH string in the password field:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-redis-instance:
|
name: my-redis-instance
|
||||||
kind: redis
|
type: redis
|
||||||
address:
|
address:
|
||||||
- 127.0.0.1:6379
|
- 127.0.0.1:6379
|
||||||
username: ${MY_USER_NAME}
|
username: ${MY_USER_NAME}
|
||||||
password: ${MY_AUTH_STRING} # Omit this field if you don't have a password.
|
password: ${MY_AUTH_STRING} # Omit this field if you don't have a password.
|
||||||
# database: 0
|
# database: 0
|
||||||
# clusterEnabled: false
|
# clusterEnabled: false
|
||||||
# useGCPIAM: false
|
# useGCPIAM: false
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -59,14 +59,14 @@ string.
|
|||||||
Here is an example tools.yaml config with [AUTH][auth] enabled:
|
Here is an example tools.yaml config with [AUTH][auth] enabled:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-redis-cluster-instance:
|
name: my-redis-cluster-instance
|
||||||
kind: memorystore-redis
|
type: memorystore-redis
|
||||||
address:
|
address:
|
||||||
- 127.0.0.1:6379
|
- 127.0.0.1:6379
|
||||||
password: ${MY_AUTH_STRING}
|
password: ${MY_AUTH_STRING}
|
||||||
# useGCPIAM: false
|
# useGCPIAM: false
|
||||||
# clusterEnabled: false
|
# clusterEnabled: false
|
||||||
```
|
```
|
||||||
|
|
||||||
Memorystore Redis Cluster supports IAM authentication instead. Grant your
|
Memorystore Redis Cluster supports IAM authentication instead. Grant your
|
||||||
@@ -76,13 +76,13 @@ Here is an example tools.yaml config for Memorystore Redis Cluster instances
|
|||||||
using IAM authentication:
|
using IAM authentication:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-redis-cluster-instance:
|
name: my-redis-cluster-instance
|
||||||
kind: memorystore-redis
|
type: memorystore-redis
|
||||||
address:
|
address:
|
||||||
- 127.0.0.1:6379
|
- 127.0.0.1:6379
|
||||||
useGCPIAM: true
|
useGCPIAM: true
|
||||||
clusterEnabled: true
|
clusterEnabled: true
|
||||||
```
|
```
|
||||||
|
|
||||||
[iam]: https://cloud.google.com/memorystore/docs/cluster/about-iam-auth
|
[iam]: https://cloud.google.com/memorystore/docs/cluster/about-iam-auth
|
||||||
@@ -91,7 +91,7 @@ sources:
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|----------------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------------------|
|
|----------------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "memorystore-redis". |
|
| type | string | true | Must be "memorystore-redis". |
|
||||||
| address | string | true | Primary endpoint for the Memorystore Redis instance to connect to. |
|
| address | string | true | Primary endpoint for the Memorystore Redis instance to connect to. |
|
||||||
| username | string | false | If you are using a non-default user, specify the user name here. If you are using Memorystore for Redis, leave this field blank |
|
| username | string | false | If you are using a non-default user, specify the user name here. If you are using Memorystore for Redis, leave this field blank |
|
||||||
| password | string | false | If you have [Redis AUTH][auth] enabled, specify the AUTH string here |
|
| password | string | false | If you have [Redis AUTH][auth] enabled, specify the AUTH string here |
|
||||||
|
|||||||
@@ -49,17 +49,17 @@ set up your ADC.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-serverless-spark-source:
|
name: my-serverless-spark-source
|
||||||
kind: serverless-spark
|
type: serverless-spark
|
||||||
project: my-project-id
|
project: my-project-id
|
||||||
location: us-central1
|
location: us-central1
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| --------- | :------: | :----------: | ----------------------------------------------------------------- |
|
| --------- | :------: | :----------: | ----------------------------------------------------------------- |
|
||||||
| kind | string | true | Must be "serverless-spark". |
|
| type | string | true | Must be "serverless-spark". |
|
||||||
| project | string | true | ID of the GCP project with Serverless for Apache Spark resources. |
|
| project | string | true | ID of the GCP project with Serverless for Apache Spark resources. |
|
||||||
| location | string | true | Location containing Serverless for Apache Spark resources. |
|
| location | string | true | Location containing Serverless for Apache Spark resources. |
|
||||||
|
|||||||
@@ -39,15 +39,15 @@ database user][singlestore-user] to login to the database with.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-singlestore-source:
|
name: my-singlestore-source
|
||||||
kind: singlestore
|
type: singlestore
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 3306
|
port: 3306
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
queryTimeout: 30s # Optional: query timeout duration
|
queryTimeout: 30s # Optional: query timeout duration
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -59,7 +59,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|--------------|:--------:|:------------:|-------------------------------------------------------------------------------------------------|
|
|--------------|:--------:|:------------:|-------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "singlestore". |
|
| type | string | true | Must be "singlestore". |
|
||||||
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
| host | string | true | IP address to connect to (e.g. "127.0.0.1"). |
|
||||||
| port | string | true | Port to connect to (e.g. "3306"). |
|
| port | string | true | Port to connect to (e.g. "3306"). |
|
||||||
| database | string | true | Name of the SingleStore database to connect to (e.g. "my_db"). |
|
| database | string | true | Name of the SingleStore database to connect to (e.g. "my_db"). |
|
||||||
|
|||||||
@@ -31,16 +31,16 @@ Snowflake user to login to the database with.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-sf-source:
|
name: my-sf-source
|
||||||
kind: snowflake
|
type: snowflake
|
||||||
account: ${SNOWFLAKE_ACCOUNT}
|
account: ${SNOWFLAKE_ACCOUNT}
|
||||||
user: ${SNOWFLAKE_USER}
|
user: ${SNOWFLAKE_USER}
|
||||||
password: ${SNOWFLAKE_PASSWORD}
|
password: ${SNOWFLAKE_PASSWORD}
|
||||||
database: ${SNOWFLAKE_DATABASE}
|
database: ${SNOWFLAKE_DATABASE}
|
||||||
schema: ${SNOWFLAKE_SCHEMA}
|
schema: ${SNOWFLAKE_SCHEMA}
|
||||||
warehouse: ${SNOWFLAKE_WAREHOUSE}
|
warehouse: ${SNOWFLAKE_WAREHOUSE}
|
||||||
role: ${SNOWFLAKE_ROLE}
|
role: ${SNOWFLAKE_ROLE}
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -52,7 +52,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "snowflake". |
|
| type | string | true | Must be "snowflake". |
|
||||||
| account | string | true | Your Snowflake account identifier. |
|
| account | string | true | Your Snowflake account identifier. |
|
||||||
| user | string | true | Name of the Snowflake user to connect as (e.g. "my-sf-user"). |
|
| user | string | true | Name of the Snowflake user to connect as (e.g. "my-sf-user"). |
|
||||||
| password | string | true | Password of the Snowflake user (e.g. "my-password"). |
|
| password | string | true | Password of the Snowflake user (e.g. "my-password"). |
|
||||||
|
|||||||
@@ -64,20 +64,20 @@ applying IAM permissions and roles to an identity.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-spanner-source:
|
name: my-spanner-source
|
||||||
kind: "spanner"
|
type: "spanner"
|
||||||
project: "my-project-id"
|
project: "my-project-id"
|
||||||
instance: "my-instance"
|
instance: "my-instance"
|
||||||
database: "my_db"
|
database: "my_db"
|
||||||
# dialect: "googlesql"
|
# dialect: "googlesql"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "spanner". |
|
| type | string | true | Must be "spanner". |
|
||||||
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
| project | string | true | Id of the GCP project that the cluster was created in (e.g. "my-project-id"). |
|
||||||
| instance | string | true | Name of the Spanner instance. |
|
| instance | string | true | Name of the Spanner instance. |
|
||||||
| database | string | true | Name of the database on the Spanner instance |
|
| database | string | true | Name of the database on the Spanner instance |
|
||||||
|
|||||||
@@ -48,19 +48,19 @@ You need a SQLite database file. This can be:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-sqlite-db:
|
name: my-sqlite-db
|
||||||
kind: "sqlite"
|
type: "sqlite"
|
||||||
database: "/path/to/database.db"
|
database: "/path/to/database.db"
|
||||||
```
|
```
|
||||||
|
|
||||||
For an in-memory database:
|
For an in-memory database:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-sqlite-memory-db:
|
name: my-sqlite-memory-db
|
||||||
kind: "sqlite"
|
type: "sqlite"
|
||||||
database: ":memory:"
|
database: ":memory:"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
@@ -69,7 +69,7 @@ sources:
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|---------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "sqlite". |
|
| type | string | true | Must be "sqlite". |
|
||||||
| database | string | true | Path to SQLite database file, or ":memory:" for an in-memory database. |
|
| database | string | true | Path to SQLite database file, or ":memory:" for an in-memory database. |
|
||||||
|
|
||||||
### Connection Properties
|
### Connection Properties
|
||||||
|
|||||||
@@ -46,29 +46,29 @@ console.
|
|||||||
- TiDB Cloud
|
- TiDB Cloud
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-tidb-cloud-source:
|
name: my-tidb-cloud-source
|
||||||
kind: tidb
|
type: tidb
|
||||||
host: gateway01.us-west-2.prod.aws.tidbcloud.com
|
host: gateway01.us-west-2.prod.aws.tidbcloud.com
|
||||||
port: 4000
|
port: 4000
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${TIDB_USERNAME}
|
user: ${TIDB_USERNAME}
|
||||||
password: ${TIDB_PASSWORD}
|
password: ${TIDB_PASSWORD}
|
||||||
# SSL is automatically enabled for TiDB Cloud
|
# SSL is automatically enabled for TiDB Cloud
|
||||||
```
|
```
|
||||||
|
|
||||||
- Self-Hosted TiDB
|
- Self-Hosted TiDB
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-tidb-source:
|
name: my-tidb-source
|
||||||
kind: tidb
|
type: tidb
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 4000
|
port: 4000
|
||||||
database: my_db
|
database: my_db
|
||||||
user: ${TIDB_USERNAME}
|
user: ${TIDB_USERNAME}
|
||||||
password: ${TIDB_PASSWORD}
|
password: ${TIDB_PASSWORD}
|
||||||
# ssl: true # Optional: enable SSL for secure connections
|
# ssl: true # Optional: enable SSL for secure connections
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -80,7 +80,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-----------|:--------:|:------------:|--------------------------------------------------------------------------------------------|
|
|-----------|:--------:|:------------:|--------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "tidb". |
|
| type | string | true | Must be "tidb". |
|
||||||
| host | string | true | IP address or hostname to connect to (e.g. "127.0.0.1" or "gateway01.*.tidbcloud.com"). |
|
| host | string | true | IP address or hostname to connect to (e.g. "127.0.0.1" or "gateway01.*.tidbcloud.com"). |
|
||||||
| port | string | true | Port to connect to (typically "4000" for TiDB). |
|
| port | string | true | Port to connect to (typically "4000" for TiDB). |
|
||||||
| database | string | true | Name of the TiDB database to connect to (e.g. "my_db"). |
|
| database | string | true | Name of the TiDB database to connect to (e.g. "my_db"). |
|
||||||
|
|||||||
@@ -32,15 +32,15 @@ the catalogs and schemas you want to query.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-trino-source:
|
name: my-trino-source
|
||||||
kind: trino
|
type: trino
|
||||||
host: trino.example.com
|
host: trino.example.com
|
||||||
port: "8080"
|
port: "8080"
|
||||||
user: ${TRINO_USER} # Optional for anonymous access
|
user: ${TRINO_USER} # Optional for anonymous access
|
||||||
password: ${TRINO_PASSWORD} # Optional
|
password: ${TRINO_PASSWORD} # Optional
|
||||||
catalog: hive
|
catalog: hive
|
||||||
schema: default
|
schema: default
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -52,7 +52,7 @@ instead of hardcoding your secrets into the configuration file.
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ---------------------- | :------: | :----------: | ---------------------------------------------------------------------------- |
|
| ---------------------- | :------: | :----------: | ---------------------------------------------------------------------------- |
|
||||||
| kind | string | true | Must be "trino". |
|
| type | string | true | Must be "trino". |
|
||||||
| host | string | true | Trino coordinator hostname (e.g. "trino.example.com") |
|
| host | string | true | Trino coordinator hostname (e.g. "trino.example.com") |
|
||||||
| port | string | true | Trino coordinator port (e.g. "8080", "8443") |
|
| port | string | true | Trino coordinator port (e.g. "8080", "8443") |
|
||||||
| user | string | false | Username for authentication (e.g. "analyst"). Optional for anonymous access. |
|
| user | string | false | Username for authentication (e.g. "analyst"). Optional for anonymous access. |
|
||||||
|
|||||||
@@ -27,16 +27,16 @@ the [official Valkey website](https://valkey.io/topics/quickstart/).
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-valkey-instance:
|
name: my-valkey-instance
|
||||||
kind: valkey
|
type: valkey
|
||||||
address:
|
address:
|
||||||
- 127.0.0.1:6379
|
- 127.0.0.1:6379
|
||||||
username: ${YOUR_USERNAME}
|
username: ${YOUR_USERNAME}
|
||||||
password: ${YOUR_PASSWORD}
|
password: ${YOUR_PASSWORD}
|
||||||
# database: 0
|
# database: 0
|
||||||
# useGCPIAM: false
|
# useGCPIAM: false
|
||||||
# disableCache: false
|
# disableCache: false
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< notice tip >}}
|
{{< notice tip >}}
|
||||||
@@ -51,12 +51,12 @@ authentication. Grant your account the required [IAM role][iam] and set
|
|||||||
`useGCPIAM` to `true`:
|
`useGCPIAM` to `true`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-valkey-instance:
|
name: my-valkey-instance
|
||||||
kind: valkey
|
type: valkey
|
||||||
address:
|
address:
|
||||||
- 127.0.0.1:6379
|
- 127.0.0.1:6379
|
||||||
useGCPIAM: true
|
useGCPIAM: true
|
||||||
```
|
```
|
||||||
|
|
||||||
[iam]: https://cloud.google.com/memorystore/docs/valkey/about-iam-auth
|
[iam]: https://cloud.google.com/memorystore/docs/valkey/about-iam-auth
|
||||||
@@ -65,7 +65,7 @@ sources:
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|--------------|:--------:|:------------:|----------------------------------------------------------------------------------------------------------------------------------|
|
|--------------|:--------:|:------------:|----------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "valkey". |
|
| type | string | true | Must be "valkey". |
|
||||||
| address | []string | true | Endpoints for the Valkey instance to connect to. |
|
| address | []string | true | Endpoints for the Valkey instance to connect to. |
|
||||||
| username | string | false | If you are using a non-default user, specify the user name here. If you are using Memorystore for Valkey, leave this field blank |
|
| username | string | false | If you are using a non-default user, specify the user name here. If you are using Memorystore for Valkey, leave this field blank |
|
||||||
| password | string | false | Password for the Valkey instance |
|
| password | string | false | Password for the Valkey instance |
|
||||||
|
|||||||
@@ -17,23 +17,23 @@ compatibility.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sources:
|
kind: sources
|
||||||
my-yb-source:
|
name: my-yb-source
|
||||||
kind: yugabytedb
|
type: yugabytedb
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 5433
|
port: 5433
|
||||||
database: yugabyte
|
database: yugabyte
|
||||||
user: ${USER_NAME}
|
user: ${USER_NAME}
|
||||||
password: ${PASSWORD}
|
password: ${PASSWORD}
|
||||||
loadBalance: true
|
loadBalance: true
|
||||||
topologyKeys: cloud.region.zone1:1,cloud.region.zone2:2
|
topologyKeys: cloud.region.zone1:1,cloud.region.zone2:2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|------------------------------|:--------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------------|:--------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "yugabytedb". |
|
| type | string | true | Must be "yugabytedb". |
|
||||||
| host | string | true | IP address to connect to. |
|
| host | string | true | IP address to connect to. |
|
||||||
| port | integer | true | Port to connect to. The default port is 5433. |
|
| port | integer | true | Port to connect to. The default port is 5433. |
|
||||||
| database | string | true | Name of the YugabyteDB database to connect to. The default database name is yugabyte. |
|
| database | string | true | Name of the YugabyteDB database to connect to. The default database name is yugabyte. |
|
||||||
|
|||||||
@@ -12,41 +12,41 @@ statement. You can define Tools as a map in the `tools` section of your
|
|||||||
`tools.yaml` file. Typically, a tool will require a source to act on:
|
`tools.yaml` file. Typically, a tool will require a source to act on:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
search_flights_by_number:
|
name: search_flights_by_number
|
||||||
kind: postgres-sql
|
type: postgres-sql
|
||||||
source: my-pg-instance
|
source: my-pg-instance
|
||||||
statement: |
|
statement: |
|
||||||
SELECT * FROM flights
|
SELECT * FROM flights
|
||||||
WHERE airline = $1
|
WHERE airline = $1
|
||||||
AND flight_number = $2
|
AND flight_number = $2
|
||||||
LIMIT 10
|
LIMIT 10
|
||||||
description: |
|
description: |
|
||||||
Use this tool to get information for a specific flight.
|
Use this tool to get information for a specific flight.
|
||||||
Takes an airline code and flight number and returns info on the flight.
|
Takes an airline code and flight number and returns info on the flight.
|
||||||
Do NOT use this tool with a flight id. Do NOT guess an airline code or flight number.
|
Do NOT use this tool with a flight id. Do NOT guess an airline code or flight number.
|
||||||
An airline code is a code for an airline service consisting of a two-character
|
An airline code is a code for an airline service consisting of a two-character
|
||||||
airline designator and followed by a flight number, which is a 1 to 4 digit number.
|
airline designator and followed by a flight number, which is a 1 to 4 digit number.
|
||||||
For example, if given CY 0123, the airline is "CY", and flight_number is "123".
|
For example, if given CY 0123, the airline is "CY", and flight_number is "123".
|
||||||
Another example for this is DL 1234, the airline is "DL", and flight_number is "1234".
|
Another example for this is DL 1234, the airline is "DL", and flight_number is "1234".
|
||||||
If the tool returns more than one option choose the date closest to today.
|
If the tool returns more than one option choose the date closest to today.
|
||||||
Example:
|
Example:
|
||||||
{{
|
{{
|
||||||
"airline": "CY",
|
"airline": "CY",
|
||||||
"flight_number": "888",
|
"flight_number": "888",
|
||||||
}}
|
}}
|
||||||
Example:
|
Example:
|
||||||
{{
|
{{
|
||||||
"airline": "DL",
|
"airline": "DL",
|
||||||
"flight_number": "1234",
|
"flight_number": "1234",
|
||||||
}}
|
}}
|
||||||
parameters:
|
parameters:
|
||||||
- name: airline
|
- name: airline
|
||||||
type: string
|
type: string
|
||||||
description: Airline unique 2 letter identifier
|
description: Airline unique 2 letter identifier
|
||||||
- name: flight_number
|
- name: flight_number
|
||||||
type: string
|
type: string
|
||||||
description: 1 to 4 digit number
|
description: 1 to 4 digit number
|
||||||
```
|
```
|
||||||
|
|
||||||
## Specifying Parameters
|
## Specifying Parameters
|
||||||
@@ -55,13 +55,13 @@ Parameters for each Tool will define what inputs the agent will need to provide
|
|||||||
to invoke them. Parameters should be pass as a list of Parameter objects:
|
to invoke them. Parameters should be pass as a list of Parameter objects:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
parameters:
|
parameters:
|
||||||
- name: airline
|
- name: airline
|
||||||
type: string
|
type: string
|
||||||
description: Airline unique 2 letter identifier
|
description: Airline unique 2 letter identifier
|
||||||
- name: flight_number
|
- name: flight_number
|
||||||
type: string
|
type: string
|
||||||
description: 1 to 4 digit number
|
description: 1 to 4 digit number
|
||||||
```
|
```
|
||||||
|
|
||||||
### Basic Parameters
|
### Basic Parameters
|
||||||
@@ -71,10 +71,10 @@ most cases, the description will be provided to the LLM as context on specifying
|
|||||||
the parameter.
|
the parameter.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
parameters:
|
parameters:
|
||||||
- name: airline
|
- name: airline
|
||||||
type: string
|
type: string
|
||||||
description: Airline unique 2 letter identifier
|
description: Airline unique 2 letter identifier
|
||||||
```
|
```
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
@@ -97,16 +97,16 @@ To use the `array` type, you must also specify what kind of items are
|
|||||||
in the list using the items field:
|
in the list using the items field:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
parameters:
|
parameters:
|
||||||
- name: preferred_airlines
|
- name: preferred_airlines
|
||||||
type: array
|
type: array
|
||||||
description: A list of airline, ordered by preference.
|
description: A list of airline, ordered by preference.
|
||||||
items:
|
items:
|
||||||
name: name
|
name: name
|
||||||
type: string
|
type: string
|
||||||
description: Name of the airline.
|
description: Name of the airline.
|
||||||
statement: |
|
statement: |
|
||||||
SELECT * FROM airlines WHERE preferred_airlines = ANY($1);
|
SELECT * FROM airlines WHERE preferred_airlines = ANY($1);
|
||||||
```
|
```
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
@@ -141,10 +141,10 @@ This is the default behavior when valueType is omitted. It's useful for passing
|
|||||||
a flexible group of settings.
|
a flexible group of settings.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
parameters:
|
parameters:
|
||||||
- name: execution_context
|
- name: execution_context
|
||||||
type: map
|
type: map
|
||||||
description: A flexible set of key-value pairs for the execution environment.
|
description: A flexible set of key-value pairs for the execution environment.
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Typed Map
|
#### Typed Map
|
||||||
@@ -153,11 +153,11 @@ Specify valueType to ensure all values in the map are of the same type. An error
|
|||||||
will be thrown in case of value type mismatch.
|
will be thrown in case of value type mismatch.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
parameters:
|
parameters:
|
||||||
- name: user_scores
|
- name: user_scores
|
||||||
type: map
|
type: map
|
||||||
description: A map of user IDs to their scores. All scores must be integers.
|
description: A map of user IDs to their scores. All scores must be integers.
|
||||||
valueType: integer # This enforces the value type for all entries.
|
valueType: integer # This enforces the value type for all entries.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Authenticated Parameters
|
### Authenticated Parameters
|
||||||
@@ -171,21 +171,21 @@ the required [authServices](../authServices/) to specific claims within the
|
|||||||
user's ID token.
|
user's ID token.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
search_flights_by_user_id:
|
name: search_flights_by_user_id
|
||||||
kind: postgres-sql
|
type: postgres-sql
|
||||||
source: my-pg-instance
|
source: my-pg-instance
|
||||||
statement: |
|
statement: |
|
||||||
SELECT * FROM flights WHERE user_id = $1
|
SELECT * FROM flights WHERE user_id = $1
|
||||||
parameters:
|
parameters:
|
||||||
- name: user_id
|
- name: user_id
|
||||||
type: string
|
type: string
|
||||||
description: Auto-populated from Google login
|
description: Auto-populated from Google login
|
||||||
authServices:
|
authServices:
|
||||||
# Refer to one of the `authServices` defined
|
# Refer to one of the `authServices` defined
|
||||||
- name: my-google-auth
|
- name: my-google-auth
|
||||||
# `sub` is the OIDC claim field for user ID
|
# `sub` is the OIDC claim field for user ID
|
||||||
field: sub
|
field: sub
|
||||||
```
|
```
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
@@ -222,31 +222,31 @@ can use `minValue` and `maxValue` to define the allowable range.
|
|||||||
{{< /notice >}}
|
{{< /notice >}}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
select_columns_from_table:
|
name: select_columns_from_table
|
||||||
kind: postgres-sql
|
type: postgres-sql
|
||||||
source: my-pg-instance
|
source: my-pg-instance
|
||||||
statement: |
|
statement: |
|
||||||
SELECT {{array .columnNames}} FROM {{.tableName}}
|
SELECT {{array .columnNames}} FROM {{.tableName}}
|
||||||
description: |
|
description: |
|
||||||
Use this tool to list all information from a specific table.
|
Use this tool to list all information from a specific table.
|
||||||
Example:
|
Example:
|
||||||
{{
|
{{
|
||||||
"tableName": "flights",
|
"tableName": "flights",
|
||||||
"columnNames": ["id", "name"]
|
"columnNames": ["id", "name"]
|
||||||
}}
|
}}
|
||||||
templateParameters:
|
templateParameters:
|
||||||
- name: tableName
|
- name: tableName
|
||||||
type: string
|
type: string
|
||||||
description: Table to select from
|
description: Table to select from
|
||||||
- name: columnNames
|
- name: columnNames
|
||||||
type: array
|
type: array
|
||||||
description: The columns to select
|
description: The columns to select
|
||||||
items:
|
items:
|
||||||
name: column
|
name: column
|
||||||
type: string
|
type: string
|
||||||
description: Name of a column to select
|
description: Name of a column to select
|
||||||
escape: double-quotes # with this, the statement will resolve to `SELECT "id", "name" FROM flights`
|
escape: double-quotes # with this, the statement will resolve to `SELECT "id", "name" FROM flights`
|
||||||
```
|
```
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
@@ -267,16 +267,16 @@ specifying an `authRequired` field. Specify a list of
|
|||||||
[authServices](../authServices/) defined in the previous section.
|
[authServices](../authServices/) defined in the previous section.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
search_all_flight:
|
name: search_all_flight
|
||||||
kind: postgres-sql
|
type: postgres-sql
|
||||||
source: my-pg-instance
|
source: my-pg-instance
|
||||||
statement: |
|
statement: |
|
||||||
SELECT * FROM flights
|
SELECT * FROM flights
|
||||||
# A list of `authServices` defined previously
|
# A list of `authServices` defined previously
|
||||||
authRequired:
|
authRequired:
|
||||||
- my-google-auth
|
- my-google-auth
|
||||||
- other-auth-service
|
- other-auth-service
|
||||||
```
|
```
|
||||||
|
|
||||||
## Kinds of tools
|
## Kinds of tools
|
||||||
|
|||||||
@@ -40,17 +40,17 @@ The tool takes the following input parameters:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
create_cluster:
|
name: create_cluster
|
||||||
kind: alloydb-create-cluster
|
type: alloydb-create-cluster
|
||||||
source: alloydb-admin-source
|
source: alloydb-admin-source
|
||||||
description: Use this tool to create a new AlloyDB cluster in a given project and location.
|
description: Use this tool to create a new AlloyDB cluster in a given project and location.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|:--------:|:------------:|------------------------------------------------------|
|
|-------------|:--------:|:------------:|------------------------------------------------------|
|
||||||
| kind | string | true | Must be alloydb-create-cluster. |
|
| type | string | true | Must be alloydb-create-cluster. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
|
|||||||
@@ -45,17 +45,17 @@ The tool takes the following input parameters:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
create_instance:
|
name: create_instance
|
||||||
kind: alloydb-create-instance
|
type: alloydb-create-instance
|
||||||
source: alloydb-admin-source
|
source: alloydb-admin-source
|
||||||
description: Use this tool to create a new AlloyDB instance within a specified cluster.
|
description: Use this tool to create a new AlloyDB instance within a specified cluster.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
||||||
| kind | string | true | Must be alloydb-create-instance. |
|
| type | string | true | Must be alloydb-create-instance. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
@@ -39,17 +39,17 @@ The tool takes the following input parameters:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
create_user:
|
name: create_user
|
||||||
kind: alloydb-create-user
|
type: alloydb-create-user
|
||||||
source: alloydb-admin-source
|
source: alloydb-admin-source
|
||||||
description: Use this tool to create a new database user for an AlloyDB cluster.
|
description: Use this tool to create a new database user for an AlloyDB cluster.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
||||||
| kind | string | true | Must be alloydb-create-user. |
|
| type | string | true | Must be alloydb-create-user. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
@@ -3,7 +3,7 @@ title: alloydb-get-cluster
|
|||||||
type: docs
|
type: docs
|
||||||
weight: 1
|
weight: 1
|
||||||
description: "The \"alloydb-get-cluster\" tool retrieves details for a specific AlloyDB cluster.\n"
|
description: "The \"alloydb-get-cluster\" tool retrieves details for a specific AlloyDB cluster.\n"
|
||||||
aliases: [/resources/tools/alloydb-get-cluster]
|
alias: [/resources/tools/alloydb-get-cluster]
|
||||||
---
|
---
|
||||||
|
|
||||||
## About
|
## About
|
||||||
@@ -21,17 +21,17 @@ specified AlloyDB cluster. It is compatible with
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
get_specific_cluster:
|
name: get_specific_cluster
|
||||||
kind: alloydb-get-cluster
|
type: alloydb-get-cluster
|
||||||
source: my-alloydb-admin-source
|
source: my-alloydb-admin-source
|
||||||
description: Use this tool to retrieve details for a specific AlloyDB cluster.
|
description: Use this tool to retrieve details for a specific AlloyDB cluster.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
||||||
| kind | string | true | Must be alloydb-get-cluster. |
|
| type | string | true | Must be alloydb-get-cluster. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
@@ -22,17 +22,17 @@ specified AlloyDB instance. It is compatible with
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
get_specific_instance:
|
name: get_specific_instance
|
||||||
kind: alloydb-get-instance
|
type: alloydb-get-instance
|
||||||
source: my-alloydb-admin-source
|
source: my-alloydb-admin-source
|
||||||
description: Use this tool to retrieve details for a specific AlloyDB instance.
|
description: Use this tool to retrieve details for a specific AlloyDB instance.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|:--------:|:------------:|------------------------------------------------------|
|
|-------------|:--------:|:------------:|------------------------------------------------------|
|
||||||
| kind | string | true | Must be alloydb-get-instance. |
|
| type | string | true | Must be alloydb-get-instance. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
@@ -22,17 +22,17 @@ specified AlloyDB user. It is compatible with
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
get_specific_user:
|
name: get_specific_user
|
||||||
kind: alloydb-get-user
|
type: alloydb-get-user
|
||||||
source: my-alloydb-admin-source
|
source: my-alloydb-admin-source
|
||||||
description: Use this tool to retrieve details for a specific AlloyDB user.
|
description: Use this tool to retrieve details for a specific AlloyDB user.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
||||||
| kind | string | true | Must be alloydb-get-user. |
|
| type | string | true | Must be alloydb-get-user. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
@@ -24,17 +24,17 @@ location. The tool takes the following input parameters:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
list_clusters:
|
name: list_clusters
|
||||||
kind: alloydb-list-clusters
|
type: alloydb-list-clusters
|
||||||
source: alloydb-admin-source
|
source: alloydb-admin-source
|
||||||
description: Use this tool to list all AlloyDB clusters in a given project and location.
|
description: Use this tool to list all AlloyDB clusters in a given project and location.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
||||||
| kind | string | true | Must be alloydb-list-clusters. |
|
| type | string | true | Must be alloydb-list-clusters. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
@@ -26,17 +26,17 @@ parameters:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
list_instances:
|
name: list_instances
|
||||||
kind: alloydb-list-instances
|
type: alloydb-list-instances
|
||||||
source: alloydb-admin-source
|
source: alloydb-admin-source
|
||||||
description: Use this tool to list all AlloyDB instances for a given project, cluster and location.
|
description: Use this tool to list all AlloyDB instances for a given project, cluster and location.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
||||||
| kind | string | true | Must be alloydb-list-instances. |
|
| type | string | true | Must be alloydb-list-instances. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
|
|||||||
@@ -22,17 +22,17 @@ The tool takes the following input parameters:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
list_users:
|
name: list_users
|
||||||
kind: alloydb-list-users
|
type: alloydb-list-users
|
||||||
source: alloydb-admin-source
|
source: alloydb-admin-source
|
||||||
description: Use this tool to list all database users within an AlloyDB cluster
|
description: Use this tool to list all database users within an AlloyDB cluster
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
| ----------- | :------: | :----------: | ---------------------------------------------------- |
|
||||||
| kind | string | true | Must be alloydb-list-users. |
|
| type | string | true | Must be alloydb-list-users. |
|
||||||
| source | string | true | The name of an `alloydb-admin` source. |
|
| source | string | true | The name of an `alloydb-admin` source. |
|
||||||
| description | string | false | Description of the tool that is passed to the agent. |
|
| description | string | false | Description of the tool that is passed to the agent. |
|
||||||
|
|||||||
@@ -25,22 +25,22 @@ and shouldn't be used for production agents.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
wait_for_operation:
|
name: wait_for_operation
|
||||||
kind: alloydb-wait-for-operation
|
type: alloydb-wait-for-operation
|
||||||
source: my-alloydb-admin-source
|
source: my-alloydb-admin-source
|
||||||
description: "This will poll on operations API until the operation is done. For checking operation status we need projectId, locationID and operationId. Once instance is created give follow up steps on how to use the variables to bring data plane MCP server up in local and remote setup."
|
description: "This will poll on operations API until the operation is done. For checking operation status we need projectId, locationID and operationId. Once instance is created give follow up steps on how to use the variables to bring data plane MCP server up in local and remote setup."
|
||||||
delay: 1s
|
delay: 1s
|
||||||
maxDelay: 4m
|
maxDelay: 4m
|
||||||
multiplier: 2
|
multiplier: 2
|
||||||
maxRetries: 10
|
maxRetries: 10
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
| ----------- | :------: | :----------: | ---------------------------------------------------------------------------------------------------------------- |
|
| ----------- | :------: | :----------: | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
| kind | string | true | Must be "alloydb-wait-for-operation". |
|
| type | string | true | Must be "alloydb-wait-for-operation". |
|
||||||
| source | string | true | The name of a `alloydb-admin` source to use for authentication. |
|
| source | string | true | The name of a `alloydb-admin` source to use for authentication. |
|
||||||
| description | string | false | A description of the tool. |
|
| description | string | false | A description of the tool. |
|
||||||
| delay | duration | false | The initial delay between polling requests (e.g., `3s`). Defaults to 3 seconds. |
|
| delay | duration | false | The initial delay between polling requests (e.g., `3s`). Defaults to 3 seconds. |
|
||||||
|
|||||||
@@ -103,29 +103,29 @@ CREATE EXTENSION IF NOT EXISTS parameterized_views;
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
ask_questions:
|
name: ask_questions
|
||||||
kind: alloydb-ai-nl
|
type: alloydb-ai-nl
|
||||||
source: my-alloydb-source
|
source: my-alloydb-source
|
||||||
description: "Ask questions to check information about flights"
|
description: "Ask questions to check information about flights"
|
||||||
nlConfig: "cymbal_air_nl_config"
|
nlConfig: "cymbal_air_nl_config"
|
||||||
nlConfigParameters:
|
nlConfigParameters:
|
||||||
- name: user_email
|
- name: user_email
|
||||||
type: string
|
type: string
|
||||||
description: User ID of the logged in user.
|
description: User ID of the logged in user.
|
||||||
# note: we strongly recommend using features like Authenticated or
|
# note: we strongly recommend using features like Authenticated or
|
||||||
# Bound parameters to prevent the LLM from seeing these params and
|
# Bound parameters to prevent the LLM from seeing these params and
|
||||||
# specifying values it shouldn't in the tool input
|
# specifying values it shouldn't in the tool input
|
||||||
authServices:
|
authServices:
|
||||||
- name: my_google_service
|
- name: my_google_service
|
||||||
field: email
|
field: email
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|--------------------|:---------------------------------------:|:------------:|--------------------------------------------------------------------------|
|
|--------------------|:---------------------------------------:|:------------:|--------------------------------------------------------------------------|
|
||||||
| kind | string | true | Must be "alloydb-ai-nl". |
|
| type | string | true | Must be "alloydb-ai-nl". |
|
||||||
| source | string | true | Name of the AlloyDB source the natural language query should execute on. |
|
| source | string | true | Name of the AlloyDB source the natural language query should execute on. |
|
||||||
| description | string | true | Description of the tool that is passed to the LLM. |
|
| description | string | true | Description of the tool that is passed to the LLM. |
|
||||||
| nlConfig | string | true | The name of the `nl_config` in AlloyDB |
|
| nlConfig | string | true | The name of the `nl_config` in AlloyDB |
|
||||||
|
|||||||
@@ -64,11 +64,11 @@ the `bigquery` source:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
contribution_analyzer:
|
name: contribution_analyzer
|
||||||
kind: bigquery-analyze-contribution
|
type: bigquery-analyze-contribution
|
||||||
source: my-bigquery-source
|
source: my-bigquery-source
|
||||||
description: Use this tool to run contribution analysis on a dataset in BigQuery.
|
description: Use this tool to run contribution analysis on a dataset in BigQuery.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Sample Prompt
|
## Sample Prompt
|
||||||
@@ -88,6 +88,6 @@ And use the following sample prompts to call this tool:
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|:--------:|:------------:|----------------------------------------------------|
|
|-------------|:--------:|:------------:|----------------------------------------------------|
|
||||||
| kind | string | true | Must be "bigquery-analyze-contribution". |
|
| type | string | true | Must be "bigquery-analyze-contribution". |
|
||||||
| source | string | true | Name of the source the tool should execute on. |
|
| source | string | true | Name of the source the tool should execute on. |
|
||||||
| description | string | true | Description of the tool that is passed to the LLM. |
|
| description | string | true | Description of the tool that is passed to the LLM. |
|
||||||
|
|||||||
@@ -53,19 +53,19 @@ dataset specified in the `table_references` parameter.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
ask_data_insights:
|
name: ask_data_insights
|
||||||
kind: bigquery-conversational-analytics
|
type: bigquery-conversational-analytics
|
||||||
source: my-bigquery-source
|
source: my-bigquery-source
|
||||||
description: |
|
description: |
|
||||||
Use this tool to perform data analysis, get insights, or answer complex
|
Use this tool to perform data analysis, get insights, or answer complex
|
||||||
questions about the contents of specific BigQuery tables.
|
questions about the contents of specific BigQuery tables.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|:--------:|:------------:|----------------------------------------------------|
|
|-------------|:--------:|:------------:|----------------------------------------------------|
|
||||||
| kind | string | true | Must be "bigquery-conversational-analytics". |
|
| type | string | true | Must be "bigquery-conversational-analytics". |
|
||||||
| source | string | true | Name of the source for chat. |
|
| source | string | true | Name of the source for chat. |
|
||||||
| description | string | true | Description of the tool that is passed to the LLM. |
|
| description | string | true | Description of the tool that is passed to the LLM. |
|
||||||
|
|||||||
@@ -54,17 +54,17 @@ layer of security by controlling which datasets can be accessed:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
execute_sql_tool:
|
name: execute_sql_tool
|
||||||
kind: bigquery-execute-sql
|
type: bigquery-execute-sql
|
||||||
source: my-bigquery-source
|
source: my-bigquery-source
|
||||||
description: Use this tool to execute sql statement.
|
description: Use this tool to execute sql statement.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|:--------:|:------------:|----------------------------------------------------|
|
|-------------|:--------:|:------------:|----------------------------------------------------|
|
||||||
| kind | string | true | Must be "bigquery-execute-sql". |
|
| type | string | true | Must be "bigquery-execute-sql". |
|
||||||
| source | string | true | Name of the source the SQL should execute on. |
|
| source | string | true | Name of the source the SQL should execute on. |
|
||||||
| description | string | true | Description of the tool that is passed to the LLM. |
|
| description | string | true | Description of the tool that is passed to the LLM. |
|
||||||
|
|||||||
@@ -58,11 +58,11 @@ the `bigquery` source:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tools:
|
kind: tools
|
||||||
forecast_tool:
|
name: forecast_tool
|
||||||
kind: bigquery-forecast
|
type: bigquery-forecast
|
||||||
source: my-bigquery-source
|
source: my-bigquery-source
|
||||||
description: Use this tool to forecast time series data in BigQuery.
|
description: Use this tool to forecast time series data in BigQuery.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Sample Prompt
|
## Sample Prompt
|
||||||
@@ -78,6 +78,6 @@ You can use the following sample prompts to call this tool:
|
|||||||
|
|
||||||
| **field** | **type** | **required** | **description** |
|
| **field** | **type** | **required** | **description** |
|
||||||
|-------------|:--------:|:------------:|---------------------------------------------------------|
|
|-------------|:--------:|:------------:|---------------------------------------------------------|
|
||||||
| kind | string | true | Must be "bigquery-forecast". |
|
| type | string | true | Must be "bigquery-forecast". |
|
||||||
| source | string | true | Name of the source the forecast tool should execute on. |
|
| source | string | true | Name of the source the forecast tool should execute on. |
|
||||||
| description | string | true | Description of the tool that is passed to the LLM. |
|
| description | string | true | Description of the tool that is passed to the LLM. |
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user