sarim commited on
Commit
766236b
·
1 Parent(s): 5ef6425

logic change

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -60,6 +60,7 @@ class SupportDependencies:
60
  async def ppt_content(data):
61
  agent = Agent(model,
62
  result_type=customClass.PPT,
 
63
  tools=[
64
  return_data,
65
  ],
@@ -79,6 +80,7 @@ async def ppt_content(data):
79
  "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.",
80
  #"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.",
81
  ))
 
82
  listOfString = split_into_token_chunks("".join(data))
83
  print(len(listOfString))
84
  message_history: list[ModelMessage] = []
@@ -86,13 +88,14 @@ async def ppt_content(data):
86
  # print(f"Chunk {i}:\n{chunk}\n")
87
 
88
  for x in listOfString:
89
- result = agent.run_sync(user_prompt = f"Create me a powerpoint presentation {x}",message_history = message_history)
 
90
  message_history = result.all_messages()
91
  result_data.append(result.data)
92
  print(result_data[-1])
93
 
94
 
95
- deps :SupportDependencies = SupportDependencies(db="".join(data))
96
  # while len(listOfString) > 0:
97
 
98
  # result_1 = agent.run_sync(user_prompt = f"Create me a powerpoint presentation",message_history=message_history)
 
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] = []
 
88
  # print(f"Chunk {i}:\n{chunk}\n")
89
 
90
  for x in listOfString:
91
+ result = agent.run_sync(user_prompt = f"Create me a powerpoint presentation {x}",message_history = message_history,deps=deps)
92
+ message_history = []
93
  message_history = result.all_messages()
94
  result_data.append(result.data)
95
  print(result_data[-1])
96
 
97
 
98
+
99
  # while len(listOfString) > 0:
100
 
101
  # result_1 = agent.run_sync(user_prompt = f"Create me a powerpoint presentation",message_history=message_history)