Read model capabilities from the profile everywhere

This commit is contained in:
Thorsten Sommer committed 2026-09-12 13:36:39 +02:00
1 parent 429ca8c739
commit 77130a450a
29 files changed
+163 -108

No files matched your search

@@ -13,12 +13,10 @@ public static class ToolCallingAvailabilityExtensions
if (provider == AIStudio.Settings.Provider.NONE || provider.UsedLLMProvider is LLMProviders.NONE)
return new(false, TB("Please select an LLM provider."));
var modelCapabilities = provider.GetModelCapabilities();
var supportsRequiredApis =
modelCapabilities.Contains(Capability.CHAT_COMPLETION_API) ||
modelCapabilities.Contains(Capability.RESPONSES_API);
var modelProfile = provider.GetModelProfile();
var supportsRequiredApis = modelProfile.HasAny(Capability.CHAT_COMPLETION_API | Capability.RESPONSES_API);
if (!supportsRequiredApis || !modelCapabilities.Contains(Capability.FUNCTION_CALLING))
if (!supportsRequiredApis || !modelProfile.Has(Capability.FUNCTION_CALLING))
return new(false, TB("Tool calling support is not enabled by default for this model, but you can enable this capability in the expert settings of the provider if you are sure the model supports it."));
return ToolCallingAvailability.Available();