-
Notifications
You must be signed in to change notification settings - Fork 1
feat(wip): web search agent #509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis PR integrates web search functionality across the AI pipeline by defining reusable webSearch tools, abstracting LLM client/model selection, extending existing streaming and generation functions to optionally invoke web search, and introducing a standalone WebSearchAgent module with full multi-step reasoning support. Sequence Diagram: Basic Web Search Tool Invocation via AI FunctionsequenceDiagram
actor User
participant App as "Application Logic (e.g., streamTextWithWebSearch)"
participant LLM as "Language Model"
participant Tool as "webSearchTool"
participant SearchAPI as "Web Search API (/api/web-search or direct)"
User->>App: Submits query
App->>LLM: Call LLM (e.g., streamText) with messages and webSearchTool
LLM-->>Tool: execute({query: "search_term"})
Tool->>SearchAPI: Perform Search (e.g., POST /api/web-search or call Tavily/Google)
SearchAPI-->>Tool: Search Results
Tool-->>LLM: Return search results
LLM->>App: Stream/Return final response incorporating search results
App->>User: Display response
Sequence Diagram:
|
| Change | Details | Files |
|---|---|---|
| Define and integrate webSearch tools |
|
apps/masterbots.ai/app/actions/ai-main-call.actions.tsapps/masterbots.ai/app/actions/ai-executers.actions.tsapps/masterbots.ai/lib/tools/web-search.ts |
| Implement webSearchAgent and streaming response support |
|
apps/masterbots.ai/app/actions/ai-main-call.actions.ts |
| Abstract LLM client creation and model selection |
|
apps/masterbots.ai/app/actions/ai-main-call.actions.tsapps/masterbots.ai/app/actions/ai-executers.actions.ts |
| Extend core streaming/generation functions with web search support |
|
apps/masterbots.ai/app/actions/ai-main-call.actions.tsapps/masterbots.ai/app/actions/ai-executers.actions.ts |
| Introduce standalone WebSearchAgent module |
|
apps/masterbots.ai/lib/agents/web-search-agent.ts |
| Update dependencies for new AI backends |
|
apps/masterbots.ai/package.json |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull
request title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment@sourcery-ai summaryon the pull request to
(re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull
request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request
summary, the reviewer's guide, and others. - Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by Sourcery
Enable web search capabilities in AI actions by defining web search tools, integrating them into existing streaming and execution functions, and introducing a multi-step web search agent.
New Features:
Enhancements:
Chores: