Skip to content

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Dec 16, 2025

Summary

This PR implements websearch tool functionality for AI agents, enabling OpenAI, Anthropic, and Gemini providers to perform web searches during agent execution.

Changes

This implementation consists of 6 commits:

  1. Refactor OpenAI/Azure to Responses API (70d7c82)

    • Created other.rs provider for OpenAI-compatible completion endpoint
    • Refactored openai.rs to use OpenAI Responses API
    • Updated provider routing in query_builder.rs
  2. Add Websearch Backend Type (a1b5f36)

    • Added Websearch variant to ToolValue enum in flows.rs
    • Updated all pattern matches to handle websearch tools
    • Added has_websearch parameter to BuildRequestArgs
  3. Add Websearch Frontend UI (ad9bd57)

    • Added WebsearchTool type and utilities in agentToolUtils.ts
    • Added "Web Search" option in tool insertion UI
    • Updated tool node rendering to display websearch tools
  4. Implement OpenAI Websearch (b88de4b)

    • Added web_search tool to OpenAI Responses API requests
    • Enabled websearch detection in ai_executor.rs
  5. Implement Anthropic Websearch (6192683)

    • Created anthropic.rs provider with Anthropic Messages API
    • Added web_search tool for Anthropic format
    • Implemented streaming support via SSE parsing
  6. Implement Gemini Websearch (fcd6e51)

    • Updated GoogleAI to use completion endpoint via other.rs
    • Added Google Search grounding when websearch enabled
    • Uses google_search_retrieval for Gemini-specific search

Documentation References

Testing

Tested with:

  • cargo check --features $(./all_features_oss.sh) - all checks pass
  • Frontend compilation verified

Fixes #7397

🤖 Generated with Claude Code

github-actions bot and others added 6 commits December 16, 2025 23:08
…ider for completion endpoint

- Created new 'other.rs' provider using the OpenAI-compatible completion endpoint
- Refactored 'openai.rs' to use the Responses API for both text and image output
- Updated query_builder to route OpenAI/AzureOpenAI to OpenAIQueryBuilder
- All other providers (Mistral, DeepSeek, Groq, etc.) now use OtherQueryBuilder
- Updated OpenRouter to delegate to OtherQueryBuilder instead of OpenAIQueryBuilder

This prepares the codebase for adding websearch tool support using the Responses API.

Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
- Added WebsearchToolValue to ToolValue enum in flows.rs
- Updated all pattern matches to handle websearch tool type
- Added has_websearch parameter to run_agent function
- Websearch tools don't require additional configuration

This prepares the backend for provider-specific websearch implementations.

Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
- Added WebsearchTool type and utility functions to agentToolUtils.ts
- Added "Web Search" option in tool insertion menu (InsertModuleInner)
- Updated NewAIToolNode to handle pickWebsearchTool event
- Updated AIToolNode to render websearch tools properly
- Updated FlowModuleSchemaMap to create websearch tools

Users can now add websearch tools to AI agents through the UI.

Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
- Added has_websearch parameter to BuildRequestArgs
- OpenAI provider now adds web_search tool to requests when enabled
- Uses OpenAI Responses API web_search tool type
- Websearch tool is added before other custom tools in the request

Implements websearch functionality for OpenAI and Azure OpenAI providers.

Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
- Created anthropic.rs provider with native Anthropic API format
- Added web_search tool to Anthropic requests when enabled
- Anthropic uses /messages endpoint with x-api-key authentication
- Updated query_builder to route Anthropic to new provider

Implements websearch functionality for Anthropic Claude models.

Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
- GoogleAI now uses completion endpoint (other.rs) for text instead of responses API
- Added Google Search grounding when websearch is enabled
- Uses google_search_retrieval tool in request when has_websearch is true
- Updated parse methods to use OtherQueryBuilder for completion endpoint

Implements websearch functionality for Google Gemini models.

Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 16, 2025

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 83ce3d8
Status: ✅  Deploy successful!
Preview URL: https://54b031d1.windmill.pages.dev
Branch Preview URL: https://claude-issue-7397-20251216-2.windmill.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(aiagent): add websearch tool

2 participants