mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 10:07:22 +00:00
Moved all extension methods into extension blocks (#1155)
This commit is contained in:
1 parent
acc7d09fa2
commit
c0a75f39ac
138 files changed
+5884
-4954
No files matched your search
+11
-8
@@ -8,17 +8,20 @@ public static class ToolCallingAvailabilityExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ToolCallingAvailabilityExtensions).Namespace, nameof(ToolCallingAvailabilityExtensions));
|
||||
|
||||
public static ToolCallingAvailability GetToolCallingAvailability(this AIStudio.Settings.Provider provider)
|
||||
extension(AIStudio.Settings.Provider provider)
|
||||
{
|
||||
if (provider == AIStudio.Settings.Provider.NONE || provider.UsedLLMProvider is LLMProviders.NONE)
|
||||
return new(false, TB("Please select an LLM provider."));
|
||||
public ToolCallingAvailability GetToolCallingAvailability()
|
||||
{
|
||||
if (provider == AIStudio.Settings.Provider.NONE || provider.UsedLLMProvider is LLMProviders.NONE)
|
||||
return new(false, TB("Please select an LLM provider."));
|
||||
|
||||
var modelProfile = provider.GetModelProfile();
|
||||
var supportsRequiredApis = modelProfile.HasAny(Capability.CHAT_COMPLETION_API | Capability.RESPONSES_API);
|
||||
var modelProfile = provider.GetModelProfile();
|
||||
var supportsRequiredApis = modelProfile.HasAny(Capability.CHAT_COMPLETION_API | Capability.RESPONSES_API);
|
||||
|
||||
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."));
|
||||
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();
|
||||
return ToolCallingAvailability.Available();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user