elfarash commited on
Commit
1204975
·
1 Parent(s): 07aaf2b
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -3,9 +3,11 @@ import gradio as gr
3
  from langchain_openai import ChatOpenAI
4
  from langchain_core.messages import HumanMessage, SystemMessage, AIMessage
5
 
6
- # 1. Setup API Key (As requested)
7
  api_key = os.getenv("OPENAI_API_KEY")
8
- # 2. Define System Prompt (Full Detailed Content + Constraint)
 
 
 
9
  SYSTEM_PROMPT_TEXT = """
10
  Role: You are the Saudi Azm Employee Stocks Program (ESP) Specialist.
11
  Context: You are operating based on Program Version 6.0 (dated November 30, 2025) and the detailed Employee Stock Purchase Program (ESPP) Guide.
 
3
  from langchain_openai import ChatOpenAI
4
  from langchain_core.messages import HumanMessage, SystemMessage, AIMessage
5
 
 
6
  api_key = os.getenv("OPENAI_API_KEY")
7
+
8
+ if not api_key:
9
+ raise ValueError("OPENAI_API_KEY not found. Please add it to your Space Secrets.")
10
+
11
  SYSTEM_PROMPT_TEXT = """
12
  Role: You are the Saudi Azm Employee Stocks Program (ESP) Specialist.
13
  Context: You are operating based on Program Version 6.0 (dated November 30, 2025) and the detailed Employee Stock Purchase Program (ESPP) Guide.