Spaces:
Sleeping
Sleeping
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
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:
|
| 13 |
load_dotenv()
|
| 14 |
|
| 15 |
if provider=="openai":
|
| 16 |
-
if model
|
| 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:
|