OpenAI FiveM Wrapper
OpenAI FiveM Wrapper allows you to interact with the OpenAI API
How to install
- Download the resource from the GitHub page
- Get your OpenAI API Key from here
- Add a convar in your server.cfg as follow:
set openai_api_key yourApiKey
- Add
ensure openai_fivem
to your server.cfg - Restart your server
- You’re done ! You can start using the OpenAI FiveM Wrapper
How to use
1 - Chat Completion
Create chat completion using OpenAI GPT models
Prototype:
doChatCompletion(message, [optionnal] systemOrder, [optionnal] model)
Examples:
local number <const> = exports.openai_fivem:doChatCompletion("Give me a number between 1 and 5")
local answer <const> = exports.openai_fivem:doChatCompletion("Give me my money!!", "You are a police officer NPC in a video game", "gpt-4")
Possible issues
For the moment, OpenAI handles each request individually, so you cannot make several requests at once. Use the isBusy
export to knows if you can make a request.
Need support ?
You can directly reply to this post or DM me.