Closed difagume closed 1 year ago
Someone is attempting to deploy a commit to a Personal Account owned by @whoiskatrin on Vercel.
@whoiskatrin first needs to authorize it.
style correction when hovering over the button
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated |
---|---|---|---|---|
sql-translator | ✅ Ready (Inspect) | Visit Preview | 💬 Add your feedback | Mar 20, 2023 at 7:47PM (UTC) |
Hey guys, I need a bit of your help. Actually, I started a development server at localhost:3000 but when when I hit translate I am getting this error 👎
error - pages\api\translate.ts (5:8) @ eval error - Error: OPENAI_API_KEY is not defined in .env file. Please add it there (see README.md for more details). at eval (webpack-internal:///(api)/./pages/api/translate.ts:11:11) 3 | 4 | if (!process.env.OPENAI_API_KEY) {
5 | throw new Error( | ^ 6 | "OPENAI_API_KEY is not defined in .env file. Please add it there (see README.md for more details)." 7 | ); 8 | }
it would be a great help if you know how to fix this
you need to create the .env file and inside put your openai Api key, look at the .env.production file, and check the README.md file in section 3 of the Installation. then restart the server to take over the changes in the .ev file
@difagume could you explain a bit more the prompt change? I'm not 1000% convinced that it's the correct one to proceed with.
you need to create the .env file and inside put your openai Api key, look at the .env.production file, and check the README.md file in section 3 of the Installation. then restart the server to take over the changes in the .ev file
Thank you for the help now its working
@difagume could you explain a bit more the prompt change? I'm not 1000% convinced that it's the correct one to proceed with.
of course @whoiskatrin
in the example above is the actual query when a schema is included, the text is duplicated because at the end of the prompt there is ${prompt}
so I updated how the prompt is assembled with a ternary and the only thing I modified was the texts that were being duplicated when a schema is included:
I give you an example of the prompt with and without schema, I see it the same as before without the duplicated texts and in the tests I did it returns me the same as before.
Without schema:
Translate this natural language query into SQL:
"Get all information from the modulo table where the description is 'Registro'."
SQL Query:
With schema:
Translate this natural language query into SQL:
"Get all information from the modulo table where the description is 'Registro'."
Use this table schema:
CREATE TABLE modulo (
id bigserial NOT NULL,
valor varchar NOT NULL,
descripcion varchar NOT NULL,
activo bool NOT NULL DEFAULT true,
CONSTRAINT modulo_pkey PRIMARY KEY (id)
);
SQL Query:
Previous prompt:
Current prompt: