Skip to content

fix(chat): allow null score in citation types, align with API and SDK#89

Open
EricNGOntos wants to merge 12 commits into
stagingfrom
fix/wuchengke/score-nullable-notebook
Open

fix(chat): allow null score in citation types, align with API and SDK#89
EricNGOntos wants to merge 12 commits into
stagingfrom
fix/wuchengke/score-nullable-notebook

Conversation

@EricNGOntos
Copy link
Copy Markdown

Summary

Aligns Notebook citation types with the updated API contract where score can be null for agentic navigation-only results.

Background

The agentic retrieval route now returns null for score on chunks found only through KG navigation (no BM25 discovery score available). The Node SDK has been updated (RetrievalResult.score: number | null). The Notebook's internal types and view layer need to match.

Changes

src/domains/chat/types.ts

// Before
readonly score: number

// After
readonly score: number | null

src/domains/chat/view.ts

// Before — restoring persisted citations
score: getNumber(item.score) ?? 0

// After
score: getNumber(item.score) ?? null

0 is a valid real score; null correctly signals 'no score available'.

Testing

  • All 420 Notebook unit tests pass ✅

@EricNGOntos EricNGOntos self-assigned this Jun 2, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
knowhere-notebook-staging Error Error Jun 2, 2026 12:28am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
knowhere-notebook Ignored Ignored Jun 2, 2026 12:28am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants