mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 10:57:59 +00:00
Added assistant plugins (#659)
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,updater, dmg) (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, nsis) (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, appimage,deb) (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, dmg) (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, nsis) (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, appimage,deb) (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
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,updater, dmg) (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, nsis) (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, appimage,deb) (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, dmg) (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, nsis) (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, appimage,deb) (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
This commit is contained in:
1 parent
a573409a24
commit
f6a128f2e4
100 files changed
+10146
-85
No files matched your search
@@ -0,0 +1,70 @@
|
||||
using AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||||
using AIStudio.Tools.PluginSystem.Assistants.DataModel.Layout;
|
||||
|
||||
namespace AIStudio.Tools.PluginSystem.Assistants;
|
||||
|
||||
public class AssistantComponentFactory
|
||||
{
|
||||
private static readonly ILogger<AssistantComponentFactory> LOGGER = Program.LOGGER_FACTORY.CreateLogger<AssistantComponentFactory>();
|
||||
|
||||
public static IAssistantComponent CreateComponent(
|
||||
AssistantComponentType type,
|
||||
Dictionary<string, object> props,
|
||||
List<IAssistantComponent> children)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case AssistantComponentType.FORM:
|
||||
return new AssistantForm { Props = props, Children = children };
|
||||
case AssistantComponentType.TEXT_AREA:
|
||||
return new AssistantTextArea { Props = props, Children = children };
|
||||
case AssistantComponentType.BUTTON:
|
||||
return new AssistantButton { Props = props, Children = children};
|
||||
case AssistantComponentType.BUTTON_GROUP:
|
||||
return new AssistantButtonGroup { Props = props, Children = children };
|
||||
case AssistantComponentType.DROPDOWN:
|
||||
return new AssistantDropdown { Props = props, Children = children };
|
||||
case AssistantComponentType.PROVIDER_SELECTION:
|
||||
return new AssistantProviderSelection { Props = props, Children = children };
|
||||
case AssistantComponentType.PROFILE_SELECTION:
|
||||
return new AssistantProfileSelection { Props = props, Children = children };
|
||||
case AssistantComponentType.SWITCH:
|
||||
return new AssistantSwitch { Props = props, Children = children };
|
||||
case AssistantComponentType.HEADING:
|
||||
return new AssistantHeading { Props = props, Children = children };
|
||||
case AssistantComponentType.TEXT:
|
||||
return new AssistantText { Props = props, Children = children };
|
||||
case AssistantComponentType.LIST:
|
||||
return new AssistantList { Props = props, Children = children };
|
||||
case AssistantComponentType.WEB_CONTENT_READER:
|
||||
return new AssistantWebContentReader { Props = props, Children = children };
|
||||
case AssistantComponentType.FILE_CONTENT_READER:
|
||||
return new AssistantFileContentReader { Props = props, Children = children };
|
||||
case AssistantComponentType.IMAGE:
|
||||
return new AssistantImage { Props = props, Children = children };
|
||||
case AssistantComponentType.COLOR_PICKER:
|
||||
return new AssistantColorPicker { Props = props, Children = children };
|
||||
case AssistantComponentType.DATE_PICKER:
|
||||
return new AssistantDatePicker { Props = props, Children = children };
|
||||
case AssistantComponentType.DATE_RANGE_PICKER:
|
||||
return new AssistantDateRangePicker { Props = props, Children = children };
|
||||
case AssistantComponentType.TIME_PICKER:
|
||||
return new AssistantTimePicker { Props = props, Children = children };
|
||||
case AssistantComponentType.LAYOUT_ITEM:
|
||||
return new AssistantItem { Props = props, Children = children };
|
||||
case AssistantComponentType.LAYOUT_GRID:
|
||||
return new AssistantGrid { Props = props, Children = children };
|
||||
case AssistantComponentType.LAYOUT_PAPER:
|
||||
return new AssistantPaper { Props = props, Children = children };
|
||||
case AssistantComponentType.LAYOUT_STACK:
|
||||
return new AssistantStack { Props = props, Children = children };
|
||||
case AssistantComponentType.LAYOUT_ACCORDION:
|
||||
return new AssistantAccordion { Props = props, Children = children };
|
||||
case AssistantComponentType.LAYOUT_ACCORDION_SECTION:
|
||||
return new AssistantAccordionSection { Props = props, Children = children };
|
||||
default:
|
||||
LOGGER.LogError($"Unknown assistant component type!\n{type} is not a supported assistant component type");
|
||||
throw new Exception($"Unknown assistant component type: {type}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user