Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions WebAgent/WebResummer/src/tool_visit.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@ def call_server(self, msgs, max_retries=2):
api_key=SUMMARY_API_KEY,
base_url=SUMMARY_URL,
)
# Reasoning models (o1, o3, o4) and some newer models (e.g. gpt-5) do not support
# the temperature parameter; skip it for those model families.
_NO_TEMPERATURE_PREFIXES = ("o1", "o3", "o4", "gpt-5")
for attempt in range(max_retries):
try:
chat_response = client.chat.completions.create(
model=SUMMARY_MODEL_NAME,
messages=msgs,
temperature=0.7
)
create_kwargs = dict(model=SUMMARY_MODEL_NAME, messages=msgs)
if not any(SUMMARY_MODEL_NAME.startswith(p) for p in _NO_TEMPERATURE_PREFIXES):
create_kwargs["temperature"] = 0.7
chat_response = client.chat.completions.create(**create_kwargs)
content = chat_response.choices[0].message.content
print(content)
if content:
Expand Down
12 changes: 7 additions & 5 deletions inference/tool_visit.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,15 @@ def call_server(self, msgs, max_retries=2):
api_key=api_key,
base_url=url_llm,
)
# Reasoning models (o1, o3, o4) and some newer models (e.g. gpt-5) do not support
# the temperature parameter; skip it for those model families.
_NO_TEMPERATURE_PREFIXES = ("o1", "o3", "o4", "gpt-5")
for attempt in range(max_retries):
try:
chat_response = client.chat.completions.create(
model=model_name,
messages=msgs,
temperature=0.7
)
create_kwargs = dict(model=model_name, messages=msgs)
if not any(model_name.startswith(p) for p in _NO_TEMPERATURE_PREFIXES):
create_kwargs["temperature"] = 0.7
chat_response = client.chat.completions.create(**create_kwargs)
content = chat_response.choices[0].message.content
if content:
try:
Expand Down