Loading...
Loading...
Convert natural language queries to SQL. Use for database queries, data analysis, and reporting.
npx skill4agent add oimiragieo/agent-studio text-to-sql"Generate SQL to find all users who signed up in the last month"
"Create a query to calculate total revenue by product"
"Write SQL to find duplicate records"User: "Find all users who signed up in the last month"
Text-to-SQL:
1. Analyzes query
2. References users table schema
3. Generates SQL:
SELECT * FROM users
WHERE created_at >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
4. Returns parameterized queryUser: "Calculate total revenue by product for Q4"
Text-to-SQL:
1. Analyzes query
2. References orders and products tables
3. Generates SQL:
SELECT p.name, SUM(o.total) as revenue
FROM orders o
JOIN products p ON o.product_id = p.id
WHERE o.created_at >= '2024-10-01'
AND o.created_at < '2025-01-01'
GROUP BY p.id, p.name
4. Returns optimized querytext_to_sql_config.yaml# Run text-to-SQL evaluation (create config first)
npx promptfoo@latest eval -c text_to_sql_config.yaml