diff --git a/Source/HttpGPTCommonModule/Private/Tasks/HttpGPTBaseTask.cpp b/Source/HttpGPTCommonModule/Private/Tasks/HttpGPTBaseTask.cpp index bcb0444..9e56ea0 100644 --- a/Source/HttpGPTCommonModule/Private/Tasks/HttpGPTBaseTask.cpp +++ b/Source/HttpGPTCommonModule/Private/Tasks/HttpGPTBaseTask.cpp @@ -189,12 +189,15 @@ void UHttpGPTBaseTask::BindRequestCallbacks() { FScopeTryLock Lock(&Mutex); - if (!Lock.IsLocked() || !IsValid(this) || !bIsTaskActive) + if (!Lock.IsLocked() || !IsValid(this) || !bIsTaskActive || !Request.IsValid()) { return; } - OnProgressUpdated(Request->GetResponse()->GetContentAsString(), BytesSent, BytesReceived); + if (const FHttpResponsePtr Response = Request->GetResponse(); Response.IsValid()) + { + OnProgressUpdated(Response->GetContentAsString(), BytesSent, BytesReceived); + } } ); } diff --git a/Source/HttpGPTCommonModule/Public/Structures/HttpGPTChatTypes.h b/Source/HttpGPTCommonModule/Public/Structures/HttpGPTChatTypes.h index 115c89d..a2b30a1 100644 --- a/Source/HttpGPTCommonModule/Public/Structures/HttpGPTChatTypes.h +++ b/Source/HttpGPTCommonModule/Public/Structures/HttpGPTChatTypes.h @@ -104,13 +104,13 @@ struct HTTPGPTCOMMONMODULE_API FHttpGPTChatResponse UENUM(BlueprintType, Category = "HttpGPT | Chat", Meta = (DisplayName = "HttpGPT Chat Model")) enum class EHttpGPTChatModel : uint8 { - gpt4 UMETA(DisplayName = "gpt-4"), - gpt432k UMETA(DisplayName = "gpt-4-32k"), - gpt35turbo UMETA(DisplayName = "gpt-3.5-turbo"), + gpt4 UMETA(DisplayName = "gpt-4"), + gpt432k UMETA(DisplayName = "gpt-4-32k"), + gpt35turbo UMETA(DisplayName = "gpt-3.5-turbo"), gpt35turbo16k UMETA(DisplayName = "gpt-3.5-turbo-16k"), - textdavinci003 UMETA(DisplayName = "text-davinci-003"), - textdavinci002 UMETA(DisplayName = "text-davinci-002"), - codedavinci002 UMETA(DisplayName = "code-davinci-002"), + textdavinci003 UMETA(DisplayName = "text-davinci-003"), + textdavinci002 UMETA(DisplayName = "text-davinci-002"), + codedavinci002 UMETA(DisplayName = "code-davinci-002"), }; USTRUCT(BlueprintType, Category = "HttpGPT | Chat", Meta = (DisplayName = "HttpGPT Chat Options"))