Skip to content

OpenAI FiveM wrapper to interact with the OpenAI API

License

Notifications You must be signed in to change notification settings

pablo-1610/openai_fivem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI FiveM Wrapper

OpenAI FiveM Wrapper allows you to interact with the OpenAI API

How to install

  1. Download the resource from the release section
  2. Get your OpenAI API Key from here
  3. Add a convar in your server.cfg as follow: set openai_api_key yourApiKey
  4. Add ensure openai_fivem to your server.cfg
  5. Restart your server
  6. 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.

About

OpenAI FiveM wrapper to interact with the OpenAI API

Topics

Resources

License

Stars

Watchers

Forks

Languages