Files changed (1) hide show
  1. wellbe_agent.py +4 -1
wellbe_agent.py CHANGED
@@ -10,7 +10,7 @@ from __future__ import annotations
10
  import asyncio
11
  from copy import deepcopy
12
  from typing import Tuple, Union, Optional
13
-
14
  from agents import Agent, Runner
15
  from agents.extensions.models.litellm_model import LitellmModel
16
  from agents.mcp.server import MCPServerStdio, MCPServerStreamableHttp
@@ -74,6 +74,9 @@ async def answer_question(
74
 
75
  def answer_sync(question: str, openai_key: str, email: str, password: str) -> str:
76
  """Blocking wrapper around :func:`answer_question`."""
 
 
 
77
  if not question.strip():
78
  return "Please enter a question."
79
  try:
 
10
  import asyncio
11
  from copy import deepcopy
12
  from typing import Tuple, Union, Optional
13
+ import os
14
  from agents import Agent, Runner
15
  from agents.extensions.models.litellm_model import LitellmModel
16
  from agents.mcp.server import MCPServerStdio, MCPServerStreamableHttp
 
74
 
75
  def answer_sync(question: str, openai_key: str, email: str, password: str) -> str:
76
  """Blocking wrapper around :func:`answer_question`."""
77
+ api_key = openai_key or os.getenv("OPENAI_API_KEY")
78
+ openai.api_key = api_key
79
+
80
  if not question.strip():
81
  return "Please enter a question."
82
  try: