From e3f65bdb5a0b9edcc989c6fc2872b7cab3a44dab Mon Sep 17 00:00:00 2001
From: maxyousif15 <max.yousif@15gifts.com>
Date: Tue, 20 Feb 2024 09:19:41 +0000
Subject: [PATCH] refactor: addressing PR comments

---
 semantic_router/encoders/openai.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/semantic_router/encoders/openai.py b/semantic_router/encoders/openai.py
index 24439bf6..924a005d 100644
--- a/semantic_router/encoders/openai.py
+++ b/semantic_router/encoders/openai.py
@@ -28,11 +28,11 @@ class OpenAIEncoder(BaseEncoder):
             name = os.getenv("OPENAI_MODEL_NAME", "text-embedding-ada-002")
         super().__init__(name=name, score_threshold=score_threshold)
         api_key = openai_api_key or os.getenv("OPENAI_API_KEY")
-        org_id = openai_org_id or os.getenv("OPENAI_ORGANIZATION")
-        if (api_key is None) and (org_id is None):
+        openai_org_id = openai_org_id or os.getenv("OPENAI_ORG_ID")
+        if (api_key is None):
             raise ValueError("OpenAI API key cannot be 'None'.")
         try:
-            self.client = openai.Client(api_key=api_key, organization=org_id)
+            self.client = openai.Client(api_key=api_key, organization=openai_org_id)
         except Exception as e:
             raise ValueError(
                 f"OpenAI API client failed to initialize. Error: {e}"
-- 
GitLab