5#include "CoreMinimal.h"
6#include "EditorUtilityWidget.h"
7#include "UI/ChatMessageWidget.h"
8#include "Provider/Types/ModelTypes.h"
9#include "Provider/Types/CommonTypes.h"
10#include "ChatGPT/BaseService.h"
11#include "ChatGPTWidget.generated.h"
32 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category =
"OpenAI")
33 int32 MaxTokens{2000};
36 UPROPERTY(meta = (BindWidget))
37 TObjectPtr<UVerticalBox> StartVerticalBox;
39 UPROPERTY(meta = (BindWidget))
40 TObjectPtr<UComboBoxString> ChatGPTModelComboBox;
42 UPROPERTY(meta = (BindWidget))
43 TObjectPtr<UVerticalBox> MessagesVerticalBox;
45 UPROPERTY(meta = (BindWidget))
46 TObjectPtr<UScrollBox> ChatScrollBox;
48 UPROPERTY(meta = (BindWidget), BlueprintReadWrite, Category =
"OpenAI")
49 TObjectPtr<UEditableText> UserInputTextBox;
51 UPROPERTY(meta = (BindWidget))
52 TObjectPtr<UButton> SendMessageButton;
54 UPROPERTY(meta = (BindWidget))
55 TObjectPtr<UButton> DumpChatButton;
57 UPROPERTY(meta = (BindWidget))
58 TObjectPtr<UButton> ClearChatButton;
60 UPROPERTY(meta = (BindWidget))
61 TObjectPtr<UButton> AttachImageButton;
63 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category =
"UI")
64 TSubclassOf<UChatMessageWidget> ChatMessageWidgetClass;
66 UPROPERTY(meta = (BindWidget))
67 TObjectPtr<UGridPanel> ServiceContainer;
69 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category =
"UI")
70 TSubclassOf<UServiceWidget> ServiceWidgetClass;
72 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category =
"OpenAI")
73 TArray<TSubclassOf<UBaseService>> Services;
75 UPROPERTY(meta = (BindWidget))
76 TObjectPtr<UTextBlock> ServicesWarningTextBlock;
78 UPROPERTY(meta = (BindWidget))
79 TObjectPtr<UAttachedFilesContainerWidget> AttachedFilesContainer;
81 virtual void NativeConstruct()
override;
85 TObjectPtr<UChatGPT> ChatGPT;
88 TArray<TObjectPtr<UChatMessageWidget>> ChatWidgets;
91 TObjectPtr<USaveSettings> SaveSettings;
94 TArray<TObjectPtr<UServiceWidget>> ServiceWidgets;
107 void OnTextCommitted(
const FText& Text, ETextCommit::Type CommitMethod);
110 void OnTextChanged(
const FText& Text);
113 void OnModelSelectionChanged(FString SelectedItem, ESelectInfo::Type SelectionType);
116 void OnImageSelected();
119 void InitModelsComboBox();
121 void OnRequestCompleted();
122 void OnRequestUpdated(
const FMessage& Message,
bool WasError);
124 void CreateMessageWidget(
const FMessage& Message);
125 void EnableControls(
bool Enabled);
127 FString GenerateFilePath()
const;
129 void UpdateVisionElements();
130 void UpdateSendMessageButton();
131 void OnFileRemoved();
134 OpenAI::ServiceSecrets ServiceSecrets;
136 void CreateServiceWidgets();
137 void OnServiceEnabled(
bool IsEnabled,
const TSubclassOf<UBaseService>& ServiceClass,
const TObjectPtr<UServiceWidget>& ServiceWidget);
Definition: SaveSettings.h:13
Definition: ChatCommonTypes.h:75