Skip to content

Commit 8d6c4fc

Browse files
committed
v2.3.0: Enable Bedrock — replace Cohere with Nova Pro, fix maxTokens
- Replace cohere.command-r-plus-v1:0 with amazon.nova-pro-v1:0 for clinical reports (Cohere marketplace unavailable, Nova Pro confirmed working) - Update request/response format from Cohere to Nova messages API - Fix maxNewTokens → maxTokens in generate-words route (Nova Lite inferenceConfig parameter name) - Add v2.3.0 changelog entry
1 parent c05a4bb commit 8d6c4fc

3 files changed

Lines changed: 38 additions & 10 deletions

File tree

app/api/chat/generate-words/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export async function POST(request: NextRequest) {
243243
accept: "application/json",
244244
body: JSON.stringify({
245245
messages: [{ role: "user", content: [{ text: prompt }] }],
246-
inferenceConfig: { maxNewTokens: 500, temperature: 0.8 },
246+
inferenceConfig: { maxTokens: 500, temperature: 0.8 },
247247
}),
248248
});
249249

app/api/report/clinical/route.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* POST /api/report/clinical
33
*
4-
* Generates a full DSM-5 aligned clinical report using Cohere Command R+
4+
* Generates a full DSM-5 aligned clinical report using Amazon Nova Pro
55
* via Amazon Bedrock. Falls back to a detailed mock report when AWS
66
* credentials are not configured.
77
*
@@ -205,13 +205,12 @@ Guidelines:
205205
try {
206206
const client = getBedrockClient();
207207
const invokeBody = JSON.stringify({
208-
message: prompt,
209-
max_tokens: 2048,
210-
temperature: 0.5,
208+
messages: [{ role: "user", content: [{ text: prompt }] }],
209+
inferenceConfig: { maxTokens: 2048, temperature: 0.5 },
211210
});
212211

213212
const command = new InvokeModelCommand({
214-
modelId: "cohere.command-r-plus-v1:0",
213+
modelId: "amazon.nova-pro-v1:0",
215214
contentType: "application/json",
216215
accept: "application/json",
217216
body: new TextEncoder().encode(invokeBody),
@@ -220,11 +219,9 @@ Guidelines:
220219
const response = await client.send(command);
221220
const responseBody = JSON.parse(new TextDecoder().decode(response.body));
222221

223-
// Cohere Command R+ returns: { text: "..." }
222+
// Nova Pro returns: { output: { message: { content: [{ text: "..." }] } } }
224223
const reportText: string =
225-
responseBody?.text ??
226-
responseBody?.generations?.[0]?.text ??
227-
"";
224+
responseBody?.output?.message?.content?.[0]?.text ?? "";
228225

229226
if (!reportText) {
230227
console.warn("[Report/Clinical] Empty response from Bedrock, using mock");

docs/DOCS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,3 +1004,34 @@ A complete kids-facing dashboard with bottom tab navigation, daily games, AI cha
10041004

10051005
**Files modified:** 11 files across components, games, pages, DB layer, and types.
10061006
**Testing:** TypeScript clean. ESLint clean. Build clean.
1007+
1008+
### v2.2.0 — 2026-03-06 (Game Staging, Nav Fix, Dark Mode, Feed Toggle)
1009+
1010+
**Navigation & Layout (Phase 1):**
1011+
- Landing page navbar: replaced inline auth nav with `<ThemeToggle>` + `<Link>Dashboard</Link>` + `<UserMenu />` — no more horizontal overflow when signed in
1012+
- Chat input bar: reduced mic button (64px→48px) and send button (56px→44px), added `min-width: 0` on text input for small screens
1013+
1014+
**Dark Mode Consistency (Phase 2):**
1015+
- StreakBadge: replaced hardcoded light gradient with theme-aware CSS vars (`var(--feature-peach)`, `var(--bg-secondary)`)
1016+
- Feed page: replaced text "Light"/"Dark" toggle with `<ThemeToggle>` component
1017+
1018+
**Game Fixes — Critical Gameplay (Phase 3):**
1019+
- **Bubble Pop**: converted `nextId` state to `useRef` to fix stale closure in spawn interval, removed redundant `fastCheck` 500ms interval, steady 1500ms spawn rate
1020+
- **Tracing**: added 65% accuracy threshold — scribbles below threshold show "Try Again" instead of advancing; only passing attempts recorded in scores
1021+
- **Color & Sound**: added 2-attempt system — wrong answer shows "Try Again" button (attempt 1), second wrong shows correct answer and auto-advances (attempt 2)
1022+
1023+
**Game Fixes — Staged Difficulty (Phase 4):**
1024+
- **Alphabet Pattern**: 3-stage progression — Stage 1 (rounds 1-2): 1 blank, Stage 2 (rounds 3-4): 2 blanks, Stage 3 (round 5): CVC word completion from 20-word pool
1025+
- **Sequence Memory**: enhanced show-sequence animation — `scale(1.15)` with glow `boxShadow`, `opacity: 0.3` on inactive buttons, 300ms gap between items, "Watch! (X of Y)" indicator
1026+
- **Speech Practice**: 3-stage progression — Stage 1 (items 1-3): single word, Stage 2 (items 4-6): 3-word phrase with current word highlighted, Stage 3 (items 7-9): full sentence
1027+
1028+
**Intake & Progress Fixes (Phase 5):**
1029+
- **Video Capture (Step 8)**: fixed `startingRef` not resetting on camera failure (blocked subsequent start attempts forever), added debug status bar showing Camera/Models/Inference status
1030+
- **Progress page**: added de-duplication filter — entries with same `gameId` within 2-second window collapsed into single entry
1031+
1032+
**Features & Polish (Phase 6):**
1033+
- **Feed anonymous toggle**: new checkbox in compose form — "Post Anonymously" (default: checked). Unchecked posts show "Community Member" instead of "Anonymous"
1034+
- **ThemeToggle consistency**: replaced text "Dark"/"Light" toggles with `<ThemeToggle>` component on all 18 game/feature pages (bubble-pop, alphabet-pattern, tracing, match-numbers, memory, social-stories-v2, emotion-match, color-sound, sequence, speech, talking, chat, progress, reports, nearby-help, child detail, plus landing and feed)
1035+
1036+
**Files modified:** 22+ files across games, components, intake, feed, and dashboard pages.
1037+
**Testing:** 42 Playwright tests (36 unauthenticated + 6 authenticated) all passing. TypeScript clean. Build clean.

0 commit comments

Comments
 (0)