Jump to content

Recommended Posts

I'm trying to use ChatGPT in my mod to plan behaviours of an AI character, which requires sending request to openai.com. However the lua environment doesn't have `socket` library. From a previous post (https://forums.kleientertainment.com/forums/topic/58269-thenet-and-establishing-connections/) it seems it's not allowed to make http request in the mod, but I'm not sure. Is it possible to install the socket library in the environment, or are there other available libraries to send requests? Or are there any other workarounds?

 

You can make requests using:

TheSim:QueryServer(url [, callbackfn [, method [, encoded_data [, timeout]]]])

But this does only support GET and POST request methods and you can only modify the body of the request not the headers or anything else.

So for authorization in the Open AI API you will have to use some kind of a proxy server.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...