gateway: end-to-end top_k for /recall (RecallRequest → handleRecall → auto-recall, clamp 1..50) - #900
Open
francialisomlimoeiro wants to merge 1 commit into
Conversation
…-> auto-recall, clamp 1..50)
Collaborator
|
Thanks for your contribution and attention! We will review this PR and get back to you as soon as possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Adds an optional, additive
top_koverride to the gateway/recallAPI:src/gateway/types.ts:RecallRequest.top_k?: number(documented; older gateways ignore it).src/gateway/server.ts: numeric validation + clamp 1..50 at the edge; non-numeric falls back to config default.src/core/tdai-core.ts/src/core/hooks/auto-recall.ts: topK plumbed tosearchMemories, clamped again defensively, overridesrecall.maxResults.Tests
Repo vitest suite: 2 files, 15 passed. Happy to add a dedicated
top_kunit test if maintainers want one.