Spaces:
Running
Running
update method
Browse files
app.py
CHANGED
@@ -20,7 +20,10 @@ model = GroqModel('llama-3.1-70b-versatile', api_key = api_key)
|
|
20 |
|
21 |
def split_long_string(long_string, chunk_size=6000):
|
22 |
string_data = "".join(long_string)
|
23 |
-
|
|
|
|
|
|
|
24 |
|
25 |
|
26 |
async def ppt_content(data):
|
@@ -41,8 +44,7 @@ async def ppt_content(data):
|
|
41 |
"2. Text: he detailed description or narrative content of the slide. This should include key information, explanations, or supporting arguments. Keep it concise yet informative to avoid overwhelming the audience.",
|
42 |
"3. Bullet point: A list of bullet points summarizing key information on the slide. Each bullet point should be detail, long, and highlight a specific aspect of the slide's topic. ideally, limit to 3-5 points.",
|
43 |
"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.",
|
44 |
-
|
45 |
-
"".join(data)
|
46 |
|
47 |
|
48 |
))
|
@@ -56,10 +58,10 @@ async def ppt_content(data):
|
|
56 |
|
57 |
|
58 |
|
59 |
-
result_1 = agent.run_sync(user_prompt =
|
60 |
-
|
61 |
|
62 |
-
print(
|
63 |
|
64 |
|
65 |
def ai_ppt(data):
|
|
|
20 |
|
21 |
def split_long_string(long_string, chunk_size=6000):
|
22 |
string_data = "".join(long_string)
|
23 |
+
words = string_data.split()
|
24 |
+
chunks = [' '.join(words[i:i + chunk_size]) for i in range(0, len(words), chunk_size)]
|
25 |
+
|
26 |
+
return chunks
|
27 |
|
28 |
|
29 |
async def ppt_content(data):
|
|
|
44 |
"2. Text: he detailed description or narrative content of the slide. This should include key information, explanations, or supporting arguments. Keep it concise yet informative to avoid overwhelming the audience.",
|
45 |
"3. Bullet point: A list of bullet points summarizing key information on the slide. Each bullet point should be detail, long, and highlight a specific aspect of the slide's topic. ideally, limit to 3-5 points.",
|
46 |
"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.",
|
47 |
+
|
|
|
48 |
|
49 |
|
50 |
))
|
|
|
58 |
|
59 |
|
60 |
|
61 |
+
result_1 = agent.run_sync(user_prompt = listOfString[0])
|
62 |
+
result_2 = agent.run_sync(user_prompt = listOfString[1],message_history=result_1.new_messages())
|
63 |
|
64 |
+
print(result_2.data)
|
65 |
|
66 |
|
67 |
def ai_ppt(data):
|