|
1 | 1 | using System.Text;
|
2 | 2 |
|
| 3 | +using AIStudio.Chat; |
3 | 4 | using AIStudio.Tools;
|
4 | 5 |
|
5 | 6 | namespace AIStudio.Components.Pages.Agenda;
|
@@ -97,9 +98,73 @@ the logistical challenges that come with an increasing number of participants.
|
97 | 98 | [
|
98 | 99 | new SendToButton
|
99 | 100 | {
|
100 |
| - Self = SendToAssistant.AGENDA_ASSISTANT, |
| 101 | + Self = SendTo.AGENDA_ASSISTANT, |
101 | 102 | },
|
102 | 103 | ];
|
| 104 | + |
| 105 | + protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with |
| 106 | + { |
| 107 | + SystemPrompt = SystemPrompts.DEFAULT, |
| 108 | + }; |
| 109 | + |
| 110 | + protected override void ResetFrom() |
| 111 | + { |
| 112 | + this.inputContent = string.Empty; |
| 113 | + this.contentLines.Clear(); |
| 114 | + this.selectedFoci = []; |
| 115 | + this.justBriefly = []; |
| 116 | + this.inputWhoIsPresenting = string.Empty; |
| 117 | + if (!this.MightPreselectValues()) |
| 118 | + { |
| 119 | + this.inputTopic = string.Empty; |
| 120 | + this.inputName = string.Empty; |
| 121 | + this.inputDuration = string.Empty; |
| 122 | + this.inputStartTime = string.Empty; |
| 123 | + this.inputObjective = string.Empty; |
| 124 | + this.inputModerator = string.Empty; |
| 125 | + this.selectedTargetLanguage = CommonLanguages.AS_IS; |
| 126 | + this.customTargetLanguage = string.Empty; |
| 127 | + this.introduceParticipants = false; |
| 128 | + this.isMeetingVirtual = true; |
| 129 | + this.inputLocation = string.Empty; |
| 130 | + this.goingToDinner = false; |
| 131 | + this.doingSocialActivity = false; |
| 132 | + this.needToArriveAndDepart = false; |
| 133 | + this.durationLunchBreak = 0; |
| 134 | + this.durationBreaks = 0; |
| 135 | + this.activeParticipation = false; |
| 136 | + this.numberParticipants = NumberParticipants.NOT_SPECIFIED; |
| 137 | + } |
| 138 | + } |
| 139 | + |
| 140 | + protected override bool MightPreselectValues() |
| 141 | + { |
| 142 | + if (this.SettingsManager.ConfigurationData.Agenda.PreselectOptions) |
| 143 | + { |
| 144 | + this.inputTopic = this.SettingsManager.ConfigurationData.Agenda.PreselectTopic; |
| 145 | + this.inputName = this.SettingsManager.ConfigurationData.Agenda.PreselectName; |
| 146 | + this.inputDuration = this.SettingsManager.ConfigurationData.Agenda.PreselectDuration; |
| 147 | + this.inputStartTime = this.SettingsManager.ConfigurationData.Agenda.PreselectStartTime; |
| 148 | + this.inputObjective = this.SettingsManager.ConfigurationData.Agenda.PreselectObjective; |
| 149 | + this.inputModerator = this.SettingsManager.ConfigurationData.Agenda.PreselectModerator; |
| 150 | + this.selectedTargetLanguage = this.SettingsManager.ConfigurationData.Agenda.PreselectedTargetLanguage; |
| 151 | + this.customTargetLanguage = this.SettingsManager.ConfigurationData.Agenda.PreselectedOtherLanguage; |
| 152 | + this.introduceParticipants = this.SettingsManager.ConfigurationData.Agenda.PreselectIntroduceParticipants; |
| 153 | + this.isMeetingVirtual = this.SettingsManager.ConfigurationData.Agenda.PreselectIsMeetingVirtual; |
| 154 | + this.inputLocation = this.SettingsManager.ConfigurationData.Agenda.PreselectLocation; |
| 155 | + this.goingToDinner = this.SettingsManager.ConfigurationData.Agenda.PreselectJointDinner; |
| 156 | + this.doingSocialActivity = this.SettingsManager.ConfigurationData.Agenda.PreselectSocialActivity; |
| 157 | + this.needToArriveAndDepart = this.SettingsManager.ConfigurationData.Agenda.PreselectArriveAndDepart; |
| 158 | + this.durationLunchBreak = this.SettingsManager.ConfigurationData.Agenda.PreselectLunchTime; |
| 159 | + this.durationBreaks = this.SettingsManager.ConfigurationData.Agenda.PreselectBreakTime; |
| 160 | + this.activeParticipation = this.SettingsManager.ConfigurationData.Agenda.PreselectActiveParticipation; |
| 161 | + this.numberParticipants = this.SettingsManager.ConfigurationData.Agenda.PreselectNumberParticipants; |
| 162 | + this.providerSettings = this.SettingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == this.SettingsManager.ConfigurationData.Agenda.PreselectedProvider); |
| 163 | + return true; |
| 164 | + } |
| 165 | + |
| 166 | + return false; |
| 167 | + } |
103 | 168 |
|
104 | 169 | private string inputTopic = string.Empty;
|
105 | 170 | private string inputName = string.Empty;
|
@@ -130,29 +195,7 @@ the logistical challenges that come with an increasing number of participants.
|
130 | 195 |
|
131 | 196 | protected override async Task OnInitializedAsync()
|
132 | 197 | {
|
133 |
| - if (this.SettingsManager.ConfigurationData.Agenda.PreselectOptions) |
134 |
| - { |
135 |
| - this.inputTopic = this.SettingsManager.ConfigurationData.Agenda.PreselectTopic; |
136 |
| - this.inputName = this.SettingsManager.ConfigurationData.Agenda.PreselectName; |
137 |
| - this.inputDuration = this.SettingsManager.ConfigurationData.Agenda.PreselectDuration; |
138 |
| - this.inputStartTime = this.SettingsManager.ConfigurationData.Agenda.PreselectStartTime; |
139 |
| - this.inputObjective = this.SettingsManager.ConfigurationData.Agenda.PreselectObjective; |
140 |
| - this.inputModerator = this.SettingsManager.ConfigurationData.Agenda.PreselectModerator; |
141 |
| - this.selectedTargetLanguage = this.SettingsManager.ConfigurationData.Agenda.PreselectedTargetLanguage; |
142 |
| - this.customTargetLanguage = this.SettingsManager.ConfigurationData.Agenda.PreselectedOtherLanguage; |
143 |
| - this.introduceParticipants = this.SettingsManager.ConfigurationData.Agenda.PreselectIntroduceParticipants; |
144 |
| - this.isMeetingVirtual = this.SettingsManager.ConfigurationData.Agenda.PreselectIsMeetingVirtual; |
145 |
| - this.inputLocation = this.SettingsManager.ConfigurationData.Agenda.PreselectLocation; |
146 |
| - this.goingToDinner = this.SettingsManager.ConfigurationData.Agenda.PreselectJointDinner; |
147 |
| - this.doingSocialActivity = this.SettingsManager.ConfigurationData.Agenda.PreselectSocialActivity; |
148 |
| - this.needToArriveAndDepart = this.SettingsManager.ConfigurationData.Agenda.PreselectArriveAndDepart; |
149 |
| - this.durationLunchBreak = this.SettingsManager.ConfigurationData.Agenda.PreselectLunchTime; |
150 |
| - this.durationBreaks = this.SettingsManager.ConfigurationData.Agenda.PreselectBreakTime; |
151 |
| - this.activeParticipation = this.SettingsManager.ConfigurationData.Agenda.PreselectActiveParticipation; |
152 |
| - this.numberParticipants = this.SettingsManager.ConfigurationData.Agenda.PreselectNumberParticipants; |
153 |
| - this.providerSettings = this.SettingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == this.SettingsManager.ConfigurationData.Agenda.PreselectedProvider); |
154 |
| - } |
155 |
| - |
| 198 | + this.MightPreselectValues(); |
156 | 199 | var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages<string>(Event.SEND_TO_AGENDA_ASSISTANT).FirstOrDefault();
|
157 | 200 | if (deferredContent is not null)
|
158 | 201 | this.inputContent = deferredContent;
|
|
0 commit comments