Skip to content

Commit fbbe8e7

Browse files
Remove localhost and added env variable
1 parent bfe0c10 commit fbbe8e7

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ services:
120120
DB_PORT: ${DB_PORT:-9090}
121121
DB_GRPC_PORT: ${DB_GRPC_PORT:-50051}
122122
OPEN_WEB_UI_API_KEY: ${OPEN_WEB_UI_API_KEY}
123+
SERVER_URL: ${SERVER_URL:-http://localhost:9091}
124+
CLIENT_URL: ${CLIENT_URL:-http://localhost:3000}
125+
GENAI_URL: ${GENAI_URL:-http://localhost:8000}
126+
API_URL: ${API_URL:-https://gpu.aet.cit.tum.de/api/chat/completions}
123127
depends_on:
124128
- weaviate
125129
volumes:

genai/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
OPEN_WEB_UI_API_KEY=your-api-key-here
1+
OPEN_WEB_UI_API_KEY=your-api-key-here
2+
API_URL="https://your-api-url-here"

genai/app/main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121

2222
# Environment configuration
2323
OPEN_WEB_UI_API_KEY = os.getenv("OPEN_WEB_UI_API_KEY")
24-
API_URL = "https://gpu.aet.cit.tum.de/api/chat/completions"
25-
24+
API_URL = os.getenv("API_URL")
25+
SERVER_URL = os.getenv("SERVER_URL")
26+
CLIENT_URL = os.getenv("CLIENT_URL")
27+
GENAI_URL = os.getenv("GENAI_URL")
2628

2729
class OpenWebUILLM(LLM):
2830
api_url: str = API_URL
@@ -97,14 +99,14 @@ def custom_openapi():
9799
title=app.title,
98100
version=app.version,
99101
routes=app.routes,
100-
servers=[{"url": "http://localhost:8000"}],
102+
servers=[{"url": GENAI_URL}],
101103
)
102104
)
103105

104106

105107
app.add_middleware(
106108
CORSMiddleware,
107-
allow_origins=["http://localhost:3000", "http://localhost:9091"],
109+
allow_origins=[CLIENT_URL, SERVER_URL],
108110
allow_credentials=True,
109111
allow_methods=["*"],
110112
allow_headers=["*"],

0 commit comments

Comments
 (0)