Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My AI chatbot script linked to GPT-2 API isnt working. Any help?

Asked by 2 years ago
01local HttpService = game:GetService("HttpService")
02local API_KEY = "blanked out for privacy"
04 
05function generateText(prompt, length)
06    local requestBody = HttpService:JSONEncode({
07        prompt = prompt,
08        length = length,
09        temperature = 0.7,
10    })
11 
12    local headers = {
13        ["Content-Type"] = "application/json",
14        ["Authorization"] = "Bearer " .. API_KEY,
15    }
View all 24 lines...
0
any error messages? s_21 74 — 2y
0
Yes. I got "unable to cast dictionary to token" Fallden4 0 — 2y
0
At what line? blowup999 659 — 2y
0
nvm, it's because PostAsync is given the wrong data - You need to do HttpService:PostAsync(API_URL, requestBody, Enum.HttpContentType.ApplicationJson, false, headers) blowup999 659 — 2y
0
I got this error: Header "Content-Type" is not allowed! - Server - Script:17 Fallden4 0 — 2y

Answer this question