mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-03 23:02:56 +00:00
Released PDF import feature (#468)
This commit is contained in:
parent
038ddec46b
commit
217d31bc44
@ -1,5 +1,4 @@
|
||||
@attribute [Route(Routes.ASSISTANT_LEGAL_CHECK)]
|
||||
@using AIStudio.Settings.DataModel
|
||||
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogLegalCheck>
|
||||
|
||||
@if (!this.SettingsManager.ConfigurationData.LegalCheck.HideWebContentReader)
|
||||
@ -7,11 +6,7 @@
|
||||
<ReadWebContent @bind-Content="@this.inputLegalDocument" ProviderSettings="@this.providerSettings" @bind-AgentIsRunning="@this.isAgentRunning" Preselect="@(this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions && this.SettingsManager.ConfigurationData.LegalCheck.PreselectWebContentReader)" PreselectContentCleanerAgent="@(this.SettingsManager.ConfigurationData.LegalCheck.PreselectOptions && this.SettingsManager.ConfigurationData.LegalCheck.PreselectContentCleanerAgent)"/>
|
||||
}
|
||||
|
||||
@if (PreviewFeatures.PRE_READ_PDF_2025.IsEnabled(this.SettingsManager))
|
||||
{
|
||||
<ReadPDFContent @bind-PDFContent="@this.inputLegalDocument"/>
|
||||
}
|
||||
|
||||
<ReadPDFContent @bind-PDFContent="@this.inputLegalDocument"/>
|
||||
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.inputLegalDocument" Validation="@this.ValidatingLegalDocument" AdornmentIcon="@Icons.Material.Filled.DocumentScanner" Adornment="Adornment.Start" Label="@T("Legal document")" Variant="Variant.Outlined" Lines="12" AutoGrow="@true" MaxLines="24" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
||||
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.inputQuestions" Validation="@this.ValidatingQuestions" AdornmentIcon="@Icons.Material.Filled.QuestionAnswer" Adornment="Adornment.Start" Label="@T("Your questions")" Variant="Variant.Outlined" Lines="6" AutoGrow="@true" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
||||
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/>
|
@ -1,5 +1,4 @@
|
||||
@attribute [Route(Routes.ASSISTANT_SUMMARIZER)]
|
||||
@using AIStudio.Settings.DataModel
|
||||
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogTextSummarizer>
|
||||
|
||||
@if (!this.SettingsManager.ConfigurationData.TextSummarizer.HideWebContentReader)
|
||||
@ -7,11 +6,7 @@
|
||||
<ReadWebContent @bind-Content="@this.inputText" ProviderSettings="@this.providerSettings" @bind-AgentIsRunning="@this.isAgentRunning" Preselect="@(this.SettingsManager.ConfigurationData.TextSummarizer.PreselectOptions && this.SettingsManager.ConfigurationData.TextSummarizer.PreselectWebContentReader)" PreselectContentCleanerAgent="@(this.SettingsManager.ConfigurationData.TextSummarizer.PreselectOptions && this.SettingsManager.ConfigurationData.TextSummarizer.PreselectContentCleanerAgent)"/>
|
||||
}
|
||||
|
||||
@if (PreviewFeatures.PRE_READ_PDF_2025.IsEnabled(this.SettingsManager))
|
||||
{
|
||||
<ReadPDFContent @bind-PDFContent="@this.inputText"/>
|
||||
}
|
||||
|
||||
<ReadPDFContent @bind-PDFContent="@this.inputText"/>
|
||||
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.inputText" Validation="@this.ValidatingText" AdornmentIcon="@Icons.Material.Filled.DocumentScanner" Adornment="Adornment.Start" Label="@T("Your input")" Variant="Variant.Outlined" Lines="6" AutoGrow="@true" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
||||
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.Name())" @bind-Value="@this.selectedTargetLanguage" Icon="@Icons.Material.Filled.Translate" Label="@T("Target language")" AllowOther="@true" @bind-OtherInput="@this.customTargetLanguage" OtherValue="CommonLanguages.OTHER" LabelOther="@T("Custom target language")" ValidateOther="@this.ValidateCustomLanguage" />
|
||||
<EnumSelection T="Complexity" NameFunc="@(complexity => complexity.Name())" @bind-Value="@this.selectedComplexity" Icon="@Icons.Material.Filled.Layers" Label="@T("Target complexity")" AllowOther="@true" @bind-OtherInput="@this.expertInField" OtherValue="Complexity.SCIENTIFIC_LANGUAGE_OTHER_EXPERTS" LabelOther="@T("Your expertise")" ValidateOther="@this.ValidateExpertInField" />
|
||||
|
@ -1,5 +1,4 @@
|
||||
@attribute [Route(Routes.ASSISTANT_TRANSLATION)]
|
||||
@using AIStudio.Settings.DataModel
|
||||
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogTranslation>
|
||||
|
||||
@if (!this.SettingsManager.ConfigurationData.Translation.HideWebContentReader)
|
||||
@ -7,11 +6,7 @@
|
||||
<ReadWebContent @bind-Content="@this.inputText" ProviderSettings="@this.providerSettings" @bind-AgentIsRunning="@this.isAgentRunning" Preselect="@(this.SettingsManager.ConfigurationData.Translation.PreselectOptions && this.SettingsManager.ConfigurationData.Translation.PreselectWebContentReader)" PreselectContentCleanerAgent="@(this.SettingsManager.ConfigurationData.Translation.PreselectOptions && this.SettingsManager.ConfigurationData.Translation.PreselectContentCleanerAgent)"/>
|
||||
}
|
||||
|
||||
@if (PreviewFeatures.PRE_READ_PDF_2025.IsEnabled(this.SettingsManager))
|
||||
{
|
||||
<ReadPDFContent @bind-PDFContent="@this.inputText"/>
|
||||
}
|
||||
|
||||
<ReadPDFContent @bind-PDFContent="@this.inputText"/>
|
||||
<MudTextSwitch Label="@T("Live translation")" @bind-Value="@this.liveTranslation" LabelOn="@T("Live translation")" LabelOff="@T("No live translation")"/>
|
||||
@if (this.liveTranslation)
|
||||
{
|
||||
|
@ -26,7 +26,7 @@
|
||||
var availablePreviewFeatures = ConfigurationSelectDataFactory.GetPreviewFeaturesData(this.SettingsManager).ToList();
|
||||
if (availablePreviewFeatures.Count > 0)
|
||||
{
|
||||
<ConfigurationMultiSelect OptionDescription="@T("Select preview features")" SelectedValues="@(() => this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures)" Data="@availablePreviewFeatures" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = selectedValue)" OptionHelp="@T("Which preview features would you like to enable?")"/>
|
||||
<ConfigurationMultiSelect OptionDescription="@T("Select preview features")" SelectedValues="@(() => this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures.Where(x => !x.IsReleased()).ToHashSet())" Data="@availablePreviewFeatures" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = selectedValue)" OptionHelp="@T("Which preview features would you like to enable?")"/>
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ public static class ConfigurationSelectDataFactory
|
||||
|
||||
public static IEnumerable<ConfigurationSelectData<PreviewFeatures>> GetPreviewFeaturesData(SettingsManager settingsManager)
|
||||
{
|
||||
foreach (var source in settingsManager.ConfigurationData.App.PreviewVisibility.GetPreviewFeatures())
|
||||
foreach (var source in settingsManager.ConfigurationData.App.PreviewVisibility.GetPreviewFeatures().Where(x => !x.IsReleased()))
|
||||
yield return new(source.GetPreviewDescription(), source);
|
||||
}
|
||||
|
||||
|
@ -17,5 +17,26 @@ public static class PreviewFeaturesExtensions
|
||||
_ => TB("Unknown preview feature")
|
||||
};
|
||||
|
||||
public static bool IsEnabled(this PreviewFeatures feature, SettingsManager settingsManager) => settingsManager.ConfigurationData.App.EnabledPreviewFeatures.Contains(feature);
|
||||
/// <summary>
|
||||
/// Check if the preview feature is released or not.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This metadata is necessary because we cannot remove the enum values from the list.
|
||||
/// Otherwise, we could not deserialize old settings files that may contain these values.
|
||||
/// </remarks>
|
||||
/// <param name="feature">The preview feature to check.</param>
|
||||
/// <returns>True when the preview feature is released, false otherwise.</returns>
|
||||
public static bool IsReleased(this PreviewFeatures feature) => feature switch
|
||||
{
|
||||
PreviewFeatures.PRE_READ_PDF_2025 => true,
|
||||
_ => false
|
||||
};
|
||||
|
||||
public static bool IsEnabled(this PreviewFeatures feature, SettingsManager settingsManager)
|
||||
{
|
||||
if(feature.IsReleased())
|
||||
return true;
|
||||
|
||||
return settingsManager.ConfigurationData.App.EnabledPreviewFeatures.Contains(feature);
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
# v0.9.44, build 219 (2025-05-xx xx:xx UTC)
|
||||
- Added PDF import feature: we have completed the work on the PDF import feature. Importing PDF files has been successfully tested on macOS, Linux, and Windows. The feature is now enabled for everyone.
|
||||
- Improved compatibility with certain Ubuntu linux versions regarding desktop integration.
|
||||
- Improved the table views for providers, embeddings, and profiles by displaying actions as icons with tooltips.
|
||||
- Improved localization code & German translation.
|
||||
|
@ -8,4 +8,4 @@
|
||||
1.8.1
|
||||
ba236c4012d, release
|
||||
osx-arm64
|
||||
137.0.7123.0
|
||||
137.0.7123.0
|
Loading…
Reference in New Issue
Block a user