Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.25 KB

README.md

File metadata and controls

41 lines (26 loc) · 1.25 KB

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.