Spaces:
Running
Running
Upload 2 files
Browse files- app.py +8 -8
- text2zinc.csv +0 -0
app.py
CHANGED
|
@@ -239,11 +239,11 @@ class ChatAssistant:
|
|
| 239 |
"content": system_message
|
| 240 |
}] + self.conversation_history
|
| 241 |
|
| 242 |
-
# Call OpenAI API
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
|
| 248 |
assistant_message = completion.choices[0].message.content.strip()
|
| 249 |
|
|
@@ -1229,7 +1229,7 @@ def main(page: ft.Page):
|
|
| 1229 |
ft.Container(
|
| 1230 |
content=ft.Column([
|
| 1231 |
ft.Text("You:", weight=ft.FontWeight.BOLD, size=12),
|
| 1232 |
-
ft.Text(user_message, size=11),
|
| 1233 |
]),
|
| 1234 |
bgcolor=ft.colors.BLUE_50,
|
| 1235 |
padding=10,
|
|
@@ -1264,7 +1264,7 @@ def main(page: ft.Page):
|
|
| 1264 |
weight=ft.FontWeight.BOLD,
|
| 1265 |
size=12,
|
| 1266 |
color=ft.colors.GREEN),
|
| 1267 |
-
ft.Text(ai_response, size=11),
|
| 1268 |
]),
|
| 1269 |
bgcolor=ft.colors.GREEN_50,
|
| 1270 |
padding=10,
|
|
@@ -1650,4 +1650,4 @@ def main(page: ft.Page):
|
|
| 1650 |
|
| 1651 |
|
| 1652 |
if __name__ == "__main__":
|
| 1653 |
-
ft.app(target=main, assets_dir="assets")
|
|
|
|
| 239 |
"content": system_message
|
| 240 |
}] + self.conversation_history
|
| 241 |
|
| 242 |
+
# Call OpenAI API - gpt-5.2 is a reasoning model, so skip
|
| 243 |
+
# temperature and max_tokens (same pattern as utils.py)
|
| 244 |
+
completion = self.client.chat.completions.create(
|
| 245 |
+
model="gpt-5.2",
|
| 246 |
+
messages=messages)
|
| 247 |
|
| 248 |
assistant_message = completion.choices[0].message.content.strip()
|
| 249 |
|
|
|
|
| 1229 |
ft.Container(
|
| 1230 |
content=ft.Column([
|
| 1231 |
ft.Text("You:", weight=ft.FontWeight.BOLD, size=12),
|
| 1232 |
+
ft.Text(user_message, size=11, selectable=True),
|
| 1233 |
]),
|
| 1234 |
bgcolor=ft.colors.BLUE_50,
|
| 1235 |
padding=10,
|
|
|
|
| 1264 |
weight=ft.FontWeight.BOLD,
|
| 1265 |
size=12,
|
| 1266 |
color=ft.colors.GREEN),
|
| 1267 |
+
ft.Text(ai_response, size=11, selectable=True),
|
| 1268 |
]),
|
| 1269 |
bgcolor=ft.colors.GREEN_50,
|
| 1270 |
padding=10,
|
|
|
|
| 1650 |
|
| 1651 |
|
| 1652 |
if __name__ == "__main__":
|
| 1653 |
+
ft.app(target=main, assets_dir="assets")
|
text2zinc.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|