// Georgy Treshchev 2026 All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "RuntimeVoskModelTypes.generated.h"

/**
 * A single downloadable Vosk model variant (one .zip on the Vosk model server)
 */
USTRUCT(BlueprintType, Category = "Runtime Speech Recognizer|Vosk")
struct RUNTIMESPEECHRECOGNIZERVOSK_API FVoskModelVariant
{
	GENERATED_BODY()

	/** Unique model identifier. Matches the name of the top-level folder inside the downloaded zip archive (e.g. "vosk-model-small-en-us-0.15") */
	UPROPERTY(BlueprintReadOnly, Category = "Runtime Speech Recognizer|Vosk")
	FString ModelId;

	/** Direct URL to the model .zip archive */
	UPROPERTY(BlueprintReadOnly, Category = "Runtime Speech Recognizer|Vosk")
	FString DownloadURL;

	/** Approximate size of the .zip archive in bytes, for UI display purposes only */
	UPROPERTY(BlueprintReadOnly, Category = "Runtime Speech Recognizer|Vosk")
	int64 ApproximateSizeBytes = 0;

	/** Free-form notes/accuracy info as published on the Vosk model server */
	UPROPERTY(BlueprintReadOnly, Category = "Runtime Speech Recognizer|Vosk")
	FString Info;

	/** License of the model */
	UPROPERTY(BlueprintReadOnly, Category = "Runtime Speech Recognizer|Vosk")
	FString License;

	bool operator==(const FVoskModelVariant& Other) const { return ModelId == Other.ModelId; }
};

FORCEINLINE uint32 GetTypeHash(const FVoskModelVariant& Variant)
{
	return GetTypeHash(Variant.ModelId);
}

/**
 * A group of Vosk model variants belonging to the same language/section, mirroring the sections
 * on the official Vosk models page (e.g. "English", "English Other", "Russian", "Russian Other")
 */
USTRUCT(BlueprintType, Category = "Runtime Speech Recognizer|Vosk")
struct RUNTIMESPEECHRECOGNIZERVOSK_API FVoskModelLanguageGroup
{
	GENERATED_BODY()

	/** Display name of the group, e.g. "English", "Russian Other" */
	UPROPERTY(BlueprintReadOnly, Category = "Runtime Speech Recognizer|Vosk")
	FString GroupDisplayName;

	/** Model variants belonging to this group */
	UPROPERTY(BlueprintReadOnly, Category = "Runtime Speech Recognizer|Vosk")
	TArray<FVoskModelVariant> Variants;
};