mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-16 00:21:36 +00:00
Ensure Pandoc availability check before processing files
This commit is contained in:
parent
8b0f5dfbf8
commit
34dd75bb40
@ -155,6 +155,12 @@ public sealed class ContentText : IContent
|
||||
sb.AppendLine(this.Text);
|
||||
|
||||
if(this.FileAttachments.Count > 0)
|
||||
{
|
||||
// Check Pandoc availability once before processing file attachments
|
||||
var pandocState = await Pandoc.CheckAvailabilityAsync(Program.RUST_SERVICE, showMessages: true, showSuccessMessage: false);
|
||||
if (!pandocState.IsAvailable || !pandocState.CheckWasSuccessful)
|
||||
LOGGER.LogWarning("File attachments could not be processed because Pandoc is not available or the version check failed.");
|
||||
else
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("The following files are attached to this message:");
|
||||
@ -169,6 +175,7 @@ public sealed class ContentText : IContent
|
||||
sb.AppendLine("````");
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user