Repository navigation
[Go] Add /api/v1/searchbots/mindmap and /api/v1/chat/mindmap - #16443
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a ChangesSearchBot MindMap Endpoint
Sequence Diagram(s)sequenceDiagram
participant Client
participant SearchBotHandler.MindMap
participant chunkSvc
participant llm
Client->>SearchBotHandler.MindMap: POST /api/v1/searchbots/mindmap
SearchBotHandler.MindMap->>chunkSvc: RetrievalTest(question, kb_ids, config)
chunkSvc-->>SearchBotHandler.MindMap: chunks / sections
SearchBotHandler.MindMap->>llm: Chat(mindMapPrompt + sections + "Output:")
llm-->>SearchBotHandler.MindMap: markdown answer
SearchBotHandler.MindMap-->>Client: mindMapNode tree JSON
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/handler/searchbot.go`:
- Around line 456-461: The search_id lookup in handler.Searchbot currently hides
GetDetail failures and falls back to defaults, which can return a response with
the wrong configuration. Update the logic around h.searchSvc.GetDetail in
searchbot.go so that when req.SearchID is set and GetDetail returns an error,
the handler returns that error instead of continuing with searchConfigFromDetail
defaults. Keep the existing searchConfigFromDetail path for successful lookups,
but make the req.SearchID branch in the search handling flow fail fast on lookup
errors.
- Around line 849-861: The mind-map parsing in searchbot.go is treating
zero-indented bullet items as top-level siblings instead of children of the
current heading, which causes list content like “- Features” under “# Product”
to detach from the generated title. Update the parsing logic in the block that
builds `mindMapNode`/uses `mindMapListRe` so list nesting is offset relative to
the current heading or list block, not always anchored at the root. Make sure
`title`, `level`, `stack`, and the append-to-parent logic keep bullet lists
nested under the preceding heading when no extra indentation is present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 23297ec3-394f-4e90-b519-24ae41e39169
📒 Files selected for processing (3)
internal/handler/searchbot.gointernal/handler/searchbot_test.gointernal/router/router.go
993e759 to
2aeb2ea
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16443 +/- ##
=======================================
Coverage 93.16% 93.16%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 668 668
Misses 29 29
Partials 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
/chat/mindmap


/searchbots/mindmap