Adding code to call the rag_api simple reranker.#33
Adding code to call the rag_api simple reranker.#33kalaspuffar wants to merge 3 commits intodanny-avila:mainfrom
Conversation
6fd3e3b to
7099b06
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds support for a new "simple" reranker type that integrates with the rag_api's local model-based reranking service. The implementation follows the existing pattern of reranker classes (Jina, Cohere, Infinity) but introduces JWT-based authentication for calling the Simple reranker API.
Key changes:
- Adds
SimpleRerankerclass that uses JWT authentication to call a local reranking service - Extends the
RerankerTypeunion to include 'simple' as a new option - Adds dependencies for
jsonwebtokenpackage and its type definitions
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/tools/search/types.ts | Adds 'simple' to the RerankerType union and adds simpleRerankerInstanceUrl configuration parameter |
| src/tools/search/tool.ts | Threads the simpleRerankerInstanceUrl config parameter through to reranker creation |
| src/tools/search/rerankers.ts | Implements SimpleReranker class with JWT authentication, adds it to the factory function, and applies code formatting improvements |
| package.json | Adds jsonwebtoken runtime dependency and @types/jsonwebtoken dev dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
f7a1163 to
dc7db86
Compare
8673eef to
740642a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot suggested this change then forgot it. |
42d90e1 to
b76e5e9
Compare
b76e5e9 to
2c6d549
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2c6d549 to
600c17e
Compare
…urns at end-of-Run (Codex P1 #32, P2 #33) P1 #32: my round-7 wiring nulled \`_fileCheckpointer\` in \`Graph.clearHeavyState\` — but \`Run.processStream()\` calls \`clearHeavyState\` in its finally block on natural-completion AND error paths, exactly when the host most needs to call \`Run.rewindFiles()\` for rollback. The fix: 1. Drop the \`this._fileCheckpointer = undefined\` line. Per-Run isolation is automatic because each \`Run.create()\` constructs a brand-new Graph instance. 2. Update \`getOrCreateFileCheckpointer\` to return the cached instance unconditionally if present. Without this, the toolExecution-engine guard inside the accessor would reject the cached checkpointer once \`clearHeavyState\` nulled toolExecution. P2 #33: the \`directPathTurns\` map I added in #30 to make direct-path turns resume-stable was never cleared, so it grew linearly with tool calls AND would have returned stale slots if a provider reused call IDs across turns. Added: - \`ToolNode.clearDirectPathTurns()\` public method (\`@internal\` by convention but exposed for hosts that reuse a ToolNode outside a Graph). - \`Graph._compiledToolNodes\` set populated via \`registerCompiledToolNode()\` from each \`StandardGraph.initializeTools\` ToolNode construction site. - \`clearHeavyState\` iterates the set and calls \`clearDirectPathTurns()\` on each, then drops the set itself. End-of-Run is the right boundary: directPathTurns is used during hook lifecycle / runTool execution, never read post-run, so clearing it there doesn't conflict with the checkpointer's opposite requirement (which now survives clearHeavyState). Tests pinned: \`checkpointer survives Graph.clearHeavyState so post-completion rewind works (Codex P1 #32)\` exercises the round- trip through the same cleanup the host hits, and \`clearDirectPathTurns() empties the per-Run cache (Codex P2 #33)\` pins the method directly. 808 tests passing across all suites.
This code will call the simple reranker using local models in rag_api
danny-avila/rag_api#190
This is code to solve the issue I mentioned in:
danny-avila/LibreChat#9102