sarim commited on
Commit
04f5bb7
·
1 Parent(s): 03b4c19

update method

Browse files
Files changed (1) hide show
  1. app.py +8 -6
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
- return [string_data[i:i+chunk_size] for i in range(0, len(string_data), chunk_size)]
 
 
 
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
- "Below is the text extracted from pdf",
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 = "Create content for presentation and pdf extracted text is in 'system_prompt'")
60
- #result_2 = agent.run_sync(user_prompt = listOfString[1],message_history=result_1.new_messages())
61
 
62
- print(result_1.data)
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):