Update app.py
Browse files
app.py
CHANGED
@@ -59,14 +59,17 @@ async def ppt_content(data):
|
|
59 |
listOfString = split_into_token_chunks("".join(data))
|
60 |
message_history: list[ModelMessage] = []
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
70 |
|
71 |
def ai_ppt(data):
|
72 |
asyncio.run(ppt_content(data=data))
|
|
|
59 |
listOfString = split_into_token_chunks("".join(data))
|
60 |
message_history: list[ModelMessage] = []
|
61 |
|
62 |
+
if len(listOfString) > 0:
|
63 |
+
result = agent.run_sync(user_prompt=f"Create me a powerpoint presentation from {listOfString[0]}",
|
64 |
+
message_history=message_history)
|
65 |
+
if len(listOfString) > 1:
|
66 |
+
result_1 = agent.run_sync(user_prompt=f"Create me a powerpoint presentation from {listOfString[1]}",
|
67 |
+
message_history=result.all_messages())
|
68 |
+
if len(listOfString) > 2:
|
69 |
+
result_2 = agent.run_sync(user_prompt=f"Create me a powerpoint presentation from {listOfString[2]}",
|
70 |
+
message_history=result_1.all_messages())
|
71 |
+
|
72 |
+
print(result_2.data if len(listOfString) > 2 else result_1.data if len(listOfString) > 1 else result.data)
|
73 |
|
74 |
def ai_ppt(data):
|
75 |
asyncio.run(ppt_content(data=data))
|