mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-14 19:43:36 +00:00
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
43 lines
1.9 KiB
C#
43 lines
1.9 KiB
C#
using AIStudio.Models;
|
|
using AIStudio.Provider;
|
|
using AIStudio.Provider.Reasoning;
|
|
|
|
namespace AIStudio.Settings;
|
|
|
|
public static partial class ProviderExtensions
|
|
{
|
|
/// <summary>
|
|
/// Get the effective reasoning indicator state for the configured provider instance.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Two answers meet here, and they answer different questions. What a model is able to do comes
|
|
/// from the rules; what this person asked for comes from the parameters they wrote into their
|
|
/// own provider. A model which thinks unless told otherwise stops showing the indicator when a
|
|
/// parameter turns it off, and a model which can be asked to think shows it only once one does.
|
|
/// </remarks>
|
|
/// <param name="provider">The configured provider.</param>
|
|
/// <returns>The effective reasoning indicator state.</returns>
|
|
public static ReasoningIndicatorState GetReasoningIndicatorState(this Provider provider)
|
|
{
|
|
var reasoning = provider.GetModelProfile().Reasoning;
|
|
if (reasoning is ReasoningSupport.ALWAYS)
|
|
return ReasoningIndicatorState.ALWAYS_ON;
|
|
|
|
var configured = ReasoningDispatcher.WhatTheParametersSay(provider.UsedLLMProvider, provider.Host, provider.AdditionalJsonApiParameters);
|
|
if (reasoning is ReasoningSupport.ON_BY_DEFAULT)
|
|
{
|
|
return configured switch
|
|
{
|
|
ReasoningConfigurationState.EXPLICITLY_DISABLED => ReasoningIndicatorState.NONE,
|
|
ReasoningConfigurationState.EXPLICITLY_ENABLED => ReasoningIndicatorState.CONFIGURED,
|
|
|
|
_ => ReasoningIndicatorState.DEFAULT_ON,
|
|
};
|
|
}
|
|
|
|
if (reasoning is ReasoningSupport.OPTIONAL && configured is ReasoningConfigurationState.EXPLICITLY_ENABLED)
|
|
return ReasoningIndicatorState.CONFIGURED;
|
|
|
|
return ReasoningIndicatorState.NONE;
|
|
}
|
|
} |