mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 07:01:37 +00:00
Added document review to the document analysis assistant (#581)
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (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) (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 deb updater) (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 updater) (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) (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 deb updater) (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
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (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) (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 deb updater) (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 updater) (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) (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 deb updater) (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>
This commit is contained in:
parent
a6519ca0e2
commit
273c4274f2
@ -1483,11 +1483,11 @@ UI_TEXT_CONTENT["AISTUDIO::CHAT::CONTENTBLOCKCOMPONENT::T861873672"] = "Export C
|
|||||||
-- Open Settings
|
-- Open Settings
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ASSISTANTBLOCK::T1172211894"] = "Open Settings"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ASSISTANTBLOCK::T1172211894"] = "Open Settings"
|
||||||
|
|
||||||
-- Drag and drop files here or click to attach documents.
|
-- Drag and drop files into the marked area or click here to attach documents:
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T1647829151"] = "Drag and drop files here or click to attach documents."
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T230755331"] = "Drag and drop files into the marked area or click here to attach documents:"
|
||||||
|
|
||||||
-- Pandoc Load Document Preview
|
-- Document Preview
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2686523471"] = "Pandoc Load Document Preview"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T285154968"] = "Document Preview"
|
||||||
|
|
||||||
-- Videos are not supported yet
|
-- Videos are not supported yet
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2928927510"] = "Videos are not supported yet"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2928927510"] = "Videos are not supported yet"
|
||||||
@ -1498,6 +1498,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T298062956"] = "Images a
|
|||||||
-- Clear file list
|
-- Clear file list
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T3759696136"] = "Clear file list"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T3759696136"] = "Clear file list"
|
||||||
|
|
||||||
|
-- Add file
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4014053962"] = "Add file"
|
||||||
|
|
||||||
-- Executables are not allowed
|
-- Executables are not allowed
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4167762413"] = "Executables are not allowed"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4167762413"] = "Executables are not allowed"
|
||||||
|
|
||||||
@ -1801,12 +1804,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROFILESELECTION::T918741365"] = "You can
|
|||||||
-- Provider
|
-- Provider
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROVIDERSELECTION::T900237532"] = "Provider"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROVIDERSELECTION::T900237532"] = "Provider"
|
||||||
|
|
||||||
-- Pandoc Installation
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T185447014"] = "Pandoc Installation"
|
|
||||||
|
|
||||||
-- Pandoc may be required for importing files.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2596465560"] = "Pandoc may be required for importing files."
|
|
||||||
|
|
||||||
-- Videos are not supported yet
|
-- Videos are not supported yet
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2928927510"] = "Videos are not supported yet"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2928927510"] = "Videos are not supported yet"
|
||||||
|
|
||||||
@ -2908,6 +2905,30 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T3688254408"]
|
|||||||
-- Your security policy
|
-- Your security policy
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T4081226330"] = "Your security policy"
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T4081226330"] = "Your security policy"
|
||||||
|
|
||||||
|
-- Markdown View
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T1373123357"] = "Markdown View"
|
||||||
|
|
||||||
|
-- Load file
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T2129302565"] = "Load file"
|
||||||
|
|
||||||
|
-- See how we load your file. Review the content before we process it further.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3271853346"] = "See how we load your file. Review the content before we process it further."
|
||||||
|
|
||||||
|
-- Close
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3448155331"] = "Close"
|
||||||
|
|
||||||
|
-- Loaded Content
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3529911749"] = "Loaded Content"
|
||||||
|
|
||||||
|
-- Simple View
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T428485200"] = "Simple View"
|
||||||
|
|
||||||
|
-- This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T652739927"] = "This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected."
|
||||||
|
|
||||||
|
-- File Path
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T729508546"] = "File Path"
|
||||||
|
|
||||||
-- Embedding Name
|
-- Embedding Name
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::EMBEDDINGMETHODDIALOG::T1427271797"] = "Embedding Name"
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::EMBEDDINGMETHODDIALOG::T1427271797"] = "Embedding Name"
|
||||||
|
|
||||||
@ -3118,21 +3139,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T504404155"] = "Accept the ter
|
|||||||
-- Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking "Accept GPL and archive," you agree to the terms of the GPL license. Software under GPL is free of charge and free to use.
|
-- Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking "Accept GPL and archive," you agree to the terms of the GPL license. Software under GPL is free of charge and free to use.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T523908375"] = "Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking \"Accept GPL and archive,\" you agree to the terms of the GPL license. Software under GPL is free of charge and free to use."
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T523908375"] = "Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking \"Accept GPL and archive,\" you agree to the terms of the GPL license. Software under GPL is free of charge and free to use."
|
||||||
|
|
||||||
-- Test how Pandoc loads your document. See the raw content it produces before further processing.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T1481857352"] = "Test how Pandoc loads your document. See the raw content it produces before further processing."
|
|
||||||
|
|
||||||
-- Content Loaded by Pandoc
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2147198279"] = "Content Loaded by Pandoc"
|
|
||||||
|
|
||||||
-- This is the content Pandoc loaded from your document — including headings, lists, and formatting. Use this to verify your document loads as expected.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2156541074"] = "This is the content Pandoc loaded from your document — including headings, lists, and formatting. Use this to verify your document loads as expected."
|
|
||||||
|
|
||||||
-- Load document
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2394358670"] = "Load document"
|
|
||||||
|
|
||||||
-- Cancel
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T900713019"] = "Cancel"
|
|
||||||
|
|
||||||
-- Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally.
|
-- Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PROFILEDIALOG::T1458195391"] = "Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally."
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PROFILEDIALOG::T1458195391"] = "Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally."
|
||||||
|
|
||||||
@ -5875,6 +5881,15 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4174900468"] = "Sources pro
|
|||||||
-- Sources provided by the AI
|
-- Sources provided by the AI
|
||||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4261248356"] = "Sources provided by the AI"
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4261248356"] = "Sources provided by the AI"
|
||||||
|
|
||||||
|
-- Pandoc Installation
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T185447014"] = "Pandoc Installation"
|
||||||
|
|
||||||
|
-- Pandoc may be required for importing files.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T2596465560"] = "Pandoc may be required for importing files."
|
||||||
|
|
||||||
|
-- The file path is null or empty and the file therefore can not be loaded.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T932243993"] = "The file path is null or empty and the file therefore can not be loaded."
|
||||||
|
|
||||||
-- The hostname is not a valid HTTP(S) URL.
|
-- The hostname is not a valid HTTP(S) URL.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::VALIDATION::DATASOURCEVALIDATION::T1013354736"] = "The hostname is not a valid HTTP(S) URL."
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::VALIDATION::DATASOURCEVALIDATION::T1013354736"] = "The hostname is not a valid HTTP(S) URL."
|
||||||
|
|
||||||
|
|||||||
@ -1,20 +1,27 @@
|
|||||||
@inherits MSGComponentBase
|
@inherits MSGComponentBase
|
||||||
|
|
||||||
<div @onmouseenter="@this.OnMouseEnter" @onmouseleave="@this.OnMouseLeave">
|
<MudStack Row="true" AlignItems="AlignItems.Center" StretchItems="StretchItems.None" Wrap="Wrap.Wrap">
|
||||||
<MudLink OnClick="@(() => this.AddFilesManually())" Style="text-decoration: none;">
|
<MudText Typo="Typo.body1" Inline="true">
|
||||||
<MudPaper Height="20em" Outlined="true" Class="@this.dragClass" Style="overflow-y: auto;">
|
@T("Drag and drop files into the marked area or click here to attach documents: ")
|
||||||
<MudText Typo="Typo.h6">
|
|
||||||
@T("Drag and drop files here or click to attach documents.")
|
|
||||||
</MudText>
|
</MudText>
|
||||||
|
<MudButton
|
||||||
|
Variant="Variant.Filled"
|
||||||
|
Icon="@Icons.Material.Filled.Add"
|
||||||
|
Color="Color.Primary"
|
||||||
|
OnClick="@(() => this.AddFilesManually())"
|
||||||
|
Style="vertical-align: top; margin-top: -2px;"
|
||||||
|
Size="Size.Small"
|
||||||
|
T>@T("Add file")
|
||||||
|
</MudButton>
|
||||||
|
</MudStack>
|
||||||
|
<div @onmouseenter="@this.OnMouseEnter" @onmouseleave="@this.OnMouseLeave">
|
||||||
|
<MudPaper Height="20em" Outlined="true" Class="@this.dragClass" Style="overflow-y: auto;">
|
||||||
@foreach (var fileInfo in this.DocumentPaths.Select(file => new FileInfo(file)))
|
@foreach (var fileInfo in this.DocumentPaths.Select(file => new FileInfo(file)))
|
||||||
{
|
{
|
||||||
<MudBadge Origin="Origin.TopCenter" Icon="@Icons.Material.Filled.Search" Color="Color.Primary" Overlap="true" Bordered="true" OnClick="@(() => this.InvestigateFile(@fileInfo))">
|
|
||||||
<MudChip T="string" Color="Color.Dark" Text="@fileInfo.Name" tabindex="-1" Icon="@Icons.Material.Filled.Search" OnClick="@(() => this.InvestigateFile(@fileInfo))" OnClose="@(() => this.RemoveDocumentPathFromDocumentPaths(@fileInfo))"/>
|
<MudChip T="string" Color="Color.Dark" Text="@fileInfo.Name" tabindex="-1" Icon="@Icons.Material.Filled.Search" OnClick="@(() => this.InvestigateFile(@fileInfo))" OnClose="@(() => this.RemoveDocumentPathFromDocumentPaths(@fileInfo))"/>
|
||||||
</MudBadge>
|
|
||||||
}
|
}
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudLink>
|
</div>
|
||||||
<MudButton OnClick="@(async () => await this.ClearAllFiles())" Variant="Variant.Filled" Color="Color.Info" Class="mt-2" StartIcon="@Icons.Material.Filled.Delete">
|
<MudButton OnClick="@(async () => await this.ClearAllFiles())" Variant="Variant.Filled" Color="Color.Info" Class="mt-2" StartIcon="@Icons.Material.Filled.Delete">
|
||||||
@T("Clear file list")
|
@T("Clear file list")
|
||||||
</MudButton>
|
</MudButton>
|
||||||
</div>
|
|
||||||
@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Components;
|
|||||||
|
|
||||||
namespace AIStudio.Components;
|
namespace AIStudio.Components;
|
||||||
|
|
||||||
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
using DialogOptions = Dialogs.DialogOptions;
|
||||||
|
|
||||||
public partial class AttachDocuments : MSGComponentBase
|
public partial class AttachDocuments : MSGComponentBase
|
||||||
{
|
{
|
||||||
@ -167,19 +167,16 @@ public partial class AttachDocuments : MSGComponentBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The user might want to check what the Pandoc integration actually extracts from his file and therefore gives the LLM as input.
|
/// The user might want to check what we actually extract from his file and therefore give the LLM as an input.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="file">The file to check.</param>
|
/// <param name="file">The file to check.</param>
|
||||||
private async Task InvestigateFile(FileInfo file)
|
private async Task InvestigateFile(FileInfo file)
|
||||||
{
|
{
|
||||||
# warning Implement Investigation of file
|
var dialogParameters = new DialogParameters<DocumentCheckDialog>
|
||||||
|
{
|
||||||
|
{ x => x.FilePath, file.FullName },
|
||||||
|
};
|
||||||
|
|
||||||
var dialogParameters = new DialogParameters<PandocDocumentCheckDialog>{};
|
await this.DialogService.ShowAsync<DocumentCheckDialog>(T("Document Preview"), dialogParameters, DialogOptions.FULLSCREEN);
|
||||||
|
|
||||||
var dialogReference = await this.DialogService.ShowAsync<PandocDocumentCheckDialog>(T("Pandoc Load Document Preview"), dialogParameters, DialogOptions.FULLSCREEN);
|
|
||||||
var dialogResult = await dialogReference.Result;
|
|
||||||
if (dialogResult is null || dialogResult.Canceled)
|
|
||||||
return;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,11 +1,8 @@
|
|||||||
using AIStudio.Dialogs;
|
|
||||||
using AIStudio.Tools.Rust;
|
using AIStudio.Tools.Rust;
|
||||||
using AIStudio.Tools.Services;
|
using AIStudio.Tools.Services;
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
|
||||||
|
|
||||||
namespace AIStudio.Components;
|
namespace AIStudio.Components;
|
||||||
|
|
||||||
public partial class ReadFileContent : MSGComponentBase
|
public partial class ReadFileContent : MSGComponentBase
|
||||||
@ -56,27 +53,7 @@ public partial class ReadFileContent : MSGComponentBase
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that Pandoc is installed and ready:
|
var fileContent = await UserFile.LoadFileData(selectedFile.SelectedFilePath, this.RustService, this.DialogService);
|
||||||
var pandocState = await Pandoc.CheckAvailabilityAsync(this.RustService, showSuccessMessage: false);
|
|
||||||
if (!pandocState.IsAvailable)
|
|
||||||
{
|
|
||||||
var dialogParameters = new DialogParameters<PandocDialog>
|
|
||||||
{
|
|
||||||
{ x => x.ShowInitialResultInSnackbar, false },
|
|
||||||
};
|
|
||||||
|
|
||||||
var dialogReference = await this.DialogService.ShowAsync<PandocDialog>(T("Pandoc Installation"), dialogParameters, DialogOptions.FULLSCREEN);
|
|
||||||
await dialogReference.Result;
|
|
||||||
|
|
||||||
pandocState = await Pandoc.CheckAvailabilityAsync(this.RustService, showSuccessMessage: true);
|
|
||||||
if (!pandocState.IsAvailable)
|
|
||||||
{
|
|
||||||
this.Logger.LogError("Pandoc is not available after installation attempt.");
|
|
||||||
await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.Cancel, T("Pandoc may be required for importing files.")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var fileContent = await this.RustService.ReadArbitraryFileData(selectedFile.SelectedFilePath, int.MaxValue);
|
|
||||||
await this.FileContentChanged.InvokeAsync(fileContent);
|
await this.FileContentChanged.InvokeAsync(fileContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
70
app/MindWork AI Studio/Dialogs/DocumentCheckDialog.razor
Normal file
70
app/MindWork AI Studio/Dialogs/DocumentCheckDialog.razor
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
@inherits MSGComponentBase
|
||||||
|
|
||||||
|
<MudDialog>
|
||||||
|
<DialogContent>
|
||||||
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
||||||
|
@T("See how we load your file. Review the content before we process it further.")
|
||||||
|
</MudJustifiedText>
|
||||||
|
|
||||||
|
@if (string.IsNullOrWhiteSpace(this.FilePath))
|
||||||
|
{
|
||||||
|
<ReadFileContent Text="@T("Load file")" @bind-FileContent="@this.FileContent"/>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudTextField
|
||||||
|
T="string"
|
||||||
|
@bind-Text="@this.FilePath"
|
||||||
|
AdornmentIcon="@Icons.Material.Filled.FileOpen"
|
||||||
|
Adornment="Adornment.Start"
|
||||||
|
Immediate="@true"
|
||||||
|
Label="@T("File Path")"
|
||||||
|
Variant="Variant.Outlined"
|
||||||
|
Lines="1"
|
||||||
|
MaxLines="3"
|
||||||
|
Class="mt-10"
|
||||||
|
ReadOnly="true"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
|
<MudTabs Elevation="0" Rounded="true" ApplyEffectsToContainer="true" Outlined="true" PanelClass="pa-2" Class="mb-2">
|
||||||
|
<MudTabPanel Text="@T("Markdown View")" Icon="@Icons.Material.Filled.TextSnippet">
|
||||||
|
<MudField
|
||||||
|
Variant="Variant.Outlined"
|
||||||
|
AdornmentIcon="@Icons.Material.Filled.Article"
|
||||||
|
Adornment="Adornment.Start"
|
||||||
|
Label="@T("Loaded Content")"
|
||||||
|
FullWidth="true"
|
||||||
|
Class="ma-2 pe-4"
|
||||||
|
HelperText="@T("This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected.")"
|
||||||
|
>
|
||||||
|
<div style="max-height: 40vh; overflow-y: auto;">
|
||||||
|
<MudMarkdown Value="@this.FileContent" Props="Markdown.DefaultConfig" Styling="@this.MarkdownStyling"/>
|
||||||
|
</div>
|
||||||
|
</MudField>
|
||||||
|
</MudTabPanel>
|
||||||
|
<MudTabPanel Text="@T("Simple View")" Icon="@Icons.Material.Filled.Terminal">
|
||||||
|
<MudTextField
|
||||||
|
T="string"
|
||||||
|
@bind-Text="@this.FileContent"
|
||||||
|
AdornmentIcon="@Icons.Material.Filled.Article"
|
||||||
|
Adornment="Adornment.Start"
|
||||||
|
Immediate="@true"
|
||||||
|
Label="@T("Loaded Content")"
|
||||||
|
Variant="Variant.Outlined"
|
||||||
|
Lines="6"
|
||||||
|
AutoGrow="@true"
|
||||||
|
MaxLines="25"
|
||||||
|
ReadOnly="true"
|
||||||
|
Class="ma-2"
|
||||||
|
HelperText="@T("This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected.")"/>
|
||||||
|
</MudTabPanel>
|
||||||
|
</MudTabs>
|
||||||
|
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<MudButton OnClick="@this.Close" Variant="Variant.Filled">
|
||||||
|
@T("Close")
|
||||||
|
</MudButton>
|
||||||
|
</DialogActions>
|
||||||
|
</MudDialog>
|
||||||
48
app/MindWork AI Studio/Dialogs/DocumentCheckDialog.razor.cs
Normal file
48
app/MindWork AI Studio/Dialogs/DocumentCheckDialog.razor.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
using AIStudio.Components;
|
||||||
|
using AIStudio.Tools.Services;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace AIStudio.Dialogs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check how your file will be loaded.
|
||||||
|
/// </summary>
|
||||||
|
public partial class DocumentCheckDialog : MSGComponentBase
|
||||||
|
{
|
||||||
|
[CascadingParameter]
|
||||||
|
private IMudDialogInstance MudDialog { get; set; } = null!;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string FilePath { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
private void Close() => this.MudDialog.Cancel();
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string FileContent { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private RustService RustService { get; init; } = null!;
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private IDialogService DialogService { get; init; } = null!;
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private ILogger<ReadFileContent> Logger { get; init; } = null!;
|
||||||
|
|
||||||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
|
{
|
||||||
|
if (firstRender && !string.IsNullOrWhiteSpace(this.FilePath))
|
||||||
|
{
|
||||||
|
var fileContent = await UserFile.LoadFileData(this.FilePath, this.RustService, this.DialogService);
|
||||||
|
this.FileContent = fileContent;
|
||||||
|
this.StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private CodeBlockTheme CodeColorPalette => this.SettingsManager.IsDarkMode ? CodeBlockTheme.Dark : CodeBlockTheme.Default;
|
||||||
|
|
||||||
|
private MudMarkdownStyling MarkdownStyling => new()
|
||||||
|
{
|
||||||
|
CodeBlock = { Theme = this.CodeColorPalette },
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -1,34 +0,0 @@
|
|||||||
@inherits MSGComponentBase
|
|
||||||
|
|
||||||
|
|
||||||
<MudDialog>
|
|
||||||
<DialogContent>
|
|
||||||
<PreviewPrototype/>
|
|
||||||
|
|
||||||
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
|
||||||
@T("Test how Pandoc loads your document. See the raw content it produces before further processing.")
|
|
||||||
</MudJustifiedText>
|
|
||||||
|
|
||||||
<ReadFileContent Text="@T("Load document")" @bind-FileContent="@this.documentContent"/>
|
|
||||||
|
|
||||||
<MudTextField
|
|
||||||
T="string"
|
|
||||||
@bind-Text="@this.documentContent"
|
|
||||||
AdornmentIcon="@Icons.Material.Filled.Article"
|
|
||||||
Adornment="Adornment.Start"
|
|
||||||
Immediate="@true"
|
|
||||||
Label="@T("Content Loaded by Pandoc")"
|
|
||||||
Variant="Variant.Outlined"
|
|
||||||
Lines="6"
|
|
||||||
AutoGrow="@true"
|
|
||||||
MaxLines="25"
|
|
||||||
Class="mt-10"
|
|
||||||
HelperText="@T("This is the content Pandoc loaded from your document — including headings, lists, and formatting. Use this to verify your document loads as expected.")"
|
|
||||||
/>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled">
|
|
||||||
@T("Cancel")
|
|
||||||
</MudButton>
|
|
||||||
</DialogActions>
|
|
||||||
</MudDialog>
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
using System.Formats.Asn1;
|
|
||||||
using AIStudio.Components;
|
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
|
|
||||||
namespace AIStudio.Dialogs;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check how your file will be loaded by Pandoc.
|
|
||||||
/// </summary>
|
|
||||||
public partial class PandocDocumentCheckDialog : MSGComponentBase
|
|
||||||
{
|
|
||||||
[CascadingParameter]
|
|
||||||
private IMudDialogInstance MudDialog { get; set; } = null!;
|
|
||||||
|
|
||||||
|
|
||||||
private string documentContent = string.Empty;
|
|
||||||
|
|
||||||
private void Cancel() => this.MudDialog.Cancel();
|
|
||||||
}
|
|
||||||
@ -1485,11 +1485,11 @@ UI_TEXT_CONTENT["AISTUDIO::CHAT::CONTENTBLOCKCOMPONENT::T861873672"] = "Chat in
|
|||||||
-- Open Settings
|
-- Open Settings
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ASSISTANTBLOCK::T1172211894"] = "Einstellungen öffnen"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ASSISTANTBLOCK::T1172211894"] = "Einstellungen öffnen"
|
||||||
|
|
||||||
-- Drag and drop files here or click to attach documents.
|
-- Drag and drop files into the marked area or click here to attach documents:
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T1647829151"] = "Dateien hierher ziehen und ablegen oder klicken, um Dokumente anzuhängen."
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T230755331"] = "Ziehen Sie Dateien in den markierten Bereich oder klicken Sie hier, um Dokumente anzuhängen:"
|
||||||
|
|
||||||
-- Pandoc Load Document Preview
|
-- Document Preview
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2686523471"] = "Pandoc-Dokumentvorschau"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T285154968"] = "Dokumentenvorschau"
|
||||||
|
|
||||||
-- Videos are not supported yet
|
-- Videos are not supported yet
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2928927510"] = "Videos werden noch nicht unterstützt."
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2928927510"] = "Videos werden noch nicht unterstützt."
|
||||||
@ -1500,6 +1500,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T298062956"] = "Bilder w
|
|||||||
-- Clear file list
|
-- Clear file list
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T3759696136"] = "Dateiliste löschen"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T3759696136"] = "Dateiliste löschen"
|
||||||
|
|
||||||
|
-- Add file
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4014053962"] = "Datei hinzufügen"
|
||||||
|
|
||||||
-- Executables are not allowed
|
-- Executables are not allowed
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4167762413"] = "Ausführbare Dateien sind nicht erlaubt"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4167762413"] = "Ausführbare Dateien sind nicht erlaubt"
|
||||||
|
|
||||||
@ -1803,12 +1806,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROFILESELECTION::T918741365"] = "Hier k
|
|||||||
-- Provider
|
-- Provider
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROVIDERSELECTION::T900237532"] = "Anbieter"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROVIDERSELECTION::T900237532"] = "Anbieter"
|
||||||
|
|
||||||
-- Pandoc Installation
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T185447014"] = "Pandoc-Installation"
|
|
||||||
|
|
||||||
-- Pandoc may be required for importing files.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2596465560"] = "Pandoc wird möglicherweise zum Importieren von Dateien benötigt."
|
|
||||||
|
|
||||||
-- Videos are not supported yet
|
-- Videos are not supported yet
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2928927510"] = "Videos werden noch nicht unterstützt."
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2928927510"] = "Videos werden noch nicht unterstützt."
|
||||||
|
|
||||||
@ -2910,6 +2907,30 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T3688254408"]
|
|||||||
-- Your security policy
|
-- Your security policy
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T4081226330"] = "Ihre Sicherheitsrichtlinie"
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T4081226330"] = "Ihre Sicherheitsrichtlinie"
|
||||||
|
|
||||||
|
-- Markdown View
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T1373123357"] = "Markdown-Ansicht"
|
||||||
|
|
||||||
|
-- Load file
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T2129302565"] = "Datei laden"
|
||||||
|
|
||||||
|
-- See how we load your file. Review the content before we process it further.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3271853346"] = "So wird Ihre Datei geladen. Überprüfen Sie den Inhalt, bevor wir ihn weiterverarbeiten."
|
||||||
|
|
||||||
|
-- Close
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3448155331"] = "Schließen"
|
||||||
|
|
||||||
|
-- Loaded Content
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3529911749"] = "Geladener Inhalt"
|
||||||
|
|
||||||
|
-- Simple View
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T428485200"] = "Einfache Ansicht"
|
||||||
|
|
||||||
|
-- This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T652739927"] = "Dies ist der Inhalt, den wir aus Ihrer Datei geladen haben – einschließlich Überschriften, Listen und Formatierung. Verwenden Sie dies, um zu überprüfen, ob Ihre Datei wie erwartet geladen wird."
|
||||||
|
|
||||||
|
-- File Path
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T729508546"] = "Dateipfad"
|
||||||
|
|
||||||
-- Embedding Name
|
-- Embedding Name
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::EMBEDDINGMETHODDIALOG::T1427271797"] = "Name der Einbettung"
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::EMBEDDINGMETHODDIALOG::T1427271797"] = "Name der Einbettung"
|
||||||
|
|
||||||
@ -3120,21 +3141,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T504404155"] = "Akzeptieren Si
|
|||||||
-- Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking "Accept the GPL and download the archive," you agree to the terms of the GPL license. Software under GPL is free of charge and free to use.
|
-- Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking "Accept the GPL and download the archive," you agree to the terms of the GPL license. Software under GPL is free of charge and free to use.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T523908375"] = "Pandoc wird unter der GNU General Public License v2 (GPL) vertrieben. Wenn Sie auf „GPL akzeptieren und Archiv herunterladen“ klicken, stimmen Sie den Bedingungen der GPL-Lizenz zu. Software unter der GPL ist kostenlos und frei nutzbar."
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T523908375"] = "Pandoc wird unter der GNU General Public License v2 (GPL) vertrieben. Wenn Sie auf „GPL akzeptieren und Archiv herunterladen“ klicken, stimmen Sie den Bedingungen der GPL-Lizenz zu. Software unter der GPL ist kostenlos und frei nutzbar."
|
||||||
|
|
||||||
-- Test how Pandoc loads your document. See the raw content it produces before further processing.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T1481857352"] = "Testen Sie, wie Pandoc Ihr Dokument lädt, und überprüfen Sie ob der Inhalt korrekt geladen wird."
|
|
||||||
|
|
||||||
-- Content Loaded by Pandoc
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2147198279"] = "Von Pandoc geladener Inhalt"
|
|
||||||
|
|
||||||
-- This is the content Pandoc loaded from your document — including headings, lists, and formatting. Use this to verify your document loads as expected.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2156541074"] = "Das ist der Inhalt, den Pandoc aus Ihrem Dokument geladen hat – einschließlich Überschriften, Listen und Formatierung. Überprüfen Sie damit, ob Ihr Dokument wie erwartet geladen wird."
|
|
||||||
|
|
||||||
-- Load document
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2394358670"] = "Dokument laden"
|
|
||||||
|
|
||||||
-- Cancel
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T900713019"] = "Abbrechen"
|
|
||||||
|
|
||||||
-- Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally.
|
-- Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PROFILEDIALOG::T1458195391"] = "Teilen Sie der KI mit, was sie machen soll. Was sind ihre Ziele oder was möchten Sie erreichen? Zum Beispiel, dass die KI Sie duzt."
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PROFILEDIALOG::T1458195391"] = "Teilen Sie der KI mit, was sie machen soll. Was sind ihre Ziele oder was möchten Sie erreichen? Zum Beispiel, dass die KI Sie duzt."
|
||||||
|
|
||||||
@ -5877,6 +5883,15 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4174900468"] = "Von den Dat
|
|||||||
-- Sources provided by the AI
|
-- Sources provided by the AI
|
||||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4261248356"] = "Von der KI bereitgestellte Quellen"
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4261248356"] = "Von der KI bereitgestellte Quellen"
|
||||||
|
|
||||||
|
-- Pandoc Installation
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T185447014"] = "Pandoc-Installation"
|
||||||
|
|
||||||
|
-- Pandoc may be required for importing files.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T2596465560"] = "Für das Importieren von Dateien ist möglicherweise Pandoc erforderlich."
|
||||||
|
|
||||||
|
-- The file path is null or empty and the file therefore can not be loaded.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T932243993"] = "Der Dateipfad ist leer, daher kann die Datei nicht geladen werden."
|
||||||
|
|
||||||
-- The hostname is not a valid HTTP(S) URL.
|
-- The hostname is not a valid HTTP(S) URL.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::VALIDATION::DATASOURCEVALIDATION::T1013354736"] = "Der Hostname ist keine gültige HTTP(S)-URL."
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::VALIDATION::DATASOURCEVALIDATION::T1013354736"] = "Der Hostname ist keine gültige HTTP(S)-URL."
|
||||||
|
|
||||||
|
|||||||
@ -1485,11 +1485,11 @@ UI_TEXT_CONTENT["AISTUDIO::CHAT::CONTENTBLOCKCOMPONENT::T861873672"] = "Export C
|
|||||||
-- Open Settings
|
-- Open Settings
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ASSISTANTBLOCK::T1172211894"] = "Open Settings"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ASSISTANTBLOCK::T1172211894"] = "Open Settings"
|
||||||
|
|
||||||
-- Drag and drop files here or click to attach documents.
|
-- Drag and drop files into the marked area or click here to attach documents:
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T1647829151"] = "Drag and drop files here or click to attach documents."
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T230755331"] = "Drag and drop files into the marked area or click here to attach documents:"
|
||||||
|
|
||||||
-- Pandoc Load Document Preview
|
-- Document Preview
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2686523471"] = "Pandoc Load Document Preview"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T285154968"] = "Document Preview"
|
||||||
|
|
||||||
-- Videos are not supported yet
|
-- Videos are not supported yet
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2928927510"] = "Videos are not supported yet"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T2928927510"] = "Videos are not supported yet"
|
||||||
@ -1500,6 +1500,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T298062956"] = "Images a
|
|||||||
-- Clear file list
|
-- Clear file list
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T3759696136"] = "Clear file list"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T3759696136"] = "Clear file list"
|
||||||
|
|
||||||
|
-- Add file
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4014053962"] = "Add file"
|
||||||
|
|
||||||
-- Executables are not allowed
|
-- Executables are not allowed
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4167762413"] = "Executables are not allowed"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ATTACHDOCUMENTS::T4167762413"] = "Executables are not allowed"
|
||||||
|
|
||||||
@ -1803,12 +1806,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROFILESELECTION::T918741365"] = "You can
|
|||||||
-- Provider
|
-- Provider
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROVIDERSELECTION::T900237532"] = "Provider"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::PROVIDERSELECTION::T900237532"] = "Provider"
|
||||||
|
|
||||||
-- Pandoc Installation
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T185447014"] = "Pandoc Installation"
|
|
||||||
|
|
||||||
-- Pandoc may be required for importing files.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2596465560"] = "Pandoc may be required for importing files."
|
|
||||||
|
|
||||||
-- Videos are not supported yet
|
-- Videos are not supported yet
|
||||||
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2928927510"] = "Videos are not supported yet"
|
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READFILECONTENT::T2928927510"] = "Videos are not supported yet"
|
||||||
|
|
||||||
@ -2910,6 +2907,30 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T3688254408"]
|
|||||||
-- Your security policy
|
-- Your security policy
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T4081226330"] = "Your security policy"
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DATASOURCELOCALFILEINFODIALOG::T4081226330"] = "Your security policy"
|
||||||
|
|
||||||
|
-- Markdown View
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T1373123357"] = "Markdown View"
|
||||||
|
|
||||||
|
-- Load file
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T2129302565"] = "Load file"
|
||||||
|
|
||||||
|
-- See how we load your file. Review the content before we process it further.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3271853346"] = "See how we load your file. Review the content before we process it further."
|
||||||
|
|
||||||
|
-- Close
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3448155331"] = "Close"
|
||||||
|
|
||||||
|
-- Loaded Content
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T3529911749"] = "Loaded Content"
|
||||||
|
|
||||||
|
-- Simple View
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T428485200"] = "Simple View"
|
||||||
|
|
||||||
|
-- This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T652739927"] = "This is the content we loaded from your file — including headings, lists, and formatting. Use this to verify your file loads as expected."
|
||||||
|
|
||||||
|
-- File Path
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::DOCUMENTCHECKDIALOG::T729508546"] = "File Path"
|
||||||
|
|
||||||
-- Embedding Name
|
-- Embedding Name
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::EMBEDDINGMETHODDIALOG::T1427271797"] = "Embedding Name"
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::EMBEDDINGMETHODDIALOG::T1427271797"] = "Embedding Name"
|
||||||
|
|
||||||
@ -3120,21 +3141,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T504404155"] = "Accept the ter
|
|||||||
-- Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking "Accept the GPL and download the archive," you agree to the terms of the GPL license. Software under GPL is free of charge and free to use.
|
-- Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking "Accept the GPL and download the archive," you agree to the terms of the GPL license. Software under GPL is free of charge and free to use.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T523908375"] = "Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking \"Accept the GPL and download the archive,\" you agree to the terms of the GPL license. Software under GPL is free of charge and free to use."
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDIALOG::T523908375"] = "Pandoc is distributed under the GNU General Public License v2 (GPL). By clicking \"Accept the GPL and download the archive,\" you agree to the terms of the GPL license. Software under GPL is free of charge and free to use."
|
||||||
|
|
||||||
-- Test how Pandoc loads your document. See the raw content it produces before further processing.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T1481857352"] = "Test how Pandoc loads your document. See the raw content it produces before further processing."
|
|
||||||
|
|
||||||
-- Content Loaded by Pandoc
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2147198279"] = "Content Loaded by Pandoc"
|
|
||||||
|
|
||||||
-- This is the content Pandoc loaded from your document — including headings, lists, and formatting. Use this to verify your document loads as expected.
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2156541074"] = "This is the content Pandoc loaded from your document — including headings, lists, and formatting. Use this to verify your document loads as expected."
|
|
||||||
|
|
||||||
-- Load document
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T2394358670"] = "Load document"
|
|
||||||
|
|
||||||
-- Cancel
|
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PANDOCDOCUMENTCHECKDIALOG::T900713019"] = "Cancel"
|
|
||||||
|
|
||||||
-- Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally.
|
-- Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PROFILEDIALOG::T1458195391"] = "Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally."
|
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::PROFILEDIALOG::T1458195391"] = "Tell the AI what you want it to do for you. What are your goals or are you trying to achieve? Like having the AI address you informally."
|
||||||
|
|
||||||
@ -5877,6 +5883,15 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4174900468"] = "Sources pro
|
|||||||
-- Sources provided by the AI
|
-- Sources provided by the AI
|
||||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4261248356"] = "Sources provided by the AI"
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::SOURCEEXTENSIONS::T4261248356"] = "Sources provided by the AI"
|
||||||
|
|
||||||
|
-- Pandoc Installation
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T185447014"] = "Pandoc Installation"
|
||||||
|
|
||||||
|
-- Pandoc may be required for importing files.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T2596465560"] = "Pandoc may be required for importing files."
|
||||||
|
|
||||||
|
-- The file path is null or empty and the file therefore can not be loaded.
|
||||||
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::USERFILE::T932243993"] = "The file path is null or empty and the file therefore can not be loaded."
|
||||||
|
|
||||||
-- The hostname is not a valid HTTP(S) URL.
|
-- The hostname is not a valid HTTP(S) URL.
|
||||||
UI_TEXT_CONTENT["AISTUDIO::TOOLS::VALIDATION::DATASOURCEVALIDATION::T1013354736"] = "The hostname is not a valid HTTP(S) URL."
|
UI_TEXT_CONTENT["AISTUDIO::TOOLS::VALIDATION::DATASOURCEVALIDATION::T1013354736"] = "The hostname is not a valid HTTP(S) URL."
|
||||||
|
|
||||||
|
|||||||
51
app/MindWork AI Studio/Tools/UserFile.cs
Normal file
51
app/MindWork AI Studio/Tools/UserFile.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
using AIStudio.Dialogs;
|
||||||
|
using AIStudio.Tools.PluginSystem;
|
||||||
|
using AIStudio.Tools.Services;
|
||||||
|
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
||||||
|
|
||||||
|
namespace AIStudio.Tools;
|
||||||
|
|
||||||
|
public static class UserFile
|
||||||
|
{
|
||||||
|
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(UserFile).Namespace, nameof(UserFile));
|
||||||
|
|
||||||
|
private static readonly ILogger LOGGER = Program.LOGGER_FACTORY.CreateLogger(nameof(UserFile));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attempts to load the content of a file at the specified path, ensuring Pandoc is installed and available before proceeding.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filePath">The full path to the file to be read. Must not be null or empty.</param>
|
||||||
|
/// <param name="rustService">Rustservice used to read file content.</param>
|
||||||
|
/// <param name="dialogService">Dialogservice used to display the Pandoc installation dialog if needed.</param>
|
||||||
|
public static async Task<string> LoadFileData(string filePath, RustService rustService, IDialogService dialogService)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(filePath))
|
||||||
|
{
|
||||||
|
LOGGER.LogError("Can't load from an empty or null file path.");
|
||||||
|
await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.Cancel, TB("The file path is null or empty and the file therefore can not be loaded.")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure that Pandoc is installed and ready:
|
||||||
|
var pandocState = await Pandoc.CheckAvailabilityAsync(rustService, showSuccessMessage: false);
|
||||||
|
if (!pandocState.IsAvailable)
|
||||||
|
{
|
||||||
|
var dialogParameters = new DialogParameters<PandocDialog>
|
||||||
|
{
|
||||||
|
{ x => x.ShowInitialResultInSnackbar, false },
|
||||||
|
};
|
||||||
|
|
||||||
|
var dialogReference = await dialogService.ShowAsync<PandocDialog>(TB("Pandoc Installation"), dialogParameters, DialogOptions.FULLSCREEN);
|
||||||
|
await dialogReference.Result;
|
||||||
|
|
||||||
|
pandocState = await Pandoc.CheckAvailabilityAsync(rustService, showSuccessMessage: true);
|
||||||
|
if (!pandocState.IsAvailable)
|
||||||
|
{
|
||||||
|
LOGGER.LogError("Pandoc is not available after installation attempt.");
|
||||||
|
await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.Cancel, TB("Pandoc may be required for importing files.")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileContent = await rustService.ReadArbitraryFileData(filePath, int.MaxValue);
|
||||||
|
return fileContent;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
# v0.9.55, build 230 (2025-12-xx xx:xx UTC)
|
# v0.9.55, build 230 (2025-12-xx xx:xx UTC)
|
||||||
- Added support for newer Mistral models (Mistral 3, Voxtral, and Magistral).
|
- Added support for newer Mistral models (Mistral 3, Voxtral, and Magistral).
|
||||||
|
- Improved the document preview dialog for the document analysis assistant (in preview), providing Markdown and plain text views for attached files.
|
||||||
- Improved the ID handling for configuration plugins.
|
- Improved the ID handling for configuration plugins.
|
||||||
Loading…
Reference in New Issue
Block a user