JSON schema leads to error for beta text generation

Demo code (Please double-check my implementation is accurate):

local HttpService = game:GetService("HttpService")
local TextGenerator = Instance.new("TextGenerator", workspace)

local RESPONSE_SCHEMA = {
    type = "object",
    properties = {
        ["animals"] = {
            type = "number"
        }
    }
}

local function GetAnimalCountAsync(UserPrompt)
    local Success, Response = pcall(function()
        return TextGenerator:GenerateTextAsync({
            UserPrompt = UserPrompt,
            JsonSchema = HttpService:JSONEncode(RESPONSE_SCHEMA),
            MaxTokens = 50
        })
    end)

    if not Success then
        warn(Response)
    end
    
    return Success, Success and Response.GeneratedText
end

print(GetAnimalCountAsync("2 dogs, and 1 cat"))

Using JSON schema returns the following error message

Error while making HTTP request: HTTP 400 (Bad Request)

I’m running into the same issue and rereading the documentation led me to find this:

Not sure if this segment is outdated info…

Thank you for that, didn’t see that part!