mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 13:53:15 +00:00
* feat: default to GPT-5.5 medium reasoning Use OpenAI GPT-5.5 with medium reasoning as the default model and document the completion-token budget semantics for reasoning models. * fix: use Responses API reasoning config Pass GPT-5.5 reasoning settings through LangChain's Responses API parameter instead of the Chat Completions-only reasoning_effort field. * feat: raise GPT-5.5 output budget Set the default GPT-5.5 output token budget to the model maximum so long-running coding tasks have more room for reasoning and final responses. * feat: align recursion limit with Deep Agents Use Deep Agents' default recursion limit so longer coding runs have room to complete without Open SWE imposing a lower cap. * chore: remove minimal effort level * chore: reduce max tokens to 64_000 --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
28 lines
783 B
Python
28 lines
783 B
Python
from typing import Literal, TypedDict, Unpack
|
|
|
|
from langchain.chat_models import init_chat_model
|
|
|
|
OPENAI_RESPONSES_WS_BASE_URL = "wss://api.openai.com/v1"
|
|
|
|
|
|
OpenAIReasoningEffort = Literal["none", "low", "medium", "high", "xhigh"]
|
|
|
|
|
|
class OpenAIReasoning(TypedDict, total=False):
|
|
effort: OpenAIReasoningEffort
|
|
|
|
|
|
class ModelKwargs(TypedDict, total=False):
|
|
max_tokens: int | None
|
|
reasoning: OpenAIReasoning | None
|
|
temperature: float | None
|
|
|
|
|
|
def make_model(model_id: str, **kwargs: Unpack[ModelKwargs]):
|
|
model_kwargs: dict[str, object] = kwargs.copy()
|
|
|
|
if model_id.startswith("openai:"):
|
|
model_kwargs["base_url"] = OPENAI_RESPONSES_WS_BASE_URL
|
|
model_kwargs["use_responses_api"] = True
|
|
|
|
return init_chat_model(model=model_id, **model_kwargs)
|