Repository navigation
Replace the retired gemini-2.0-flash PDF reading default - #1460
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
ReadPdfFn falls back to google-ai / gemini-2.0-flash when FileHandler:Pdf:Reading has no provider and model, and the sample appsettings.json configures the same model for PDF reading. Google shut gemini-2.0-flash down on 2026-06-01, so reading a PDF with the default settings returns an error from the Gemini API. Use gemini-3.8-flash, the current stable Flash model, in the fallback and in appsettings.json (the chat model entry and the FileHandler setting), with its standard paid-tier prices per 1K tokens. The Google provider sends a temperature (0.0 by default) that Gemini 3 accepts but recommends leaving at its default. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Contributor
PR Summary by QodoReplace retired Gemini PDF-reading default
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
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.
ReadPdfFnfalls back togoogle-ai/gemini-2.0-flashwhenFileHandler:Pdf:Readinghas no provider and model, and the sampleappsettings.jsonsets the same model for PDF reading. Google shutgemini-2.0-flashdown on June 1, 2026 (deprecations), so reading a PDF with the default settings now gets an error from the Gemini API.This PR changes:
ReadPdfFn.GetLlmProviderModel: the fallback model isgemini-3.8-flash, the current stable Flash model.src/WebStarter/appsettings.json:FileHandler:Pdf:Reading:Modeland thegoogle-aichat model entry it points to (name, and costs per 1K tokens from Google's pricing page: $0.75 input, $0.075 cached input and $3.75 output per 1M tokens, the prices until 2026-12-31).ReadPdfFnDefaultModelTestschecks the fallback. It needs a project reference fromBotSharp.Core.UnitTeststoBotSharp.Plugin.FileHandler.The deprecations page names
gemini-3.6-flashas the replacement, butgemini-3.8-flashis the current stable Flash model (Vertex AI already retires 3.6 Flash on 2026-11-19), so this PR uses 3.8.The Google provider always sends
temperature(0.0 unless the conversation state sets one). Gemini 3 accepts it, but Google recommends leaving it at the default of 1.0. This PR does not change that;FileHandler:Pdf:Readingcan still point PDF reading at any other provider and model.I left the
gemini-2.0-flash-exprealtime entry and the realtime test settings alone, since they are a different model.Tests
dotnet test tests/BotSharp.Core.UnitTests: 475 passed, 1 failed. The new test fails before the change (Expected: "gemini-3.8-flash",Actual: "gemini-2.0-flash"). The failing test isSharpCacheAgentMemoryTests.GetAgent_caches_per_scope_without_adding_shared_cache_entries; it fails the same way without this change.This change was made with Claude Code, which also wrote the test and ran the checks above.
🤖 Generated with Claude Code