alokik29 commited on
Commit
f248584
·
verified ·
1 Parent(s): e6e05c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -39,7 +39,16 @@ def ask_question(user_db, question):
39
  cursor = conn.cursor()
40
 
41
  # Create a Text-to-SQL prompt
42
- prompt = f"Translate this question into an SQLite query.\nReturn only SQL (no text):\nQuestion: {question}\nSQL:"
 
 
 
 
 
 
 
 
 
43
 
44
  # ✅ Use .invoke() instead of calling the object directly
45
  response = sqlcoder_llm.invoke(prompt)
 
39
  cursor = conn.cursor()
40
 
41
  # Create a Text-to-SQL prompt
42
+ prompt = f"""
43
+ You are an expert SQL generator.
44
+ The database follows the Chinook schema with tables:
45
+ customers, invoices, invoice_items, tracks, albums, artists, employees, genres, media_types, playlists, playlist_track.
46
+ Translate this question into a valid SQLite query for this schema.
47
+ Return only SQL (no text).
48
+ Question: {question}
49
+ SQL:
50
+ """
51
+
52
 
53
  # ✅ Use .invoke() instead of calling the object directly
54
  response = sqlcoder_llm.invoke(prompt)