Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist. 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 |
themez
left a comment
There was a problem hiding this comment.
Thanks for contributing! Here's some feedback:
Issues to fix
1. Typo: bochaAvaliable → bochaAvailable
Multiple occurrences in web-search.tsx.
2. Duplicated API call logic
bocha.ts and checkBoCha in web-search.tsx both implement the same API request independently. Please reuse the BoChaSearch class for the check function, consistent with how checkTavily works.
3. Import path in bocha.ts
// ❌ bare src/ path may not resolve at build time
import { SearchResult } from 'src/shared/types'
// ✅ use the project's path alias
import { SearchResult } from '@shared/types'4. Silent error swallowing in bocha.ts
} catch (error) {
return { results: [] }
}This silently returns empty results for all errors (bad API key, network failure, quota exceeded). Users won't know what went wrong. Please throw a meaningful error instead of swallowing it — refer to how other providers handle errors.
5. Formatting
index.tsline 11:import { BoChaSearch}— missing space before}constructorhas a trailing comma and unnecessary line break
6. Response parsing
const results = response.data?.webPages?.value || []No validation on the response structure. If the API format changes, this silently returns empty results. Consider adding basic validation or at least logging unexpected responses.
Minor suggestions (non-blocking)
{ query: query }→{ query }requestBodyvariable can be inlined- Consider adding a link to BoCha's API key page in the settings UI (like Tavily does)
Description
Add Bocha as a new web search provider to enhance Chatbox's real-time search capabilities.
Screenshots
Contributor Agreement
By submitting this Pull Request, I confirm that I have read and agree to the following terms:
Please check the box below to confirm:
[x] I have read and agree with the above statement.