Spaces:
Sleeping
Sleeping
Update app.py
Browse filesmake a complete agent implementation with image generation tool and web search tool and fact checking task guideline in prompt
45 unmodified lines46474849505152535455565758596061626345 unmodified lines# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)with open("prompts.yaml", 'r') as stream:prompt_templates = yaml.safe_load(stream)agent = CodeAgent(model=model,tools=[final_answer], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,planning_interval=None,name=None,description=None,prompt_templates=prompt_templates)45 unmodified lines46474849505152535455565758596061626345 unmodified lines# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)with open("my_code_agent.yaml", 'r') as stream:prompt_templates = yaml.safe_load(stream)agent = CodeAgent(model=model,tools=[image_generation_tool, DuckDuckGoSearchTool(), final_answer], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,planning_interval=None,name="fact_checker_agent_with_image_generation_capability",description="interpret user's intent and generate image or do web search based on user prompt or behavior as fact checker",prompt_templates=prompt_templates)
app.py+4-4