Unreal OpenAI API
1.0.0
Loading...
Searching...
No Matches
Source
OpenAI
Public
BlueprintAsyncActions
OpenAIActionBase.h
1
// OpenAI, Copyright LifeEXE. All Rights Reserved.
2
3
#pragma once
4
5
#include "Kismet/BlueprintAsyncActionBase.h"
6
#include "Provider/OpenAIProvider.h"
7
#include "API/API.h"
8
#include "OpenAIActionBase.generated.h"
9
10
UCLASS(Abstract)
11
class OPENAI_API
UOpenAIActionBase
: public UBlueprintAsyncActionBase
12
{
13
GENERATED_BODY()
14
15
protected
:
16
FOpenAIAuth
Auth;
17
FString URLOverride;
18
19
// Creates provider, stores it in ActiveProvider (preventing GC), binds OnRequestError, applies URL override.
20
UOpenAIProvider
* CreateProvider();
21
22
private
:
23
UPROPERTY()
24
TObjectPtr<UOpenAIProvider> ActiveProvider;
25
26
// Override to set the action-specific endpoint field.
27
virtual
void
SetEndpoint(
OpenAI::V1::FOpenAIEndpoints
& Endpoints,
const
FString& URL)
const
{}
28
29
// Override to broadcast to the action's specific delegate on error.
30
virtual
void
OnRequestError(
const
FString& URL,
const
FString& Content) {}
31
};
UOpenAIActionBase
Definition
OpenAIActionBase.h:12
UOpenAIProvider
Definition
OpenAIProvider.h:49
FOpenAIAuth
Definition
OpenAICommonTypes.h:11
OpenAI::V1::FOpenAIEndpoints
Definition
API.h:127