Skip to content
Merged
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
16 changes: 15 additions & 1 deletion cockpit/chat/generative-ui/python/src/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@
_PROMPT = (Path(__file__).parent.parent / "prompts" / "dashboard.md").read_text()

_llm = ChatOpenAI(model="gpt-5-mini", temperature=0, streaming=True)
_llm_with_tools = _llm.bind_tools(ALL_TOOLS)

# Dedicated planner: full gpt-5 with minimal reasoning effort.
# gpt-5-mini at default reasoning ignores the "EXACTLY ONE tool" directive
# in plan_tools and reflexively calls all four data tools on every
# follow-up — verified in chrome MCP after PR #363 tightened the prompt
# but the model still over-called. Bumping the planner to gpt-5 sharpens
# instruction-following, and reasoning_effort='minimal' suppresses the
# "let me be thorough" deliberation that drives the fan-out.
_planner_llm = ChatOpenAI(
model="gpt-5",
temperature=0,
streaming=True,
reasoning_effort="minimal",
)
_llm_with_tools = _planner_llm.bind_tools(ALL_TOOLS)


class DashboardState(MessagesState):
Expand Down
16 changes: 15 additions & 1 deletion cockpit/langgraph/streaming/python/src/dashboard_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@
_PROMPT = (Path(__file__).parent.parent / "prompts" / "dashboard.md").read_text()

_llm = ChatOpenAI(model="gpt-5-mini", temperature=0, streaming=True)
_llm_with_tools = _llm.bind_tools(ALL_TOOLS)

# Dedicated planner: full gpt-5 with minimal reasoning effort.
# gpt-5-mini at default reasoning ignores the "EXACTLY ONE tool" directive
# in plan_tools and reflexively calls all four data tools on every
# follow-up — verified in chrome MCP after PR #363 tightened the prompt
# but the model still over-called. Bumping the planner to gpt-5 sharpens
# instruction-following, and reasoning_effort='minimal' suppresses the
# "let me be thorough" deliberation that drives the fan-out.
_planner_llm = ChatOpenAI(
model="gpt-5",
temperature=0,
streaming=True,
reasoning_effort="minimal",
)
_llm_with_tools = _planner_llm.bind_tools(ALL_TOOLS)


class DashboardState(MessagesState):
Expand Down
Loading