Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
028c9d52f8 | ||
|
|
fa038d0909 | ||
|
|
d85dbeb1f3 | ||
|
|
5c02218024 | ||
|
|
dc03e608f5 | ||
|
|
67f287876f | ||
|
|
dbbbc78f7a | ||
|
|
4ae58d886d | ||
|
|
ee9f4b605e | ||
|
|
549e303720 |
No files matched your search
@@ -0,0 +1,14 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: ruxo78896
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
|
polar: # Replace with a single Polar username
|
||||||
|
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
@@ -1 +1,134 @@
|
|||||||
# OpenAi FiveM Assistant
|
<h1 align="center">
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
_______ _______ _________
|
||||||
|
( ___ )( ____ )\__ __/
|
||||||
|
| ( ) || ( )| ) (
|
||||||
|
| (___) || (____)| | |
|
||||||
|
| ___ || _____) | |
|
||||||
|
| ( ) || ( | |
|
||||||
|
| ) ( || ) ___) (___
|
||||||
|
|/ \||/ \_______/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
OpenAi FiveM Assistant
|
||||||
|
<br>
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<h4 align="center">A lua rest api for FiveM
|
||||||
|
.</h4>
|
||||||
|
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="#key-features">Key Features</a> •
|
||||||
|
<a href="#how-to-use">How To Use</a> •
|
||||||
|
<a href="#credits">Credits</a> •
|
||||||
|
<a href="#docs">Docs</a> •
|
||||||
|
<a href="#license">License</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Key Features
|
||||||
|
|
||||||
|
The OpenAI API can be applied to virtually any task that involves understanding or generating natural language or code.
|
||||||
|
|
||||||
|
* Use all models of OpenAi
|
||||||
|
- You need to create an accout on OpenAi and get an API key.
|
||||||
|
* Get response and print in char or console
|
||||||
|
* Code adaptable to every need
|
||||||
|
- Content generation
|
||||||
|
- Summarization
|
||||||
|
- Classification, categorization, and sentiment analysis
|
||||||
|
- Data extraction
|
||||||
|
- Translation
|
||||||
|
- Many more!
|
||||||
|
* Integrated with swiftUI
|
||||||
|
|
||||||
|
| Method | Target | Description |
|
||||||
|
| ---------------------| -----------|-------------|
|
||||||
|
| text-generation | prompt | Generates text based on a given prompt |
|
||||||
|
| sentiment-analysis | text | Determines the sentiment of a given text |
|
||||||
|
| question-answering | question | Provides an answer to a given question based on a given context |
|
||||||
|
| | context | |
|
||||||
|
| summarization | text | Generates a short summary of a given text |
|
||||||
|
| translation | text | Translates text from one language to another |
|
||||||
|
| | target | |
|
||||||
|
| language-detection | text | Detects the language of a given text |
|
||||||
|
| text-classification | text | Classifies a given text into one or more predefined categories |
|
||||||
|
| | categories | |
|
||||||
|
| named-entity-recog. | text | Identifies named entities in a given text |
|
||||||
|
| text-to-speech | text | Converts text into spoken audio |
|
||||||
|
| image-recognition | image | Identifies objects and scenes in an image |
|
||||||
|
| text-to-image | prompt | Generates an image based on a given prompt |
|
||||||
|
| semantic-search | query | Finds documents related to a given query |
|
||||||
|
| | documents | |
|
||||||
|
| chatbot | message | Generates responses to a given message |
|
||||||
|
|
||||||
|
|
||||||
|
## How To Use
|
||||||
|
|
||||||
|
Copy the folder inside the resouce folder of your server, start the script inside server.cfg. To get the Api key go to your account on https://beta.openai.com/account/api-keys and copy the key.
|
||||||
|
|
||||||
|
In this example i've used Davinci gpt 3.5 Turbo model, you can change the model and use what you need.
|
||||||
|
|
||||||
|
Change the value with your OpenAi Api key
|
||||||
|
|
||||||
|
```lua
|
||||||
|
-- API endpoint URL
|
||||||
|
local url = "https://api.openai.com/v1/chat/completions"
|
||||||
|
|
||||||
|
-- API key for authentication
|
||||||
|
local api_key = "YOUR API KEY"
|
||||||
|
```
|
||||||
|
Use /chatgpt "custom prompt" inside fivem
|
||||||
|
|
||||||
|
You can change the command inside the server.lua
|
||||||
|
|
||||||
|
```lua
|
||||||
|
RegisterCommand("chatgpt", function(_src, arg)
|
||||||
|
|
||||||
|
```
|
||||||
|
Please read the official OpenAi API Documentation: https://beta.openai.com/docs if you need more info !
|
||||||
|
|
||||||
|
To get response text, you can use:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
if statusCode == 200 then
|
||||||
|
-- Process the response data
|
||||||
|
local decoded_response = json.decode(response)
|
||||||
|
local completion = decoded_response.choices[1].message.content
|
||||||
|
print("Completion:", completion)
|
||||||
|
TriggerClientEvent('chat:addMessage', _src, {color = {255, 0, 0}, args = {"open_ai","" ..completion.. ""}})
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
|
||||||
|
> You can found more information on: https://platform.openai.com/docs/api-reference/completions/create
|
||||||
|
|
||||||
|
## Docs
|
||||||
|
|
||||||
|
<a href="https://ruxo.gitbook.io/ruxo-shop/free-scripts/openai-fivem-assistant">Ruxo Docs</a>
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
|
||||||
|
Russo Giovanni M.
|
||||||
|
|
||||||
|
OpenAI
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
|
|
||||||
|
IT'S MANDATORY TO GIVE CREDDITS IF YOU REUSE THE CODE!
|
||||||
|
DO NOT CHANGE CREDITS INSIDE THE CODE.
|
||||||
|
|
||||||
|
You need to add credis like:
|
||||||
|
"Copyright Ruxo, https://github.com/turangarusso/"
|
||||||
|
Thank you
|
||||||
|
---
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
--Ruxo made For Evolve Rp V2 ITA https://discord.gg/Cc7fbazCmB
|
|
||||||
|
|
||||||
ESX = exports["es_extended"]:getSharedObject()
|
|
||||||
+2
-19
@@ -1,25 +1,8 @@
|
|||||||
fx_version 'adamant'
|
fx_version 'cerulean'
|
||||||
|
|
||||||
game 'gta5'
|
game 'gta5'
|
||||||
name 'ruxo_openai'
|
name 'ruxo_openai'
|
||||||
version '1.5'
|
version '1.5'
|
||||||
description 'Ruxo OpenAi'
|
description 'Ruxo OpenAi'
|
||||||
|
|
||||||
|
server_script 'server/server.lua'
|
||||||
shared_scripts{
|
|
||||||
"@es_extended/imports.lua",
|
|
||||||
}
|
|
||||||
|
|
||||||
client_scripts {
|
|
||||||
'client/client.lua',
|
|
||||||
}
|
|
||||||
|
|
||||||
server_scripts {
|
|
||||||
'@mysql-async/lib/MySQL.lua',
|
|
||||||
'server/server.lua',
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
'es_extended'
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
GPT = {}
|
GPT = {}
|
||||||
-- don't touch, made by Ruxo for Evolve RP
|
-- don't touch, made by Ruxo for Evolve RP
|
||||||
|
|
||||||
ESX = exports["es_extended"]:getSharedObject()
|
|
||||||
|
|
||||||
RegisterCommand("chatgpt", function(_src, arg)
|
RegisterCommand("chatgpt", function(_src, arg)
|
||||||
|
|
||||||
-- API endpoint URL
|
-- API endpoint URL
|
||||||
|
|||||||
Reference in new issue
Block a user