diff --git a/src/Plugins/BotSharp.Plugin.FileHandler/Functions/ReadPdfFn.cs b/src/Plugins/BotSharp.Plugin.FileHandler/Functions/ReadPdfFn.cs index 198ed4e89..6a2557d48 100644 --- a/src/Plugins/BotSharp.Plugin.FileHandler/Functions/ReadPdfFn.cs +++ b/src/Plugins/BotSharp.Plugin.FileHandler/Functions/ReadPdfFn.cs @@ -146,7 +146,7 @@ private async Task GetChatCompletion(Agent agent, List } provider = "google-ai"; - model = "gemini-2.0-flash"; + model = "gemini-3.8-flash"; return (provider, model); } diff --git a/src/WebStarter/appsettings.json b/src/WebStarter/appsettings.json index 3e4bf12c9..d9a55c51c 100644 --- a/src/WebStarter/appsettings.json +++ b/src/WebStarter/appsettings.json @@ -1119,7 +1119,7 @@ "Provider": "google-ai", "Models": [ { - "Name": "gemini-2.0-flash", + "Name": "gemini-3.8-flash", "ApiKey": "", "Type": "chat", "MultiModal": true, @@ -1129,11 +1129,11 @@ "PdfReading" ], "Cost": { - "TextInputCost": 0.0015, - "CachedTextInputCost": 0, + "TextInputCost": 0.00075, + "CachedTextInputCost": 0.000075, "AudioInputCost": 0, "CachedAudioInputCost": 0, - "TextOutputCost": 0.002, + "TextOutputCost": 0.00375, "AudioOutputCost": 0 } }, @@ -1368,7 +1368,7 @@ "Pdf": { "Reading": { "Provider": "google-ai", - "Model": "gemini-2.0-flash", + "Model": "gemini-3.8-flash", "ConvertToImage": false, "ImageDetailLevel": "auto", "ImageConverter": { diff --git a/tests/BotSharp.Core.UnitTests/BotSharp.Core.UnitTests.csproj b/tests/BotSharp.Core.UnitTests/BotSharp.Core.UnitTests.csproj index 252d113e1..2e1475e43 100644 --- a/tests/BotSharp.Core.UnitTests/BotSharp.Core.UnitTests.csproj +++ b/tests/BotSharp.Core.UnitTests/BotSharp.Core.UnitTests.csproj @@ -44,6 +44,8 @@ + + diff --git a/tests/BotSharp.Core.UnitTests/Plugins/ReadPdfFnDefaultModelTests.cs b/tests/BotSharp.Core.UnitTests/Plugins/ReadPdfFnDefaultModelTests.cs new file mode 100644 index 000000000..968a414a3 --- /dev/null +++ b/tests/BotSharp.Core.UnitTests/Plugins/ReadPdfFnDefaultModelTests.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using BotSharp.Plugin.FileHandler.Functions; +using BotSharp.Plugin.FileHandler.Settings; +using Microsoft.Extensions.Logging.Abstractions; +using Xunit; + +namespace BotSharp.Core.UnitTests.Plugins; + +public class ReadPdfFnDefaultModelTests +{ + // Google shut down gemini-2.0-flash on 2026-06-01, so the model that ReadPdfFn + // falls back to when no FileHandler:Pdf:Reading provider and model are set + // must be one the Gemini API still serves. + [Fact] + public void Falls_back_to_a_gemini_model_that_is_still_served() + { + var fn = new ReadPdfFn(null!, NullLogger.Instance, new FileHandlerSettings()); + + var (provider, model) = ((string, string))typeof(ReadPdfFn) + .GetMethod("GetLlmProviderModel", BindingFlags.NonPublic | BindingFlags.Instance)! + .Invoke(fn, null)!; + + Assert.Equal("google-ai", provider); + Assert.Equal("gemini-3.8-flash", model); + } +}