mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-24 12:53:37 +00:00
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
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
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
51 lines
2.7 KiB
C#
51 lines
2.7 KiB
C#
using AIStudio.Chat;
|
|
using AIStudio.Components;
|
|
using AIStudio.Settings;
|
|
using AIStudio.Tools.AssistantSessions;
|
|
|
|
namespace AIStudio.Assistants;
|
|
|
|
public abstract class AssistantLowerBase : MSGComponentBase
|
|
{
|
|
protected static readonly Dictionary<string, object?> USER_INPUT_ATTRIBUTES = new();
|
|
|
|
internal const string RESULT_DIV_ID = "assistantResult";
|
|
internal const string BEFORE_RESULT_DIV_ID = "beforeAssistantResult";
|
|
internal const string AFTER_RESULT_DIV_ID = "afterAssistantResult";
|
|
|
|
protected static readonly AssistantSessionStateKey<AIStudio.Settings.Provider> PROVIDER_SETTINGS_STATE_KEY = new(nameof(ProviderSettings));
|
|
protected static readonly AssistantSessionStateKey<bool> INPUT_IS_VALID_STATE_KEY = new(nameof(InputIsValid));
|
|
protected static readonly AssistantSessionStateKey<Profile> CURRENT_PROFILE_STATE_KEY = new(nameof(CurrentProfile));
|
|
protected static readonly AssistantSessionStateKey<ChatTemplate> CURRENT_CHAT_TEMPLATE_STATE_KEY = new(nameof(CurrentChatTemplate));
|
|
protected static readonly AssistantSessionStateKey<ChatThread?> CHAT_THREAD_STATE_KEY = new(nameof(ChatThread));
|
|
protected static readonly AssistantSessionStateKey<IContent?> LAST_USER_PROMPT_STATE_KEY = new(nameof(LastUserPrompt));
|
|
protected static readonly AssistantSessionStateKey<ContentBlock?> RESULTING_CONTENT_BLOCK_STATE_KEY = new(nameof(ResultingContentBlock));
|
|
protected static readonly AssistantSessionStateKey<string[]> INPUT_ISSUES_STATE_KEY = new(nameof(InputIssues));
|
|
protected static readonly AssistantSessionStateKey<bool> IS_PROCESSING_STATE_KEY = new(nameof(IsProcessing));
|
|
protected static readonly AssistantSessionStateKey<HashSet<string>> SELECTED_TOOL_IDS_STATE_KEY = new("SelectedToolIds");
|
|
|
|
protected AIStudio.Settings.Provider ProviderSettings = Settings.Provider.NONE;
|
|
protected bool InputIsValid;
|
|
protected Profile CurrentProfile = Profile.NO_PROFILE;
|
|
protected ChatTemplate CurrentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE;
|
|
protected ChatThread? ChatThread;
|
|
protected IContent? LastUserPrompt;
|
|
|
|
protected ContentBlock? ResultingContentBlock;
|
|
protected string[] InputIssues = [];
|
|
protected bool IsProcessing;
|
|
|
|
/// <summary>
|
|
/// Clears everything one assistant run has produced.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Assistants call this whenever the previous run must not carry over: a follow-up run would
|
|
/// otherwise append to the old chat thread, and the old result would stay on screen.
|
|
/// </remarks>
|
|
protected void ClearConversationState()
|
|
{
|
|
this.ChatThread = null;
|
|
this.LastUserPrompt = null;
|
|
this.ResultingContentBlock = null;
|
|
}
|
|
} |