@attribute [Route(Routes.ASSISTANT_DYNAMIC)] @using AIStudio.Components @using AIStudio.Settings @using AIStudio.Tools.PluginSystem.Assistants.DataModel @inherits AssistantBaseCore @foreach (var component in this.RootComponent!.Children) { @switch (component.Type) { case AssistantComponentType.TEXT_AREA: if (component is AssistantTextArea textArea) { var lines = textArea.IsSingleLine ? 1 : 6; } break; case AssistantComponentType.IMAGE: if (component is AssistantImage assistantImage) { var resolvedSource = this.ResolveImageSource(assistantImage); if (!string.IsNullOrWhiteSpace(resolvedSource)) { var image = assistantImage;
@if (!string.IsNullOrWhiteSpace(image.Caption)) { @image.Caption }
} } break; case AssistantComponentType.WEB_CONTENT_READER: if (component is AssistantWebContentReader webContent && this.webContentFields.TryGetValue(webContent.Name, out var webState)) {
} break; case AssistantComponentType.FILE_CONTENT_READER: if (component is AssistantFileContentReader fileContent && this.fileContentFields.TryGetValue(fileContent.Name, out var fileState)) {
} break; case AssistantComponentType.DROPDOWN: if (component is AssistantDropdown assistantDropdown) { } break; case AssistantComponentType.PROVIDER_SELECTION: if (component is AssistantProviderSelection providerSelection) {
} break; case AssistantComponentType.PROFILE_SELECTION: if (component is AssistantProfileSelection profileSelection) { var selection = profileSelection;
} break; case AssistantComponentType.SWITCH: if (component is AssistantSwitch assistantSwitch) { } break; case AssistantComponentType.HEADING: if (component is AssistantHeading assistantHeading) { var heading = assistantHeading; @switch (assistantHeading.Level) { case 1: @heading.Text break; case 2: @heading.Text break; case 3: @heading.Text break; default: @heading.Text break; } } break; case AssistantComponentType.TEXT: if (component is AssistantText assistantText) { var text = assistantText; @text.Content } break; case AssistantComponentType.LIST: if (component is AssistantList assistantList) { var list = assistantList; @foreach (var item in list.Items) { @if (item.Type == "LINK") { @item.Text } else { @item.Text } } } break; case AssistantComponentType.COLOR_PICKER: if (component is AssistantColorPicker assistantColorPicker) { var colorPicker = assistantColorPicker; var variant = this.GetPickerVariant(colorPicker.PickerVariant); var elevation = variant == PickerVariant.Static ? 6 : 0; var rounded = variant == PickerVariant.Static; } break; } }