Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Perthys/LuaOpenAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

LuaOpenAI

broken after critical api change

local OpenAI = loadstring(game:HttpGet('https://raw.githubusercontent.com/Perthys/LuaOpenAI/main/main.lua'))()
local Dump = loadstring(game:HttpGet('https://raw.githubusercontent.com/Perthys/table/main/main.lua'))().Dump

local Configuration, API = OpenAI.Configuration, OpenAI.OpenAIAPI

local Config = Configuration.new({
    APIKey = "sk-__________________________________________";
})

local OpenAIInstance = API.new(Config);

local Response = OpenAIInstance:CreateCompletion({
    ["model"] = "text-davinci-003",
    ["prompt"] = "hello",
    ["temperature"] = 0.8,
    ["max_tokens"] = 40,
    ["top_p"] = 1,
    ["frequency_penalty"] = 0,
    ["presence_penalty"] = 0
});

print(Dump(Response))

Most if not all endpoints are inside of the api

Releases

No releases published

Packages

No packages published

Languages