Spaces:
Sleeping
Sleeping
SHAMIL SHAHBAZ AWAN commited on
Update app.py
Browse files49 unmodified lines505152535455561 unmodified line5859606162636449 unmodified lines# Format the top 3 space news articlesformatted_news = "\n\n".join([f"π° **{article.get('title', 'Untitled')}**\nπ [Read More]({article.get('url', '#')})" for article in news_results[:3]])return {"output": f"π **Latest Space News:**\n\n{formatted_news}"}1 unmodified lineexcept Exception as e:return {"output": f"π **Space News Update:** Unable to fetch news. Error: {str(e)}"}def astronomy_image_agent(user_input: str):"""Retrieves astronomy-related images from NASA's Image and Video Library or the Astronomy Picture of the Day (APOD) API.49 unmodified lines505152535455561 unmodified line58596061626349 unmodified lines# Format the top 3 space news articlesformatted_news = "\n\n".join([f"π° **{article.get('title', 'Untitled')}**\nπ [Read More]({article.get('url', '#'}) )" for article in news_results[:3]])return {"output": f"π **Latest Space News:**\n\n{formatted_news}"}1 unmodified lineexcept Exception as e:return {"output": f"π **Space News Update:** Unable to fetch news. Error: {str(e)}"}def astronomy_image_agent(user_input: str):"""Retrieves astronomy-related images from NASA's Image and Video Library or the Astronomy Picture of the Day (APOD) API.
app.py+1-2