-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.yaml
More file actions
113 lines (110 loc) · 3.81 KB
/
tools.yaml
File metadata and controls
113 lines (110 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# authServices: # https://googleapis.github.io/genai-toolbox/resources/authservices/
# my-google-auth:
# kind: google
# clientId: ${YOUR_GOOGLE_CLIENT_ID}
sources: # https://googleapis.github.io/genai-toolbox/resources/sources/
my-mysql:
kind: mysql
host: ${MYSQL_HOST} # host.docker.internal
port: ${MYSQL_PORT}
database: ${MYSQL_DATABASE}
user: ${MYSQL_USER}
password: ${MYSQL_PASSWORD}
# queryTimeout: 30s # Optional: query timeout duration
tools: # https://googleapis.github.io/genai-toolbox/resources/tools/
execute_sql_tool: # https://googleapis.github.io/genai-toolbox/resources/tools/mysql/mysql-execute-sql/
kind: mysql-execute-sql
source: my-mysql
description: Use this tool to execute sql statement.
# authRequired:
# - my-google-auth
get_tables:
kind: mysql-sql
source: my-mysql
statement: |
SHOW TABLES
# statement: |
# SELECT table_name
# FROM information_schema.tables
# WHERE table_schema = DATABASE();
description: Get all tables in the MySQL database
get_column_names: # https://googleapis.github.io/genai-toolbox/resources/tools/mysql/mysql-sql/
kind: mysql-sql
source: my-mysql
description: |
Get column names from a specific table in the MySQL database
Example:
{{
"table_name": "inventory"
}}
# statement: |
# DESC ?
# parameters: # Parameters isnt working?!
# - name: table_name
# type: string
# description: Name of the table to get column names from
statement: |
SELECT column_name
FROM information_schema.columns
WHERE table_schema = DATABASE() AND table_name = '{{.table_name}}';
templateParameters:
- name: table_name
type: string
description: Name of the table to get column names from
get_table_data:
kind: mysql-sql
source: my-mysql
statement: |
SELECT {{array .columnNames}} FROM {{.tableName}}
description: |
Use this tool to list all information from a specific table.
Example:
{{
"tableName": "flights",
"columnNames": ["id", "name"]
}}
templateParameters:
- name: tableName
type: string
description: Table to select from
- name: columnNames
type: array
description: The columns to select
items:
name: column
type: string
description: Name of a column to select
get_table_data_with_filter:
kind: mysql-sql
source: my-mysql
statement: |
SELECT {{array .columnNames}} FROM {{.tableName}} WHERE {{.filter}}
description: |
Use this tool to list all information from a specific table with a filter.
Example:
{{
"tableName": "flights",
"columnNames": ["id", "name"],
"filter": "id = 1"
}}
templateParameters:
- name: tableName
type: string
description: Table to select from
- name: columnNames
type: array
description: The columns to select
items:
name: column
type: string
description: Name of a column to select
- name: filter
type: string
description: Filter to apply to the query
toolsets:
master_toolset: # default:
- get_tables
- get_column_names
- get_table_data
- get_table_data_with_filter
- execute_sql_tool