/**
 * Copyright 2022-2025 Theai, Inc. dba Inworld AI
 */

#pragma once

#include "CoreMinimal.h"
#include "Graph/InworldNode.h"

#include "InworldNode_TextAggregator.generated.h"

/**
 * @class UInworldNode_TextAggregator
 * @brief A node that aggregates a text stream into a single text
 * output.
 *
 * This node takes a stream of text inputs and converts that into a single text output.
 *
 * @input FInworldData_DataStream_String
 * @output FInworldData_Text
 */
UCLASS()
class INWORLDRUNTIME_API UInworldNode_TextAggregator : public UInworldNode
{
	GENERATED_BODY()

public:
	/**
	 * @brief Default constructor for the text aggregator node.
	 */
	UInworldNode_TextAggregator();

private:
	/**
	 * @brief Retrieves JSON configuration for the text aggregator node.
	 *
	 * This override implementation generates the JSON configuration needed
	 * for the text aggregator node processing operations.
	 *
	 * @param GraphJson The JSON object to populate with configuration data
	 * @return Error code indicating success or failure of configuration generation
	 */
	virtual EInworldRuntimeErrors GetJsonConfig(const TSharedRef<FJsonObject>& GraphJson) override;

	/**
	 * @brief Processes a text stream and aggregates it into a single text output.
	 *
	 * This function takes a stream of text chunks and combines them into a single
	 * coherent text result. The actual implementation is handled by the runtime system.
	 *
	 * @param TextStream The input text stream to be aggregated
	 * @return Aggregated text data containing all stream content combined
	 */
	UFUNCTION()
	UPARAM(meta = (DisplayName = "Text"))
	FInworldData_Text Process_TextStream(const FInworldData_DataStream_String& TextStream)
	{
		checkNoEntry();
		return {};
	}
};
