Denis Davydov commited on
Commit ·
31ed54e
1
Parent(s): c80da8b
remove calculator tool
Browse files165 unmodified lines166167168169170171172173174175176177178179180181182183184185186187188189190191193 unmodified lines385386387388389390165 unmodified linesdescription="Analyzes images to extract information. Use this for questions involving visual content.")def calculator_tool_func(expression: str) -> str:"""Performs mathematical calculations safely."""try:# Basic safety check - only allow certain charactersallowed_chars = set('0123456789+-*/().= ')if not all(c in allowed_chars for c in expression):return f"Invalid characters in expression: {expression}"# Use eval safely for basic mathresult = eval(expression)return f"Calculation result: {expression} = {result}"except Exception as e:return f"Calculation failed for '{expression}': {str(e)}"calculator_tool = Tool(name="calculator",func=calculator_tool_func,description="Performs mathematical calculations. Use this for numerical computations and math problems.")def text_processor_tool_func(text: str, operation: str = "summarize") -> str:"""Processes text for various operations like summarization, extraction, etc."""try:193 unmodified linesweb_search_tool,file_download_tool,image_analysis_tool,calculator_tool,text_processor_tool]165 unmodified lines166167168169170171193 unmodified lines365366367368369165 unmodified linesdescription="Analyzes images to extract information. Use this for questions involving visual content.")def text_processor_tool_func(text: str, operation: str = "summarize") -> str:"""Processes text for various operations like summarization, extraction, etc."""try:193 unmodified linesweb_search_tool,file_download_tool,image_analysis_tool,text_processor_tool]
tools.py-21