Spaces:
Sleeping
Sleeping
Joachim M. Vis commited on
Upload tool_registry.py
Browse files22 unmodified lines232425262728100 unmodified lines12913013113213313454 unmodified lines18919019119219319422 unmodified lines)from tools.perplexity_tool import PerplexityTool, create_perplexity_toolfrom tools.arxiv_tool import ArxivSearchTool, create_arxiv_searchlogger = logging.getLogger("gaia_agent.tool_registry")100 unmodified linestopic = kwargs.get("topic")return tool.find_featured_articles(topic)else:return tool.run(**kwargs)54 unmodified linesexcept Exception as e:logger.warning(f"Failed to create Wikipedia search tool: {str(e)}")logger.info(f"Created default tool registry with {len(registry.list_tools())} tools")return registry22 unmodified lines23242526272829100 unmodified lines13013113213313413513613713813914014114254 unmodified lines19719819920020120220320420520620720820922 unmodified lines)from tools.perplexity_tool import PerplexityTool, create_perplexity_toolfrom tools.arxiv_tool import ArxivSearchTool, create_arxiv_searchfrom tools.multimodal_tools import YouTubeVideoTool, create_youtube_video_toollogger = logging.getLogger("gaia_agent.tool_registry")100 unmodified linestopic = kwargs.get("topic")return tool.find_featured_articles(topic)elif name == "youtube_video":video_id_or_url = kwargs.get("video_id_or_url")language = kwargs.get("language")if not video_id_or_url:raise ValueError("Video ID or URL is required for YouTube video analysis")return tool.extract_transcript(video_id_or_url, language)else:return tool.run(**kwargs)54 unmodified linesexcept Exception as e:logger.warning(f"Failed to create Wikipedia search tool: {str(e)}")# Register YouTube video tooltry:youtube_tool = create_youtube_video_tool()registry.register_tool("youtube_video", youtube_tool)except Exception as e:logger.warning(f"Failed to create YouTube video tool: {str(e)}")logger.info(f"Created default tool registry with {len(registry.list_tools())} tools")return registry
agent/tool_registry.py+15