Unreal OpenAI API 1.0.0
AudioTranslationAction.h
1// OpenAI, Copyright LifeEXE. All Rights Reserved.
2
3#pragma once
4
5#include "Kismet/BlueprintAsyncActionBase.h"
6#include "Provider/Types/AudioTypes.h"
7#include "Provider/Types/CommonTypes.h"
8#include "AudioTranslationAction.generated.h"
9
10DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnAudioTranslation, const FAudioTranslationResponse&, Response,
11 const FOpenAIResponseMetadata&, ResponseMetadata, const FOpenAIError&, RawError);
12
13class UOpenAIProvider;
14
15UCLASS()
16class UAudioTranslationAction : public UBlueprintAsyncActionBase
17{
18 GENERATED_BODY()
19
20public:
21 UPROPERTY(BlueprintAssignable)
22 FOnAudioTranslation OnCompleted;
23
24 virtual void Activate() override;
25
26private:
31 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true"), Category = "OpenAI | Audio")
33 const FAudioTranslation& AudioTranslation, const FOpenAIAuth& Auth, const FString& URLOverride);
34
35 void TryToOverrideURL();
36
37 void OnCreateAudioTranslationCompleted(const FAudioTranslationResponse& Response, const FOpenAIResponseMetadata& ResponseMetadata);
38 void OnRequestError(const FString& URL, const FString& Content);
39
40private:
41 UPROPERTY()
42 TObjectPtr<UOpenAIProvider> Provider;
43
44 FAudioTranslation AudioTranslation;
45 FOpenAIAuth Auth;
46 FString URLOverride{};
47};
Definition: AudioTranslationAction.h:17
Definition: OpenAIProvider.h:45
void CreateAudioTranslation(const FAudioTranslation &AudioTranslation, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:196
Definition: AudioTypes.h:127
Definition: AudioTypes.h:316
Definition: CommonTypes.h:11
Definition: CommonTypes.h:28
Definition: CommonTypes.h:49