Skip to content

Commit e86ecde

Browse files
tylerslatonclaude
andcommitted
feat(showcase/google-adk/reasoning-default): rename from reasoning-default-render and port frontend from langgraph-python
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 99429e6 commit e86ecde

3 files changed

Lines changed: 57 additions & 45 deletions

File tree

showcase/integrations/google-adk/src/app/demos/reasoning-default-render/page.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"use client";
2+
3+
// Reasoning — Default
4+
//
5+
// Pairs with `reasoning-custom` (the Custom variant) so users can
6+
// compare default vs custom reasoning rendering side by side. This cell
7+
// renders <CopilotChat> with NO slot override — reasoning messages are
8+
// rendered by the built-in `CopilotChatReasoningMessage` component
9+
// (Thinking… / Thought for X header with an expandable content region).
10+
//
11+
// Both demos share the same backend (`reasoning_agent` graph) and the
12+
// same runtime URL (/api/copilotkit). The only difference is whether the
13+
// `messageView.reasoningMessage` slot is overridden.
14+
15+
import { CopilotKit, CopilotChat } from "@copilotkit/react-core/v2";
16+
import { useReasoningDefaultSuggestions } from "./suggestions";
17+
18+
const AGENT_ID = "reasoning-default";
19+
20+
export default function ReasoningDefaultDemo() {
21+
return (
22+
<CopilotKit runtimeUrl="/api/copilotkit" agent={AGENT_ID}>
23+
<div className="flex justify-center items-center h-screen w-full">
24+
<div className="h-full w-full max-w-4xl">
25+
<Chat />
26+
</div>
27+
</div>
28+
</CopilotKit>
29+
);
30+
}
31+
32+
function Chat() {
33+
useReasoningDefaultSuggestions();
34+
return <CopilotChat agentId={AGENT_ID} className="h-full rounded-2xl" />;
35+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"use client";
2+
3+
import { useConfigureSuggestions } from "@copilotkit/react-core/v2";
4+
5+
// Suggestions registered via the v2 chat composer hook. The prompt is a
6+
// concrete reasoning-eliciting question — gpt-5-mini (and other OpenAI
7+
// reasoning models) only emit `response.reasoning_summary_text.delta`
8+
// events when there's a real problem to think about. Meta-prompts like
9+
// "show your reasoning" produce no reasoning summary, so the reasoning
10+
// slot would never light up.
11+
export function useReasoningDefaultSuggestions() {
12+
useConfigureSuggestions({
13+
suggestions: [
14+
{
15+
title: "Show reasoning",
16+
message:
17+
"Explain step by step why the sky appears blue during the day but red at sunset.",
18+
},
19+
],
20+
available: "always",
21+
});
22+
}

0 commit comments

Comments
 (0)