Skip to content

Commit

Permalink
Update OpenAI client initialization to use API key from environment v…
Browse files Browse the repository at this point in the history
…ariable
  • Loading branch information
Jamie Liu committed Dec 12, 2024
1 parent bd6be22 commit 5cc56e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/gateway/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import DeclarativeBase
Expand All @@ -23,7 +25,7 @@ def create_app():
# Initialize SQLAlchemy with the app
db.init_app(app)
# Initialize the OpenAI client
client = OpenAI()
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

# Register routes
from .api_routes import create_api_routes
Expand Down

0 comments on commit 5cc56e2

Please sign in to comment.