stefanches7 commited on
Commit
3f97c48
·
1 Parent(s): f2a8768

require provider and model, use temperature=1 and big tockens num for all gpt-5 models

Browse files
Files changed (1) hide show
  1. agent.py +2 -2
agent.py CHANGED
@@ -9,11 +9,11 @@ import prompts
9
  class BIDSifierAgent:
10
  """Wrapper around OpenAI chat API for step-wise BIDSification."""
11
 
12
- def __init__(self, *, provider: Optional[str] = None, model: Optional[str] = None, openai_api_key: Optional[str] = None, temperature: float = 0.2):
13
  load_dotenv()
14
 
15
  if provider=="openai":
16
- if model == "gpt-5": #reasoning model that requires special handling
17
  temperature = 1.0
18
  lm = dspy.LM(f"{provider}/{model}", api_key=openai_api_key or os.getenv("OPENAI_API_KEY"), temperature = temperature, max_tokens = 40000)
19
  else:
 
9
  class BIDSifierAgent:
10
  """Wrapper around OpenAI chat API for step-wise BIDSification."""
11
 
12
+ def __init__(self, *, provider: str, model: str, openai_api_key: Optional[str] = None, temperature: float = 0.2):
13
  load_dotenv()
14
 
15
  if provider=="openai":
16
+ if model.startswith("gpt-5"): #reasoning model that requires special handling
17
  temperature = 1.0
18
  lm = dspy.LM(f"{provider}/{model}", api_key=openai_api_key or os.getenv("OPENAI_API_KEY"), temperature = temperature, max_tokens = 40000)
19
  else: