Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,8 +32,8 @@ def generate_sql_query(text_input_schema: str, text_input_question: str):
|
|
| 32 |
)
|
| 33 |
|
| 34 |
# Extract and return the generated SQL query
|
| 35 |
-
|
| 36 |
-
return
|
| 37 |
except Exception as e:
|
| 38 |
return {"error": str(e)}
|
| 39 |
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
# Extract and return the generated SQL query
|
| 35 |
+
generated = completion['choices'][0]['text'].strip()
|
| 36 |
+
return {"sql_query":generated}
|
| 37 |
except Exception as e:
|
| 38 |
return {"error": str(e)}
|
| 39 |
|