UNPKG

querycrafter

Version:

QueryCrafter intelligently translates natural language into accurate SQL queries (NLP2SQL). This npm module simplifies database interactions by allowing you to retrieve data using plain English, eliminating the need for complex code. It's a powerful and i

22 lines (21 loc) 784 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.askLLM = askLLM; const openai_1 = require("./openai"); const gemini_1 = require("./gemini"); const groq_1 = require("./groq"); const ollama_1 = require("./ollama"); async function askLLM(query, schema, config) { switch (config.provider) { case 'openai': return (0, openai_1.askOpenAI)(query, schema, config); case 'gemini': return (0, gemini_1.askGemini)(query, schema, config); case 'groq': return (0, groq_1.askGroq)(query, schema, config); case 'ollama': return (0, ollama_1.askOllama)(query, schema, config); default: throw new Error(`Unsupported LLM provider: ${config.provider}`); } }