2025-02-23 14:05:29 +00:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2024-09-14 17:20:33 +00:00
|
|
|
using AIStudio.Provider;
|
|
|
|
|
using AIStudio.Settings;
|
2026-08-02 19:41:12 +00:00
|
|
|
using AIStudio.Settings.DataModel;
|
|
|
|
|
using AIStudio.Tools.Media;
|
2025-05-04 12:59:30 +00:00
|
|
|
using AIStudio.Tools.PluginSystem;
|
2024-09-14 17:20:33 +00:00
|
|
|
|
|
|
|
|
namespace AIStudio.Tools;
|
|
|
|
|
|
|
|
|
|
public static class ComponentsExtensions
|
|
|
|
|
{
|
2025-05-04 12:59:30 +00:00
|
|
|
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ComponentsExtensions).Namespace, nameof(ComponentsExtensions));
|
2026-08-02 19:41:12 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the preview feature a component belongs to. Components that are generally available
|
|
|
|
|
/// return <see cref="PreviewFeatures.NONE"/>. This is the single place that maps a component to
|
|
|
|
|
/// its preview feature, so visibility checks never need to special-case one assistant.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="component">The component to look up.</param>
|
|
|
|
|
/// <returns>The required preview feature.</returns>
|
|
|
|
|
public static PreviewFeatures RequiredPreviewFeature(this Components component) => component switch
|
|
|
|
|
{
|
|
|
|
|
Components.VISUAL_BRIEFING_ASSISTANT => PreviewFeatures.PRE_VISUAL_BRIEFING_ASSISTANT_2026,
|
|
|
|
|
|
|
|
|
|
_ => PreviewFeatures.NONE,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets whether a component owns exactly one assistant session slot, so that a running session
|
|
|
|
|
/// blocks starting another one and inactive sessions can be cleared as a group.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Components return <c>false</c> for two different reasons. The chat has no assistant sessions
|
|
|
|
|
/// at all. The visual briefing assistant keys its sessions per briefing, so it owns one slot per
|
|
|
|
|
/// stored briefing rather than one per component. Both must be excluded from the single-slot
|
|
|
|
|
/// checks, which is why this is a capability and not a component comparison.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <param name="component">The component to look up.</param>
|
|
|
|
|
/// <returns><c>true</c> when the component owns exactly one session slot.</returns>
|
|
|
|
|
public static bool HasSingleSessionSlot(this Components component) => component switch
|
|
|
|
|
{
|
|
|
|
|
Components.CHAT => false,
|
|
|
|
|
Components.VISUAL_BRIEFING_ASSISTANT => false,
|
|
|
|
|
|
|
|
|
|
_ => true,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the kind of media-import owner a component creates for its attachments.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="component">The component to look up.</param>
|
|
|
|
|
/// <returns>The media-import owner kind.</returns>
|
|
|
|
|
public static MediaImportOwnerKind MediaOwnerKind(this Components component) => component switch
|
|
|
|
|
{
|
|
|
|
|
Components.VISUAL_BRIEFING_ASSISTANT => MediaImportOwnerKind.VISUAL_BRIEFING,
|
|
|
|
|
|
|
|
|
|
_ => MediaImportOwnerKind.ASSISTANT,
|
|
|
|
|
};
|
|
|
|
|
|
2024-11-02 10:55:09 +00:00
|
|
|
public static bool AllowSendTo(this Components component) => component switch
|
|
|
|
|
{
|
|
|
|
|
Components.NONE => false,
|
2025-04-26 16:55:23 +00:00
|
|
|
|
2025-01-01 14:49:27 +00:00
|
|
|
Components.ERI_ASSISTANT => false,
|
2024-11-02 10:55:09 +00:00
|
|
|
Components.BIAS_DAY_ASSISTANT => false,
|
2025-04-26 16:55:23 +00:00
|
|
|
Components.I18N_ASSISTANT => false,
|
2026-02-01 13:50:19 +00:00
|
|
|
Components.DOCUMENT_ANALYSIS_ASSISTANT => false,
|
Added the Batch Processing Assistant
The assistant processes all documents of a folder in one batch run. Each
document is extracted to Markdown by the Rust runtime and sent to the
selected provider together with the user's instructions.
The instructions come from one of three sources: a free prompt, one of
the existing document analysis policies including its minimum provider
confidence, or a file the user imports.
The output is either one Markdown file per document, or one CSV results
table in which each answer becomes a row. The user can name the results
table; its columns are the document and the answer.
Every run writes a log named log.csv with the document, time, model,
status, and the reason for any error. When a later run finds a log in
the output folder, the assistant asks whether to continue it. Continuing
processes only the documents that failed or whose results no longer
exist, which recovers runs interrupted by a crash or by documents
exceeding the context window of the model. A single failing document
never stops the run, and the run can be canceled at any time.
Columns are separated by a vertical bar and quoted per RFC 4180, so that
the files open in spreadsheet applications regardless of the list
separator of the user. Documents are identified by their path relative
to the input folder, because two subfolders may contain a document of
the same name.
Includes the English and German localization.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 16:05:18 +00:00
|
|
|
Components.BATCH_PROCESSING_ASSISTANT => false,
|
2026-07-15 17:44:43 +00:00
|
|
|
Components.LOG_VIEWER_ASSISTANT => false,
|
2025-04-26 16:55:23 +00:00
|
|
|
|
2025-02-15 14:53:58 +00:00
|
|
|
Components.APP_SETTINGS => false,
|
2026-02-01 18:30:41 +00:00
|
|
|
Components.WRITER => false,
|
2024-11-02 10:55:09 +00:00
|
|
|
|
2025-02-23 14:05:29 +00:00
|
|
|
Components.AGENT_TEXT_CONTENT_CLEANER => false,
|
|
|
|
|
Components.AGENT_DATA_SOURCE_SELECTION => false,
|
|
|
|
|
Components.AGENT_RETRIEVAL_CONTEXT_VALIDATION => false,
|
2026-04-09 08:01:24 +00:00
|
|
|
Components.AGENT_ASSISTANT_PLUGIN_AUDIT => false,
|
2026-07-05 15:48:00 +00:00
|
|
|
Components.META_ASSISTANT => false,
|
2025-02-23 14:05:29 +00:00
|
|
|
|
2024-11-02 10:55:09 +00:00
|
|
|
_ => true,
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-14 17:20:33 +00:00
|
|
|
public static string Name(this Components component) => component switch
|
|
|
|
|
{
|
2025-05-04 12:59:30 +00:00
|
|
|
Components.GRAMMAR_SPELLING_ASSISTANT => TB("Grammar & Spelling Assistant"),
|
|
|
|
|
Components.TEXT_SUMMARIZER_ASSISTANT => TB("Text Summarizer Assistant"),
|
|
|
|
|
Components.ICON_FINDER_ASSISTANT => TB("Icon Finder Assistant"),
|
|
|
|
|
Components.TRANSLATION_ASSISTANT => TB("Translation Assistant"),
|
|
|
|
|
Components.REWRITE_ASSISTANT => TB("Rewrite Assistant"),
|
2026-04-15 17:40:53 +00:00
|
|
|
Components.PROMPT_OPTIMIZER_ASSISTANT => TB("Prompt Optimizer Assistant"),
|
2025-05-04 12:59:30 +00:00
|
|
|
Components.AGENDA_ASSISTANT => TB("Agenda Assistant"),
|
|
|
|
|
Components.CODING_ASSISTANT => TB("Coding Assistant"),
|
|
|
|
|
Components.EMAIL_ASSISTANT => TB("E-Mail Assistant"),
|
|
|
|
|
Components.LEGAL_CHECK_ASSISTANT => TB("Legal Check Assistant"),
|
|
|
|
|
Components.SYNONYMS_ASSISTANT => TB("Synonym Assistant"),
|
|
|
|
|
Components.MY_TASKS_ASSISTANT => TB("My Tasks Assistant"),
|
|
|
|
|
Components.JOB_POSTING_ASSISTANT => TB("Job Posting Assistant"),
|
|
|
|
|
Components.ERI_ASSISTANT => TB("ERI Server"),
|
|
|
|
|
Components.I18N_ASSISTANT => TB("Localization Assistant"),
|
2025-11-24 11:37:18 +00:00
|
|
|
Components.DOCUMENT_ANALYSIS_ASSISTANT => TB("Document Analysis Assistant"),
|
Added the Batch Processing Assistant
The assistant processes all documents of a folder in one batch run. Each
document is extracted to Markdown by the Rust runtime and sent to the
selected provider together with the user's instructions.
The instructions come from one of three sources: a free prompt, one of
the existing document analysis policies including its minimum provider
confidence, or a file the user imports.
The output is either one Markdown file per document, or one CSV results
table in which each answer becomes a row. The user can name the results
table; its columns are the document and the answer.
Every run writes a log named log.csv with the document, time, model,
status, and the reason for any error. When a later run finds a log in
the output folder, the assistant asks whether to continue it. Continuing
processes only the documents that failed or whose results no longer
exist, which recovers runs interrupted by a crash or by documents
exceeding the context window of the model. A single failing document
never stops the run, and the run can be canceled at any time.
Columns are separated by a vertical bar and quoted per RFC 4180, so that
the files open in spreadsheet applications regardless of the list
separator of the user. Documents are identified by their path relative
to the input folder, because two subfolders may contain a document of
the same name.
Includes the English and German localization.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 16:05:18 +00:00
|
|
|
Components.BATCH_PROCESSING_ASSISTANT => TB("Batch Processing Assistant"),
|
2026-04-02 07:14:11 +00:00
|
|
|
Components.SLIDE_BUILDER_ASSISTANT => TB("Slide Planner Assistant"),
|
2026-08-02 19:41:12 +00:00
|
|
|
Components.VISUAL_BRIEFING_ASSISTANT => TB("Visual Briefing Assistant"),
|
2026-07-05 15:48:00 +00:00
|
|
|
Components.META_ASSISTANT => TB("Assistant Builder"),
|
2026-07-15 17:44:43 +00:00
|
|
|
Components.LOG_VIEWER_ASSISTANT => TB("Log Viewer Assistant"),
|
2024-09-14 17:20:33 +00:00
|
|
|
|
2025-05-04 12:59:30 +00:00
|
|
|
Components.CHAT => TB("New Chat"),
|
2024-09-14 17:20:33 +00:00
|
|
|
|
2025-11-24 11:37:18 +00:00
|
|
|
_ => Enum.GetName(component)!,
|
2024-09-14 17:20:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static ComponentsData GetData(this Components destination) => destination switch
|
|
|
|
|
{
|
|
|
|
|
Components.AGENDA_ASSISTANT => new(Event.SEND_TO_AGENDA_ASSISTANT, Routes.ASSISTANT_AGENDA),
|
|
|
|
|
Components.CODING_ASSISTANT => new(Event.SEND_TO_CODING_ASSISTANT, Routes.ASSISTANT_CODING),
|
|
|
|
|
Components.REWRITE_ASSISTANT => new(Event.SEND_TO_REWRITE_ASSISTANT, Routes.ASSISTANT_REWRITE),
|
2026-04-15 17:40:53 +00:00
|
|
|
Components.PROMPT_OPTIMIZER_ASSISTANT => new(Event.SEND_TO_PROMPT_OPTIMIZER_ASSISTANT, Routes.ASSISTANT_PROMPT_OPTIMIZER),
|
2024-09-14 17:20:33 +00:00
|
|
|
Components.EMAIL_ASSISTANT => new(Event.SEND_TO_EMAIL_ASSISTANT, Routes.ASSISTANT_EMAIL),
|
|
|
|
|
Components.TRANSLATION_ASSISTANT => new(Event.SEND_TO_TRANSLATION_ASSISTANT, Routes.ASSISTANT_TRANSLATION),
|
|
|
|
|
Components.ICON_FINDER_ASSISTANT => new(Event.SEND_TO_ICON_FINDER_ASSISTANT, Routes.ASSISTANT_ICON_FINDER),
|
|
|
|
|
Components.GRAMMAR_SPELLING_ASSISTANT => new(Event.SEND_TO_GRAMMAR_SPELLING_ASSISTANT, Routes.ASSISTANT_GRAMMAR_SPELLING),
|
|
|
|
|
Components.TEXT_SUMMARIZER_ASSISTANT => new(Event.SEND_TO_TEXT_SUMMARIZER_ASSISTANT, Routes.ASSISTANT_SUMMARIZER),
|
|
|
|
|
Components.LEGAL_CHECK_ASSISTANT => new(Event.SEND_TO_LEGAL_CHECK_ASSISTANT, Routes.ASSISTANT_LEGAL_CHECK),
|
|
|
|
|
Components.SYNONYMS_ASSISTANT => new(Event.SEND_TO_SYNONYMS_ASSISTANT, Routes.ASSISTANT_SYNONYMS),
|
|
|
|
|
Components.MY_TASKS_ASSISTANT => new(Event.SEND_TO_MY_TASKS_ASSISTANT, Routes.ASSISTANT_MY_TASKS),
|
2024-09-15 19:14:56 +00:00
|
|
|
Components.JOB_POSTING_ASSISTANT => new(Event.SEND_TO_JOB_POSTING_ASSISTANT, Routes.ASSISTANT_JOB_POSTING),
|
2025-11-24 11:37:18 +00:00
|
|
|
Components.DOCUMENT_ANALYSIS_ASSISTANT => new(Event.SEND_TO_DOCUMENT_ANALYSIS_ASSISTANT, Routes.ASSISTANT_DOCUMENT_ANALYSIS),
|
2026-03-16 09:44:21 +00:00
|
|
|
Components.SLIDE_BUILDER_ASSISTANT => new(Event.SEND_TO_SLIDE_BUILDER_ASSISTANT, Routes.ASSISTANT_SLIDE_BUILDER),
|
2026-08-02 19:41:12 +00:00
|
|
|
Components.VISUAL_BRIEFING_ASSISTANT => new(Event.SEND_TO_VISUAL_BRIEFING_ASSISTANT, Routes.ASSISTANT_VISUAL_BRIEFING),
|
2024-09-14 17:20:33 +00:00
|
|
|
|
|
|
|
|
Components.CHAT => new(Event.SEND_TO_CHAT, Routes.CHAT),
|
|
|
|
|
|
|
|
|
|
_ => new(Event.NONE, Routes.ASSISTANTS),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static ConfidenceLevel MinimumConfidence(this Components component, SettingsManager settingsManager) => component switch
|
|
|
|
|
{
|
|
|
|
|
Components.GRAMMAR_SPELLING_ASSISTANT => settingsManager.ConfigurationData.GrammarSpelling.PreselectOptions ? settingsManager.ConfigurationData.GrammarSpelling.MinimumProviderConfidence : default,
|
|
|
|
|
Components.ICON_FINDER_ASSISTANT => settingsManager.ConfigurationData.IconFinder.PreselectOptions ? settingsManager.ConfigurationData.IconFinder.MinimumProviderConfidence : default,
|
|
|
|
|
Components.REWRITE_ASSISTANT => settingsManager.ConfigurationData.RewriteImprove.PreselectOptions ? settingsManager.ConfigurationData.RewriteImprove.MinimumProviderConfidence : default,
|
2026-04-15 17:40:53 +00:00
|
|
|
Components.PROMPT_OPTIMIZER_ASSISTANT => settingsManager.ConfigurationData.PromptOptimizer.PreselectOptions ? settingsManager.ConfigurationData.PromptOptimizer.MinimumProviderConfidence : default,
|
2024-09-14 17:20:33 +00:00
|
|
|
Components.TRANSLATION_ASSISTANT => settingsManager.ConfigurationData.Translation.PreselectOptions ? settingsManager.ConfigurationData.Translation.MinimumProviderConfidence : default,
|
|
|
|
|
Components.AGENDA_ASSISTANT => settingsManager.ConfigurationData.Agenda.PreselectOptions ? settingsManager.ConfigurationData.Agenda.MinimumProviderConfidence : default,
|
|
|
|
|
Components.CODING_ASSISTANT => settingsManager.ConfigurationData.Coding.PreselectOptions ? settingsManager.ConfigurationData.Coding.MinimumProviderConfidence : default,
|
|
|
|
|
Components.TEXT_SUMMARIZER_ASSISTANT => settingsManager.ConfigurationData.TextSummarizer.PreselectOptions ? settingsManager.ConfigurationData.TextSummarizer.MinimumProviderConfidence : default,
|
|
|
|
|
Components.EMAIL_ASSISTANT => settingsManager.ConfigurationData.EMail.PreselectOptions ? settingsManager.ConfigurationData.EMail.MinimumProviderConfidence : default,
|
|
|
|
|
Components.LEGAL_CHECK_ASSISTANT => settingsManager.ConfigurationData.LegalCheck.PreselectOptions ? settingsManager.ConfigurationData.LegalCheck.MinimumProviderConfidence : default,
|
|
|
|
|
Components.SYNONYMS_ASSISTANT => settingsManager.ConfigurationData.Synonyms.PreselectOptions ? settingsManager.ConfigurationData.Synonyms.MinimumProviderConfidence : default,
|
|
|
|
|
Components.MY_TASKS_ASSISTANT => settingsManager.ConfigurationData.MyTasks.PreselectOptions ? settingsManager.ConfigurationData.MyTasks.MinimumProviderConfidence : default,
|
2024-09-15 19:14:56 +00:00
|
|
|
Components.JOB_POSTING_ASSISTANT => settingsManager.ConfigurationData.JobPostings.PreselectOptions ? settingsManager.ConfigurationData.JobPostings.MinimumProviderConfidence : default,
|
2024-10-28 14:41:00 +00:00
|
|
|
Components.BIAS_DAY_ASSISTANT => settingsManager.ConfigurationData.BiasOfTheDay.PreselectOptions ? settingsManager.ConfigurationData.BiasOfTheDay.MinimumProviderConfidence : default,
|
2025-01-01 14:49:27 +00:00
|
|
|
Components.ERI_ASSISTANT => settingsManager.ConfigurationData.ERI.PreselectOptions ? settingsManager.ConfigurationData.ERI.MinimumProviderConfidence : default,
|
2026-03-16 09:44:21 +00:00
|
|
|
Components.SLIDE_BUILDER_ASSISTANT => settingsManager.ConfigurationData.SlideBuilder.PreselectOptions ? settingsManager.ConfigurationData.SlideBuilder.MinimumProviderConfidence : default,
|
2026-08-02 19:41:12 +00:00
|
|
|
Components.VISUAL_BRIEFING_ASSISTANT => settingsManager.ConfigurationData.VisualBriefing.MinimumProviderConfidence,
|
2025-11-24 11:37:18 +00:00
|
|
|
|
2026-02-01 13:50:19 +00:00
|
|
|
// The minimum confidence for the Document Analysis Assistant is set per policy.
|
|
|
|
|
// We do this inside the Document Analysis Assistant component:
|
|
|
|
|
Components.DOCUMENT_ANALYSIS_ASSISTANT => ConfidenceLevel.NONE,
|
2024-09-14 17:20:33 +00:00
|
|
|
|
2026-08-11 10:14:22 +00:00
|
|
|
// A policy-specific minimum is merged with this component default inside
|
|
|
|
|
// the Batch Processing Assistant; the stricter level wins.
|
|
|
|
|
Components.BATCH_PROCESSING_ASSISTANT => settingsManager.ConfigurationData.BatchProcessing.PreselectOptions ? settingsManager.ConfigurationData.BatchProcessing.MinimumProviderConfidence : default,
|
Added the Batch Processing Assistant
The assistant processes all documents of a folder in one batch run. Each
document is extracted to Markdown by the Rust runtime and sent to the
selected provider together with the user's instructions.
The instructions come from one of three sources: a free prompt, one of
the existing document analysis policies including its minimum provider
confidence, or a file the user imports.
The output is either one Markdown file per document, or one CSV results
table in which each answer becomes a row. The user can name the results
table; its columns are the document and the answer.
Every run writes a log named log.csv with the document, time, model,
status, and the reason for any error. When a later run finds a log in
the output folder, the assistant asks whether to continue it. Continuing
processes only the documents that failed or whose results no longer
exist, which recovers runs interrupted by a crash or by documents
exceeding the context window of the model. A single failing document
never stops the run, and the run can be canceled at any time.
Columns are separated by a vertical bar and quoted per RFC 4180, so that
the files open in spreadsheet applications regardless of the list
separator of the user. Documents are identified by their path relative
to the input folder, because two subfolders may contain a document of
the same name.
Includes the English and German localization.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 16:05:18 +00:00
|
|
|
|
2024-09-14 17:20:33 +00:00
|
|
|
_ => default,
|
|
|
|
|
};
|
|
|
|
|
|
2025-02-23 14:05:29 +00:00
|
|
|
[SuppressMessage("Usage", "MWAIS0001:Direct access to `Providers` is not allowed")]
|
2025-08-26 08:59:56 +00:00
|
|
|
public static AIStudio.Settings.Provider PreselectedProvider(this Components component, SettingsManager settingsManager)
|
2024-09-14 17:20:33 +00:00
|
|
|
{
|
2025-08-26 08:59:56 +00:00
|
|
|
var preselectedProvider = component switch
|
|
|
|
|
{
|
|
|
|
|
Components.GRAMMAR_SPELLING_ASSISTANT => settingsManager.ConfigurationData.GrammarSpelling.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.GrammarSpelling.PreselectedProvider) : null,
|
|
|
|
|
Components.ICON_FINDER_ASSISTANT => settingsManager.ConfigurationData.IconFinder.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.IconFinder.PreselectedProvider) : null,
|
|
|
|
|
Components.REWRITE_ASSISTANT => settingsManager.ConfigurationData.RewriteImprove.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.RewriteImprove.PreselectedProvider) : null,
|
2026-04-15 17:40:53 +00:00
|
|
|
Components.PROMPT_OPTIMIZER_ASSISTANT => settingsManager.ConfigurationData.PromptOptimizer.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.PromptOptimizer.PreselectedProvider) : null,
|
2025-08-26 08:59:56 +00:00
|
|
|
Components.TRANSLATION_ASSISTANT => settingsManager.ConfigurationData.Translation.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.Translation.PreselectedProvider) : null,
|
|
|
|
|
Components.AGENDA_ASSISTANT => settingsManager.ConfigurationData.Agenda.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.Agenda.PreselectedProvider) : null,
|
|
|
|
|
Components.CODING_ASSISTANT => settingsManager.ConfigurationData.Coding.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.Coding.PreselectedProvider) : null,
|
|
|
|
|
Components.TEXT_SUMMARIZER_ASSISTANT => settingsManager.ConfigurationData.TextSummarizer.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.TextSummarizer.PreselectedProvider) : null,
|
|
|
|
|
Components.EMAIL_ASSISTANT => settingsManager.ConfigurationData.EMail.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.EMail.PreselectedProvider) : null,
|
|
|
|
|
Components.LEGAL_CHECK_ASSISTANT => settingsManager.ConfigurationData.LegalCheck.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.LegalCheck.PreselectedProvider) : null,
|
|
|
|
|
Components.SYNONYMS_ASSISTANT => settingsManager.ConfigurationData.Synonyms.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.Synonyms.PreselectedProvider) : null,
|
|
|
|
|
Components.MY_TASKS_ASSISTANT => settingsManager.ConfigurationData.MyTasks.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.MyTasks.PreselectedProvider) : null,
|
|
|
|
|
Components.JOB_POSTING_ASSISTANT => settingsManager.ConfigurationData.JobPostings.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.JobPostings.PreselectedProvider) : null,
|
|
|
|
|
Components.BIAS_DAY_ASSISTANT => settingsManager.ConfigurationData.BiasOfTheDay.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.BiasOfTheDay.PreselectedProvider) : null,
|
|
|
|
|
Components.ERI_ASSISTANT => settingsManager.ConfigurationData.ERI.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.ERI.PreselectedProvider) : null,
|
|
|
|
|
Components.I18N_ASSISTANT => settingsManager.ConfigurationData.I18N.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.I18N.PreselectedProvider) : null,
|
2026-03-16 09:44:21 +00:00
|
|
|
Components.SLIDE_BUILDER_ASSISTANT => settingsManager.ConfigurationData.SlideBuilder.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.SlideBuilder.PreselectedProvider) : null,
|
2026-08-02 19:41:12 +00:00
|
|
|
Components.VISUAL_BRIEFING_ASSISTANT => settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.VisualBriefing.PreselectedProvider),
|
2025-11-24 11:37:18 +00:00
|
|
|
|
2026-02-01 13:50:19 +00:00
|
|
|
// The Document Analysis Assistant does not have a preselected provider at the component level.
|
|
|
|
|
// The provider is selected per policy instead. We do this inside the Document Analysis Assistant component.
|
|
|
|
|
Components.DOCUMENT_ANALYSIS_ASSISTANT => Settings.Provider.NONE,
|
2024-09-14 17:20:33 +00:00
|
|
|
|
2026-08-11 10:14:22 +00:00
|
|
|
Components.BATCH_PROCESSING_ASSISTANT => settingsManager.ConfigurationData.BatchProcessing.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.BatchProcessing.PreselectedProvider) : null,
|
|
|
|
|
|
2025-08-26 08:59:56 +00:00
|
|
|
Components.CHAT => settingsManager.ConfigurationData.Chat.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.Chat.PreselectedProvider) : null,
|
|
|
|
|
|
|
|
|
|
Components.AGENT_TEXT_CONTENT_CLEANER => settingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.TextContentCleaner.PreselectedAgentProvider) : null,
|
|
|
|
|
Components.AGENT_DATA_SOURCE_SELECTION => settingsManager.ConfigurationData.AgentDataSourceSelection.PreselectAgentOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.AgentDataSourceSelection.PreselectedAgentProvider) : null,
|
|
|
|
|
Components.AGENT_RETRIEVAL_CONTEXT_VALIDATION => settingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectAgentOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectedAgentProvider) : null,
|
2026-04-09 08:01:24 +00:00
|
|
|
Components.AGENT_ASSISTANT_PLUGIN_AUDIT => settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.AssistantPluginAudit.PreselectedAgentProvider),
|
2025-08-26 08:59:56 +00:00
|
|
|
|
|
|
|
|
_ => Settings.Provider.NONE,
|
|
|
|
|
};
|
2025-02-23 14:05:29 +00:00
|
|
|
|
2025-08-26 08:59:56 +00:00
|
|
|
return preselectedProvider ?? Settings.Provider.NONE;
|
|
|
|
|
}
|
2024-09-14 17:20:33 +00:00
|
|
|
|
2026-03-14 14:40:07 +00:00
|
|
|
public static ProfilePreselection GetProfilePreselection(this Components component, SettingsManager settingsManager)
|
2024-09-14 17:20:33 +00:00
|
|
|
{
|
2026-03-14 14:40:07 +00:00
|
|
|
var storedValue = component switch
|
|
|
|
|
{
|
|
|
|
|
Components.AGENDA_ASSISTANT => settingsManager.ConfigurationData.Agenda.PreselectOptions ? settingsManager.ConfigurationData.Agenda.PreselectedProfile : string.Empty,
|
|
|
|
|
Components.CODING_ASSISTANT => settingsManager.ConfigurationData.Coding.PreselectOptions ? settingsManager.ConfigurationData.Coding.PreselectedProfile : string.Empty,
|
|
|
|
|
Components.EMAIL_ASSISTANT => settingsManager.ConfigurationData.EMail.PreselectOptions ? settingsManager.ConfigurationData.EMail.PreselectedProfile : string.Empty,
|
|
|
|
|
Components.LEGAL_CHECK_ASSISTANT => settingsManager.ConfigurationData.LegalCheck.PreselectOptions ? settingsManager.ConfigurationData.LegalCheck.PreselectedProfile : string.Empty,
|
|
|
|
|
Components.MY_TASKS_ASSISTANT => settingsManager.ConfigurationData.MyTasks.PreselectOptions ? settingsManager.ConfigurationData.MyTasks.PreselectedProfile : string.Empty,
|
|
|
|
|
Components.BIAS_DAY_ASSISTANT => settingsManager.ConfigurationData.BiasOfTheDay.PreselectOptions ? settingsManager.ConfigurationData.BiasOfTheDay.PreselectedProfile : string.Empty,
|
|
|
|
|
Components.ERI_ASSISTANT => settingsManager.ConfigurationData.ERI.PreselectOptions ? settingsManager.ConfigurationData.ERI.PreselectedProfile : string.Empty,
|
2026-03-16 09:44:21 +00:00
|
|
|
Components.SLIDE_BUILDER_ASSISTANT => settingsManager.ConfigurationData.SlideBuilder.PreselectOptions ? settingsManager.ConfigurationData.SlideBuilder.PreselectedProfile : string.Empty,
|
2026-08-02 19:41:12 +00:00
|
|
|
Components.VISUAL_BRIEFING_ASSISTANT => settingsManager.ConfigurationData.VisualBriefing.PreselectedProfile,
|
2026-03-14 14:40:07 +00:00
|
|
|
Components.CHAT => settingsManager.ConfigurationData.Chat.PreselectOptions ? settingsManager.ConfigurationData.Chat.PreselectedProfile : string.Empty,
|
2024-09-14 17:20:33 +00:00
|
|
|
|
2026-03-14 14:40:07 +00:00
|
|
|
// The Document Analysis Assistant does not have a preselected profile at the component level.
|
|
|
|
|
// The profile is selected per policy instead. We do this inside the Document Analysis Assistant component:
|
|
|
|
|
Components.DOCUMENT_ANALYSIS_ASSISTANT => Profile.NO_PROFILE.Id,
|
|
|
|
|
|
|
|
|
|
_ => string.Empty,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return ProfilePreselection.FromStoredValue(storedValue);
|
|
|
|
|
}
|
2025-05-24 10:27:00 +00:00
|
|
|
|
|
|
|
|
public static ChatTemplate PreselectedChatTemplate(this Components component, SettingsManager settingsManager) => component switch
|
|
|
|
|
{
|
2026-06-10 19:01:27 +00:00
|
|
|
Components.CHAT => settingsManager.ConfigurationData.Chat.PreselectOptions ? settingsManager.GetChatTemplateById(settingsManager.ConfigurationData.Chat.PreselectedChatTemplate) : ChatTemplate.NO_CHAT_TEMPLATE,
|
2025-05-24 10:27:00 +00:00
|
|
|
|
2025-08-18 18:40:52 +00:00
|
|
|
_ => ChatTemplate.NO_CHAT_TEMPLATE,
|
2025-05-24 10:27:00 +00:00
|
|
|
};
|
2026-08-11 10:14:22 +00:00
|
|
|
}
|