Created
October 15, 2025 15:19
-
-
Save minherz/700cc949e95fb1765def712fa3fed183 to your computer and use it in GitHub Desktop.
Main application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from google.adk.cli.fast_api import get_fast_api_app | |
| from fastapi import FastAPI | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| # Discover the `weather_agent` directory in current working dir | |
| AGENT_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| # Create FastAPI app with enabled cloud tracing | |
| app: FastAPI = get_fast_api_app( | |
| agents_dir=AGENT_DIR, | |
| web=True, | |
| session_service_uri='agentengine://projects/genai-with-internet-001/locations/us-west1/reasoningEngines/2798951984038674432', | |
| # trace_to_cloud=True, | |
| ) | |
| app.title = "Friendly Zoo keeper" | |
| app.description = "Get your questions about animals answered by AI zoo keeper." | |
| # Main execution | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run(app, host="0.0.0.0", port=os.environ.get("PORT", "8080")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment