Update crew.py
Browse files
crew.py
CHANGED
@@ -201,13 +201,17 @@ def run_crew(question, file_path):
|
|
201 |
if is_ext(file_path, ".docx"):
|
202 |
file_data = read_docx(file_path)
|
203 |
contents = [f"{question}\n{file_data}"]
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
else:
|
208 |
file = client.files.upload(file=file_path)
|
209 |
contents = [file, question]
|
210 |
|
|
|
|
|
|
|
|
|
211 |
response = client.models.generate_content(
|
212 |
model=DOCUMENT_ANALYSIS_MODEL,
|
213 |
contents=contents
|
|
|
201 |
if is_ext(file_path, ".docx"):
|
202 |
file_data = read_docx(file_path)
|
203 |
contents = [f"{question}\n{file_data}"]
|
204 |
+
if is_ext(file_path, ".pptx"):
|
205 |
+
file_data = read_pptx(file_path)
|
206 |
+
contents = [f"{question}\n{file_data}"]
|
207 |
else:
|
208 |
file = client.files.upload(file=file_path)
|
209 |
contents = [file, question]
|
210 |
|
211 |
+
print("###")
|
212 |
+
print(contents[0])
|
213 |
+
print("###")
|
214 |
+
|
215 |
response = client.models.generate_content(
|
216 |
model=DOCUMENT_ANALYSIS_MODEL,
|
217 |
contents=contents
|