Web Grounding Feature#4
Draft
laiso wants to merge 1 commit into
Draft
Conversation
## Overview A feature that automatically enables Web Search/Grounding capabilities from various providers when using cloud LLMs, improving factual accuracy and source attribution in summaries. ## Implementation Details ### Modified Files - `src/lib/llm-providers.ts` - `callAnthropic`: Web Search tool added - `callGemini`: Web Search tool added (under verification) - `callOpenAI`: No changes - `callCustomAPI`: No changes - `src/lib/prompt-builder.ts` - Added system prompt text to encourage web search ### Source Attribution ```markdown --- ### Sources - [Article Title](https://example.com/article) - [Another Source](https://example.com/source) ``` ## Provider Support Status | Provider | Model | Status | |----------|-------|--------| | **Anthropic** | Sonnet 4.6 / Opus 4.6 | ✅ Working | | **Anthropic** | Haiku 4.5 | ❌ Not supported (API limitation) | | **Gemini** | All models |⚠️ Under verification | | **OpenAI** | All models | ❌ Not supported | | **Custom** | Local LLM | ❌ Disabled | ## Known Issues 1. **Anthropic Haiku model not supported** - Error: `allowed_callers` restriction - Workaround: Use Sonnet 4.6 or higher 2. **Gemini groundingMetadata is empty** - Issue persists despite multiple format attempts 3. **OpenAI endpoint limitation** - `web_search` not supported on `chat/completions` endpoint ## Decision **Keep this feature as a PR without release.** Reasons: - Support limited to specific Anthropic models - Avoid user confusion (many Haiku users) - Unclear roadmap for Gemini/OpenAI support ## References - [Anthropic Web Search Docs](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool) - [Gemini API Docs](https://ai.google.dev/gemini-api/docs/google-search) - [OpenAI Responses API](https://platform.openai.com/docs/api-reference/responses)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
A feature that automatically enables Web Search/Grounding capabilities from various providers when using cloud LLMs, improving factual accuracy and source attribution in summaries.
Implementation Details
Modified Files
src/lib/llm-providers.tscallAnthropic: Web Search tool addedcallGemini: Web Search tool added (under verification)callOpenAI: No changescallCustomAPI: No changessrc/lib/prompt-builder.tsSource Attribution
Provider Support Status
Known Issues
Anthropic Haiku model not supported
allowed_callersrestrictionGemini groundingMetadata is empty
OpenAI endpoint limitation
web_searchnot supported onchat/completionsendpointDecision
Keep this feature as a PR without release.
Reasons:
References