Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,11 +33,11 @@ class LangGraphAgent:
|
|
| 33 |
def __init__(self):
|
| 34 |
print("LangGraphAgent initialized.")
|
| 35 |
|
| 36 |
-
|
| 37 |
print(f"Loaded OpenAI Key: {openai_key[:3]}...") # Avoid printing the full key in logs
|
| 38 |
|
| 39 |
# Define a simple LangGraph that uses OpenAI to answer questions
|
| 40 |
-
self.llm = ChatOpenAI(model="gpt-4.1", temperature=0, api_key=
|
| 41 |
|
| 42 |
def answer_fn(state):
|
| 43 |
question = state["question"]
|
|
|
|
| 33 |
def __init__(self):
|
| 34 |
print("LangGraphAgent initialized.")
|
| 35 |
|
| 36 |
+
openai_key = os.environ.get("OPEN_AI_KEY")
|
| 37 |
print(f"Loaded OpenAI Key: {openai_key[:3]}...") # Avoid printing the full key in logs
|
| 38 |
|
| 39 |
# Define a simple LangGraph that uses OpenAI to answer questions
|
| 40 |
+
self.llm = ChatOpenAI(model="gpt-4.1", temperature=0, api_key=openai_key)
|
| 41 |
|
| 42 |
def answer_fn(state):
|
| 43 |
question = state["question"]
|