mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-02-11 07:35:05 -05:00
Initial version supporting snowflake. Connects and executes arbitrary SQL. An rudimentary Python example is provided as well. --------- Co-authored-by: duwenxin <duwenxin@google.com> Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
19 lines
510 B
Python
19 lines
510 B
Python
import asyncio
|
|
from toolbox_core import ToolboxClient
|
|
|
|
|
|
async def main():
|
|
# Replace with the actual URL where your Toolbox service is running
|
|
async with ToolboxClient("http://127.0.0.1:5000") as toolbox:
|
|
tool = await toolbox.load_tool("execute_sql")
|
|
result = await tool("SELECT 1")
|
|
print(result)
|
|
|
|
tool = await toolbox.load_tool("list_tables")
|
|
result = await tool(table_names="DIM_DATE")
|
|
print(result)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|