mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-11 17:32:11 +00:00
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>
59 lines
2.0 KiB
C#
59 lines
2.0 KiB
C#
namespace AIStudio.Assistants.BatchProcessing;
|
|
|
|
/// <summary>
|
|
/// The result of processing one file within a batch run.
|
|
/// </summary>
|
|
public sealed class BatchProcessingFileResult
|
|
{
|
|
/// <summary>
|
|
/// The absolute path of the processed file.
|
|
/// </summary>
|
|
public required string FilePath { get; init; }
|
|
|
|
/// <summary>
|
|
/// The file name of the processed file.
|
|
/// </summary>
|
|
public required string FileName { get; init; }
|
|
|
|
/// <summary>
|
|
/// The path of the file relative to the input folder. For files directly
|
|
/// inside the input folder, this is the file name.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This is the identity of the document within a batch run: it is written
|
|
/// to the log and is used to recognize the document when a previous run is
|
|
/// continued. The file name alone would not be sufficient, because two
|
|
/// subfolders may contain a document of the same name.
|
|
/// </remarks>
|
|
public required string RelativePath { get; init; }
|
|
|
|
/// <summary>
|
|
/// The processing state of the file.
|
|
/// </summary>
|
|
public BatchProcessingFileStatus Status { get; set; } = BatchProcessingFileStatus.QUEUED;
|
|
|
|
/// <summary>
|
|
/// An optional message, e.g., the error message when the processing failed.
|
|
/// </summary>
|
|
public string Message { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The AI answer for this file.
|
|
/// </summary>
|
|
public string ResultText { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The model which produced the answer for this file.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// We store the model per file instead of reading the currently selected
|
|
/// model when writing the results table. Otherwise, changing the model
|
|
/// between two batch runs would relabel the rows of the previous run.
|
|
/// </remarks>
|
|
public string ModelName { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The time when the processing of this file finished.
|
|
/// </summary>
|
|
public DateTimeOffset ProcessedAt { get; set; }
|
|
} |