Spaces:
Sleeping
Sleeping
Commit
·
b7d6ca3
1
Parent(s):
7ea8ccb
case sensitivity
Browse files
app.py
CHANGED
@@ -16,19 +16,19 @@ import time
|
|
16 |
|
17 |
# Load environment variables
|
18 |
load_dotenv()
|
19 |
-
|
20 |
LANGSMITH_API_KEY = os.getenv("LANGSMITH_API_KEY")
|
21 |
ASSISTANT_ID = os.getenv("ASSISTANT_ID_SOLUTION_SPECIFIER_A")
|
22 |
|
23 |
-
if not all([
|
24 |
-
raise ValueError("Please set
|
25 |
|
26 |
# Initialize logging
|
27 |
logging.basicConfig(format="[%(asctime)s] %(levelname)s: %(message)s", level=logging.INFO)
|
28 |
logger = logging.getLogger(__name__)
|
29 |
|
30 |
# Initialize Langsmith's traceable OpenAI client
|
31 |
-
wrapped_openai = wrap_openai(openai.Client(api_key=
|
32 |
|
33 |
# Initialize Langsmith client (ensure you have configured Langsmith correctly)
|
34 |
# Assuming Langsmith uses environment variables or configuration files for setup
|
|
|
16 |
|
17 |
# Load environment variables
|
18 |
load_dotenv()
|
19 |
+
openai.api_key = os.getenv("openai.api_key")
|
20 |
LANGSMITH_API_KEY = os.getenv("LANGSMITH_API_KEY")
|
21 |
ASSISTANT_ID = os.getenv("ASSISTANT_ID_SOLUTION_SPECIFIER_A")
|
22 |
|
23 |
+
if not all([openai.api_key, LANGSMITH_API_KEY, ASSISTANT_ID]):
|
24 |
+
raise ValueError("Please set openai.api_key, LANGSMITH_API_KEY, and ASSISTANT_ID in your .env file.")
|
25 |
|
26 |
# Initialize logging
|
27 |
logging.basicConfig(format="[%(asctime)s] %(levelname)s: %(message)s", level=logging.INFO)
|
28 |
logger = logging.getLogger(__name__)
|
29 |
|
30 |
# Initialize Langsmith's traceable OpenAI client
|
31 |
+
wrapped_openai = wrap_openai(openai.Client(api_key=openai.api_key, api_base="https://api.openai.com"))
|
32 |
|
33 |
# Initialize Langsmith client (ensure you have configured Langsmith correctly)
|
34 |
# Assuming Langsmith uses environment variables or configuration files for setup
|