From 115d6ab915f527b1f7b547d31253350c905ed88b Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Tue, 5 Sep 2023 09:20:50 -0700 Subject: [PATCH] move loadenv into devbox only (#6899) --- packages/python-packages/apiview-gpt/src/_vector_db.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/python-packages/apiview-gpt/src/_vector_db.py b/packages/python-packages/apiview-gpt/src/_vector_db.py index befce572726..68d8cce06b6 100644 --- a/packages/python-packages/apiview-gpt/src/_vector_db.py +++ b/packages/python-packages/apiview-gpt/src/_vector_db.py @@ -1,6 +1,4 @@ import os -import dotenv -import json import json import requests from typing import List, Union @@ -8,7 +6,11 @@ from ._sectioned_document import SectionedDocument, Section from ._models import VectorDocument, VectorSearchResult -dotenv.load_dotenv() + +if "APPSETTING_WEBSITE_SITE_NAME" not in os.environ: + # running on dev machine, loadenv + import dotenv + dotenv.load_dotenv() _PACKAGE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) _BASE_URL = "https://apiviewuat.azurewebsites.net/api/AIComments"