CubeLoop — a Pythonic, async-native agent harness core designed for high performance, readability, and production-grade persistence.
Python agent-frameworkagent-harnessagent-runtimeagentic-aiai-agentsai-frameworkanthropicharnessharness-engineeringharness-frameworklanggraphlanggraph-alternativellmmcpopenaipi-agentpi-agent-corepythonpython-agent
feat(providers): forward max_tokens and temperature in stream calls
xf gong5f8ae6cc615e
diff --git a/cubepi/providers/base.py b/cubepi/providers/base.pyindex 73e827d..8464bd8 100644--- a/cubepi/providers/base.py+++ b/cubepi/providers/base.py@@ -82,6 +82,7 @@ class Model(BaseModel):reasoning: bool = Falsecontext_window: int = 200_000max_tokens: int = 8192+ temperature: float = 0.7cost: ModelCost | None = Nonethinking_level_map: dict[str, str | None] | None = Nonediff --git a/cubepi/providers/openai.py b/cubepi/providers/openai.pyindex 02f9f63..e8d0ecc 100644--- a/cubepi/providers/openai.py+++ b/cubepi/providers/openai.py@@ -72,6 +72,8 @@ class OpenAIProvider:"model": model.id,"messages": api_messages,"stream": True,+ "max_tokens": model.max_tokens,+ "temperature": model.temperature,}if tools:kwargs["tools"] = [self._convert_tool(t) for t in tools]diff --git a/cubepi/providers/openai_responses.py b/cubepi/providers/openai_responses.pyindex 552e8b0..c2c7e77 100644--- a/cubepi/providers/openai_responses.py+++ b/cubepi/providers/openai_responses.py@@ -98,6 +98,11 @@ class OpenAIResponsesProvider:if model.max_tokens:kwargs["max_output_tokens"] = model.max_tokens+ # Forward temperature for non-reasoning models; reasoning models don't+ # support temperature on the Responses API.+ if not model.reasoning:+ kwargs["temperature"] = model.temperature+async def _produce() -> None:try:nonlocal kwargs