Spaces:
Running
Running
more testing
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ class SupportDependencies:
|
|
60 |
async def ppt_content(data):
|
61 |
agent = Agent(model,
|
62 |
result_type=customClass.PPT,
|
63 |
-
deps_type=SupportDependencies,
|
64 |
tools=[
|
65 |
return_data,
|
66 |
],
|
@@ -80,17 +80,17 @@ async def ppt_content(data):
|
|
80 |
"3. Bullet point: A list of bullet points summarizing key information on the slide. Each bullet point should be short, presise, and highlight a specific aspect of the slide's topic. ideally, limit to 3-5 points.",
|
81 |
#"4. Image Suggestion: A prompt for generating an image to complement the slide content. Describe the desired visual in detail, including elements, style, and relevance to the topic. Ensure the prompt is actionable for AI tools.",
|
82 |
))
|
83 |
-
deps :SupportDependencies = SupportDependencies(db="".join(data))
|
84 |
listOfString = split_into_token_chunks("".join(data))
|
85 |
-
print(len(listOfString))
|
86 |
message_history: list[ModelMessage] = []
|
87 |
# for i, chunk in enumerate(listOfString):
|
88 |
# print(f"Chunk {i}:\n{chunk}\n")
|
89 |
|
90 |
|
91 |
-
result = agent.run_sync(user_prompt = f"Create me a powerpoint presentation" +
|
92 |
message_history = message_history,
|
93 |
-
|
94 |
)
|
95 |
|
96 |
print(result.data)
|
@@ -106,17 +106,17 @@ async def ppt_content(data):
|
|
106 |
|
107 |
|
108 |
def ai_ppt(data):
|
109 |
-
#call summerizer to summerize pdf
|
110 |
-
summary_texts = []
|
111 |
-
listOfString = split_into_token_chunks("".join(data))
|
112 |
-
for x in listOfString:
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
|
118 |
-
#summary_texts = [item['generated_text'] for item in summary]
|
119 |
-
asyncio.run(ppt_content(data=
|
120 |
|
121 |
|
122 |
def extract_data(feed):
|
|
|
60 |
async def ppt_content(data):
|
61 |
agent = Agent(model,
|
62 |
result_type=customClass.PPT,
|
63 |
+
#deps_type=SupportDependencies,
|
64 |
tools=[
|
65 |
return_data,
|
66 |
],
|
|
|
80 |
"3. Bullet point: A list of bullet points summarizing key information on the slide. Each bullet point should be short, presise, and highlight a specific aspect of the slide's topic. ideally, limit to 3-5 points.",
|
81 |
#"4. Image Suggestion: A prompt for generating an image to complement the slide content. Describe the desired visual in detail, including elements, style, and relevance to the topic. Ensure the prompt is actionable for AI tools.",
|
82 |
))
|
83 |
+
#deps :SupportDependencies = SupportDependencies(db="".join(data))
|
84 |
listOfString = split_into_token_chunks("".join(data))
|
85 |
+
# print(len(listOfString))
|
86 |
message_history: list[ModelMessage] = []
|
87 |
# for i, chunk in enumerate(listOfString):
|
88 |
# print(f"Chunk {i}:\n{chunk}\n")
|
89 |
|
90 |
|
91 |
+
result = agent.run_sync(user_prompt = f"Create me a powerpoint presentation for: " + listOfString[0],
|
92 |
message_history = message_history,
|
93 |
+
|
94 |
)
|
95 |
|
96 |
print(result.data)
|
|
|
106 |
|
107 |
|
108 |
def ai_ppt(data):
|
109 |
+
# #call summerizer to summerize pdf
|
110 |
+
# summary_texts = []
|
111 |
+
# listOfString = split_into_token_chunks("".join(data))
|
112 |
+
# for x in listOfString:
|
113 |
+
# print(x)
|
114 |
+
# summary = summarizer(x, max_length=500, min_length=120, truncation=True,do_sample=False)
|
115 |
+
# summary_texts .append([item['summary_text'] for item in summary])
|
116 |
+
# print(summary_texts)
|
117 |
|
118 |
+
# #summary_texts = [item['generated_text'] for item in summary]
|
119 |
+
asyncio.run(ppt_content(data=data))
|
120 |
|
121 |
|
122 |
def extract_data(feed):
|