Skip to content

Commit

Permalink
Merge pull request #57 from mt7180/56-fix-marvin_openai_api_key-error
Browse files Browse the repository at this point in the history
set MARVIN_OPENAI_API_KEY separately in environment
  • Loading branch information
mt7180 authored Mar 28, 2024
2 parents c8ffff9 + 6991fb4 commit de6beec
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 de6beec

Please sign in to comment.