Files
DataClaw/backend/tests/test_nl2sql.py
T
2026-03-27 15:59:23 +08:00

13 lines
343 B
Python

import asyncio
import json
from app.agent.nl2sql import process_nl2sql, NL2SQLRequest
async def main():
req = NL2SQLRequest(query="列出所有表", source="postgres", generate_chart=False)
res = await process_nl2sql(req)
print("SQL:", res.sql)
print("Error:", res.error)
print("Result:", res.result)
asyncio.run(main())