Skip to content

Commit

Permalink
set MARVIN_OPENAI_API_KEY separately in environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mt7180 committed Mar 28, 2024
1 parent c8ffff9 commit 6991fb4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/script_RAG.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
from .document_categories import CATEGORY_LABELS
from .models import QuestionModel

marvin_settings.openai.api_key = os.getenv("OPENAI_API_KEY")
if openai_api_key := os.getenv("OPENAI_API_KEY"):
marvin_settings.openai.api_key = os.getenv("OPENAI_API_KEY")
os.environ["MARVIN_OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY") # type: ignore


class AITextDocument:
Expand Down

0 comments on commit 6991fb4

Please sign in to comment.