change for UE 5.7
This commit is contained in:
@@ -685,15 +685,18 @@ void UPS_AI_ConvAgent_WebSocket_ElevenLabsProxy::HandleClientToolCall(const TSha
|
||||
{
|
||||
for (const auto& Pair : (*ParamsObj)->Values)
|
||||
{
|
||||
// UE 5.8 changed FJsonObject::Values from TMap<FString,...> to TMap<FSharedString,...>.
|
||||
// FSharedString has no implicit FString conversion; deref (*) yields const TCHAR*.
|
||||
FString Key(*Pair.Key);
|
||||
FString Value;
|
||||
if (Pair.Value->TryGetString(Value))
|
||||
{
|
||||
ToolCall.Parameters.Add(Pair.Key, Value);
|
||||
ToolCall.Parameters.Add(Key, Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// For non-string values, serialize to string
|
||||
ToolCall.Parameters.Add(Pair.Key, Pair.Value->AsString());
|
||||
ToolCall.Parameters.Add(Key, Pair.Value->AsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,8 +560,10 @@ void FPS_AI_ConvAgent_ToolCustomization_ElevenLabs::OnFetchToolClicked()
|
||||
if (!Pair.Value->TryGetObject(PropObj)) continue;
|
||||
|
||||
FPS_AI_ConvAgent_ToolParameter_ElevenLabs Param;
|
||||
Param.Name = Pair.Key;
|
||||
Param.bRequired = RequiredSet.Contains(Pair.Key);
|
||||
// UE 5.8: FJsonObject::Values key is now FSharedString, convert explicitly.
|
||||
FString KeyStr(*Pair.Key);
|
||||
Param.Name = KeyStr;
|
||||
Param.bRequired = RequiredSet.Contains(KeyStr);
|
||||
|
||||
// Try ElevenLabs format: type-as-key
|
||||
static const TArray<TPair<FString, EPS_AI_ConvAgent_ToolParamType>> TypeKeys = {
|
||||
|
||||
Reference in New Issue
Block a user