mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 14:47:21 +00:00
Added PowerPoint templates to the Slide Assistant (#1055)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
8c5cfa78b6
commit
6eb23ebbcb
136 files changed
+16535
-522
No files matched your search
@@ -436,6 +436,20 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.Chat, x => x.PreselectedDataSourcesRetrievalMode, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.Chat, x => x.SendToChatDataSourceBehavior, this.Id, settingsTable, dryRun);
|
||||
|
||||
// Config: Slide Assistant template and defaults?
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.SlideBuilder, x => x.PreselectOptions, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.SlideBuilder, x => x.TemplatePath, this.Id, settingsTable, dryRun, convert: this.ResolvePluginFile);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.SlideBuilder, x => x.PreselectedFooterText, this.Id, settingsTable, dryRun);
|
||||
|
||||
var maxBulletPointsIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.SlideBuilder, x => x.PreselectedMaxBulletPointsPerSlide, this.Id, settingsTable, dryRun, validator: DataSlideBuilder.IsValidMaxBulletPointsPerSlide);
|
||||
if (!maxBulletPointsIsValid && settingsTable.TryGetValue("DataSlideBuilder.PreselectedMaxBulletPointsPerSlide", out _))
|
||||
LOG.LogWarning("The maximum number of bullet points per slide configured by plugin {ConfigPluginId} must be between 0 and {MaxBulletPoints}.", this.Id, DataSlideBuilder.MAX_BULLET_POINTS_PER_SLIDE);
|
||||
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.SlideBuilder, x => x.PreselectedKeepEmptyPicturePlaceholders, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.SlideBuilder, x => x.PreselectedPictureLibraryPath, this.Id, settingsTable, dryRun, convert: this.ResolvePluginDirectory);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.SlideBuilder, x => x.PreselectedLayouts, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.SlideBuilder, x => x.PreselectedTemplateSlideUses, this.Id, settingsTable, dryRun);
|
||||
|
||||
// Config: Batch Processing Assistant defaults?
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.PreselectOptions, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.InputDirectory, this.Id, settingsTable, dryRun);
|
||||
@@ -497,6 +511,34 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resolves a file this plugin names in a setting: a relative path against the plugin directory,
|
||||
/// so the plugin can ship the file itself.
|
||||
/// </summary>
|
||||
/// <returns>The full path, or null when the file cannot be used, which leaves the setting untouched.</returns>
|
||||
private string? ResolvePluginFile(string path)
|
||||
{
|
||||
if (PluginFilePath.TryResolve(path, this.PluginPath, out var resolvedPath, out var issue))
|
||||
return resolvedPath;
|
||||
|
||||
LOG.LogWarning($"The configuration plugin '{this.Name}' names the file '{path}', which cannot be used: {issue}");
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resolves a folder this plugin names in a setting: a relative path against the plugin directory,
|
||||
/// so the plugin can ship the folder itself.
|
||||
/// </summary>
|
||||
/// <returns>The full path, or null when the folder cannot be used, which leaves the setting untouched.</returns>
|
||||
private string? ResolvePluginDirectory(string path)
|
||||
{
|
||||
if (PluginFilePath.TryResolveDirectory(path, this.PluginPath, out var resolvedPath, out var issue))
|
||||
return resolvedPath;
|
||||
|
||||
LOG.LogWarning($"The configuration plugin '{this.Name}' names the folder '{path}', which cannot be used: {issue}");
|
||||
return null;
|
||||
}
|
||||
|
||||
private static bool TryValidateMinimumProviderConfidenceConfiguration(LuaTable settingsTable, out string message)
|
||||
{
|
||||
const string SETTING_NAME = "DataTools.MinimumProviderConfidenceByToolId";
|
||||
|
||||
Reference in new issue
Block a user