Spaces:
Running
Running
Add environment variable debugging for GOOGLE_API_KEY
Browse files- Dockerfile +4 -0
- app/main.py +12 -2
Dockerfile
CHANGED
@@ -13,4 +13,8 @@ ENV PYTHONPATH=/app
|
|
13 |
RUN mkdir -p /app/.composio && chmod 777 /app/.composio
|
14 |
ENV COMPOSIO_CACHE_DIR=/app/.composio
|
15 |
|
|
|
|
|
|
|
|
|
16 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
13 |
RUN mkdir -p /app/.composio && chmod 777 /app/.composio
|
14 |
ENV COMPOSIO_CACHE_DIR=/app/.composio
|
15 |
|
16 |
+
# Debug: Print environment variables
|
17 |
+
RUN echo "GOOGLE_API_KEY is: $GOOGLE_API_KEY" > /app/env_debug.txt
|
18 |
+
RUN echo "COMPOSIO_API_KEY is: $COMPOSIO_API_KEY" >> /app/env_debug.txt
|
19 |
+
|
20 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
app/main.py
CHANGED
@@ -1,15 +1,25 @@
|
|
1 |
# app/main.py
|
|
|
|
|
2 |
from fastapi import FastAPI, HTTPException
|
3 |
from fastapi.middleware.cors import CORSMiddleware
|
4 |
from pydantic import BaseModel
|
5 |
from .config import Config
|
6 |
from .agent import GmailAgent
|
7 |
-
from app import __version__
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
app = FastAPI(
|
10 |
title="Gmail Agent API",
|
11 |
description="API for Gmail management using Gemini and Composio",
|
12 |
-
version=
|
13 |
)
|
14 |
|
15 |
# Add CORS middleware
|
|
|
1 |
# app/main.py
|
2 |
+
import os
|
3 |
+
import logging
|
4 |
from fastapi import FastAPI, HTTPException
|
5 |
from fastapi.middleware.cors import CORSMiddleware
|
6 |
from pydantic import BaseModel
|
7 |
from .config import Config
|
8 |
from .agent import GmailAgent
|
|
|
9 |
|
10 |
+
# Set up logging
|
11 |
+
logging.basicConfig(level=logging.DEBUG)
|
12 |
+
logger = logging.getLogger(__name__)
|
13 |
+
|
14 |
+
# Log environment variables
|
15 |
+
logger.debug(f"GOOGLE_API_KEY: {os.getenv('GOOGLE_API_KEY')}")
|
16 |
+
logger.debug(f"COMPOSIO_API_KEY: {os.getenv('COMPOSIO_API_KEY')}")
|
17 |
+
|
18 |
+
# Rest of your existing code...
|
19 |
app = FastAPI(
|
20 |
title="Gmail Agent API",
|
21 |
description="API for Gmail management using Gemini and Composio",
|
22 |
+
version="1.0.0"
|
23 |
)
|
24 |
|
25 |
# Add CORS middleware
|