Spaces:
Build error
Build error
corrected excel tool, added mp3 tool
Browse filesFiles changed (3)
14 unmodified lines15161718192036 unmodified lines57585960616214 unmodified linesdataclasses-json==0.6.7distro==1.9.0docutils==0.21.2fastapi==0.115.12feedparser==6.0.11ffmpy==0.5.036 unmodified linesmypy_extensions==1.1.0numpy==2.2.6openai==1.81.0orjson==3.10.18ormsgpack==1.9.1packaging==24.214 unmodified lines1516171819202136 unmodified lines5859606162636414 unmodified linesdataclasses-json==0.6.7distro==1.9.0docutils==0.21.2et_xmlfile==2.0.0fastapi==0.115.12feedparser==6.0.11ffmpy==0.5.036 unmodified linesmypy_extensions==1.1.0numpy==2.2.6openai==1.81.0openpyxl==3.1.5orjson==3.10.18ormsgpack==1.9.1packaging==24.2
1 unmodified line2345671 unmodified lineBefore answering please create a plan how to get additional information (via tools) before starting analysis.If there is an image attached (file name and file URL) use tool for automatic image download and analysis with precise question.If there is an Excel file attached (file name and file URL) use tool for getting content of the Excel file from URL.Format of your answer - [ANSWER]. [ANSWER] can be a number, list of items divided by comma or a string. Be very concise and clear with the answer.Do not include any plans, thoughts and explanations into the answer. Just provide concise and unambiguous answer in the format above.1 unmodified line23456781 unmodified lineBefore answering please create a plan how to get additional information (via tools) before starting analysis.If there is an image attached (file name and file URL) use tool for automatic image download and analysis with precise question.If there is an Excel file attached (file name and file URL) use tool for getting content of the Excel file from URL.If there is an MP3 file attached (file name and file URL) use tool for getting content by transcribing text out of file URL.Format of your answer - [ANSWER]. [ANSWER] can be a number, list of items divided by comma or a string. Be very concise and clear with the answer.Do not include any plans, thoughts and explanations into the answer. Just provide concise and unambiguous answer in the format above.
11 unmodified lines121314151617118 unmodified lines13613713813914014114214314414511 unmodified linesimport osimport base64import requestsllm = ChatOpenAI(model="gpt-4.1")118 unmodified lines# return the contentreturn contentdef compile_agent():tools = [multiply, divide, add, subtract, square_root, web_search_tool, arxiv_search,wikidata_search, wikipedia_search, download_image_and_analyze, get_excel_file_content]# HUGGINGFACEHUB_API_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")11 unmodified lines1213141516171819118 unmodified lines13813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017111 unmodified linesimport osimport base64import requestsimport pandas as pdfrom openai import OpenAIllm = ChatOpenAI(model="gpt-4.1")118 unmodified lines# return the contentreturn content@tooldef transcribe_audio_mp3_file(mp3_file_url: str) -> str:"""Download Mp3 file, transcribe audio and return text"""# download the image using requests libraryresponse = requests.get(mp3_file_url)# save the file to a temporary locationtemp_file_path = "/tmp/temp.mp3"with open(temp_file_path, "wb") as file:file.write(response.content)client = OpenAI()audio_file = open(temp_file_path, "rb")transcription = client.audio.transcriptions.create(model="gpt-4o-transcribe",file=audio_file,response_format="text")# return the contentreturn transcriptiondef compile_agent():tools = [multiply, divide, add, subtract, square_root, web_search_tool, arxiv_search,wikidata_search, wikipedia_search, download_image_and_analyze, get_excel_file_content, transcribe_audio_mp3_file]# HUGGINGFACEHUB_API_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
requirements.txt+2
system_prompt.txt+1
unit4agent.py+27-1