Commit ·
fba8c96
1
Parent(s): aa94df3
Update agent prompt
Browse files8 unmodified lines91011121314151612 unmodified lines29303132333412 unmodified lines47484950515253548 unmodified linesexcel_reader,math_calculator,search_engine,image_transcriber,YoutubeTranscriberTool,)from utils import OPENAI_MODEL_ID12 unmodified linesKey points:- Do not add any prefix or suffix to YOUR FINAL ANSWER.- Answer shortly and concisely, following the template strictly."""12 unmodified linestxt_reader,pdf_reader,excel_reader,image_transcriber,YoutubeTranscriberTool(),],max_steps=5,model=model,8 unmodified lines9101112131415161712 unmodified lines30313233343536373839404112 unmodified lines5455565758596061628 unmodified linesexcel_reader,math_calculator,search_engine,image_analyzer,YoutubeTranscriberTool,YoutubeVideoDescriptorTool,)from utils import OPENAI_MODEL_ID12 unmodified linesKey points:- Do not add any prefix or suffix to YOUR FINAL ANSWER.- Answer shortly and concisely, following the template strictly.- Again, YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.Example:[Final Answer: 42]Good example: "42"Bad example: "The answer is 42""""12 unmodified linestxt_reader,pdf_reader,excel_reader,image_analyzer,YoutubeTranscriberTool(),YoutubeVideoDescriptorTool(),],max_steps=5,model=model,
307 unmodified lines3083093103113123133143153164 unmodified lines321322323324325326327328329307 unmodified linesif not ret:break# Keep every Nth frame to reduce to target_fpsif i % frame_interval == 0:frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)) # store frame in memory (RGB)i += 14 unmodified lines_, buffer = cv2.imencode(".jpg", frame)encoded_buffer = base64.b64encode(buffer).decode("utf-8")base64_frames.append(encoded_buffer)if len(base64_frames) == 20: # yield every 20 framesyield base64_framesbase64_frames = []def forward(self, task: str, youtube_url: str) -> str: # pylint: disable=W0221file_name = f"{uuid4()}.mp4"307 unmodified lines3083093103113123133143154 unmodified lines320321322323324325326327328329330331332307 unmodified linesif not ret:breakif i % frame_interval == 0:frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))i += 14 unmodified lines_, buffer = cv2.imencode(".jpg", frame)encoded_buffer = base64.b64encode(buffer).decode("utf-8")base64_frames.append(encoded_buffer)if len(base64_frames) == 20:# yield every 20 framesyield base64_framesbase64_frames = []# yield any remaining framesif len(frames) < 20:yield base64_framesdef forward(self, task: str, youtube_url: str) -> str: # pylint: disable=W0221file_name = f"{uuid4()}.mp4"
agent.py+10-2
tools.py+6-3