mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-22 05:48:08 -05:00
Compare commits
26 Commits
fix-adk-js
...
integratio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bf2461e9e | ||
|
|
fd26fa4433 | ||
|
|
1225a2f0c0 | ||
|
|
c835af431a | ||
|
|
bde46e1401 | ||
|
|
49d255254c | ||
|
|
eedd0ab67f | ||
|
|
65b21960fa | ||
|
|
6ff567df47 | ||
|
|
cc3c52731d | ||
|
|
87ff9150d2 | ||
|
|
81b42ac973 | ||
|
|
be7560f606 | ||
|
|
edaa1c23cf | ||
|
|
0cfac2984e | ||
|
|
0b7ffa4364 | ||
|
|
ca4a12b5f3 | ||
|
|
7d5af5f001 | ||
|
|
2bcfca0981 | ||
|
|
3932efbd4b | ||
|
|
1bfe394222 | ||
|
|
96904e28e9 | ||
|
|
c3c2cec9ab | ||
|
|
1a39de7617 | ||
|
|
edf8377c57 | ||
|
|
fd4250d0db |
@@ -12,6 +12,9 @@ aliases:
|
||||
|
||||
The `cloud-gemini-data-analytics-query` tool allows you to send natural language questions to the Gemini Data Analytics API and receive structured responses containing SQL queries, natural language answers, and explanations. For details on defining data agent context for database data sources, see the official [documentation](https://docs.cloud.google.com/gemini/docs/conversational-analytics-api/data-agent-authored-context-databases).
|
||||
|
||||
> [!NOTE]
|
||||
> Only `alloydb`, `spannerReference`, and `cloudSqlReference` are supported as [datasource references](https://clouddocs.devsite.corp.google.com/gemini/docs/conversational-analytics-api/reference/rest/v1beta/projects.locations.dataAgents#DatasourceReferences).
|
||||
|
||||
## Example
|
||||
|
||||
```yaml
|
||||
|
||||
@@ -30,6 +30,10 @@ following config for example:
|
||||
- name: userNames
|
||||
type: array
|
||||
description: The user names to be set.
|
||||
items:
|
||||
name: userName # the item name doesn't matter but it has to exist
|
||||
type: string
|
||||
description: username
|
||||
```
|
||||
|
||||
If the input is an array of strings `["Alice", "Sid", "Bob"]`, The final command
|
||||
|
||||
@@ -214,12 +214,15 @@ func AddPostgresPrebuiltConfig(t *testing.T, config map[string]any) map[string]a
|
||||
PostgresListDatabaseStatsToolKind = "postgres-list-database-stats"
|
||||
PostgresListRolesToolKind = "postgres-list-roles"
|
||||
PostgresListStoredProcedureToolKind = "postgres-list-stored-procedure"
|
||||
|
||||
|
||||
)
|
||||
|
||||
tools, ok := config["tools"].(map[string]any)
|
||||
if !ok {
|
||||
t.Fatalf("unable to get tools from config")
|
||||
}
|
||||
|
||||
tools["list_tables"] = map[string]any{
|
||||
"kind": PostgresListTablesToolKind,
|
||||
"source": "my-instance",
|
||||
@@ -943,6 +946,8 @@ func TestCloudSQLMySQL_IPTypeParsingFromYAML(t *testing.T) {
|
||||
|
||||
// Finds and drops all tables in a postgres database.
|
||||
func CleanupPostgresTables(t *testing.T, ctx context.Context, pool *pgxpool.Pool) {
|
||||
// fmt.println("")
|
||||
t.Logf("in cleanupPostgrestTables");
|
||||
query := `
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_schema = 'public' AND table_type = 'BASE TABLE';`
|
||||
@@ -964,14 +969,31 @@ func CleanupPostgresTables(t *testing.T, ctx context.Context, pool *pgxpool.Pool
|
||||
}
|
||||
|
||||
if len(tablesToDrop) == 0 {
|
||||
t.Logf("No tables to drop in 'public' schema")
|
||||
return
|
||||
}
|
||||
|
||||
t.Logf("Tables to drop in 'public' schema: %s", strings.Join(tablesToDrop, ", "))
|
||||
|
||||
dropQuery := fmt.Sprintf("DROP TABLE IF EXISTS %s CASCADE;", strings.Join(tablesToDrop, ", "))
|
||||
|
||||
if _, err := pool.Exec(ctx, dropQuery); err != nil {
|
||||
t.Fatalf("Failed to drop all tables in 'public' schema: %v", err)
|
||||
}
|
||||
|
||||
t.Logf("Dropped tables in 'public' schema: %s", strings.Join(tablesToDrop, ", "))
|
||||
|
||||
|
||||
// // 1. Drop the entire public schema (this kills tables, views, types, etc.)
|
||||
// dropSchema := "DROP SCHEMA public CASCADE;"
|
||||
// // 2. Recreate the empty public schema
|
||||
// createSchema := "CREATE SCHEMA public;"
|
||||
// // 3. Grant permissions back (Postgres default)
|
||||
// grantPublic := "GRANT ALL ON SCHEMA public TO public;"
|
||||
|
||||
// _, err := pool.Exec(ctx, dropSchema + createSchema + grantPublic)
|
||||
// if err != nil {
|
||||
// t.Fatalf("Failed to nuclear-wipe the public schema: %v", err)
|
||||
// }
|
||||
}
|
||||
|
||||
// Finds and drops all tables in a mysql database.
|
||||
|
||||
Reference in New Issue
Block a user