From c498cef280a1b5037e3265ebf7e80eed97fe1389 Mon Sep 17 00:00:00 2001 From: Aldrin Jenson Date: Fri, 15 Sep 2023 20:17:11 +0530 Subject: [PATCH] make the llm prompt stricter --- server/src/handlers/http/llm.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src/handlers/http/llm.rs b/server/src/handlers/http/llm.rs index 9f7955f9a..d507542a0 100644 --- a/server/src/handlers/http/llm.rs +++ b/server/src/handlers/http/llm.rs @@ -72,10 +72,8 @@ fn build_prompt(stream: &str, prompt: &str, schema_json: &str) -> String { format!( r#"I have a table called {}. It has the columns:\n{} -Based on this, generate valid SQL for the query: "{}" -Generate only SQL as output. Also add comments in SQL syntax to explain your actions. -Don't output anything else. -If it is not possible to generate valid SQL, output an SQL comment saying so."#, +Based on this schema, generate valid SQL for the query: "{}" +Generate only simple SQL as output. Also add comments in SQL syntax to explain your actions. Don't output anything else. If it is not possible to generate valid SQL, output an SQL comment saying so."#, stream, schema_json, prompt ) } @@ -84,7 +82,7 @@ fn build_request_body(ai_prompt: String) -> impl serde::Serialize { json!({ "model": "gpt-3.5-turbo", "messages": [{ "role": "user", "content": ai_prompt}], - "temperature": 0.6, + "temperature": 0.7, }) }