Jump to content

GOO_

Developer
  • Posts

    59
  • Joined

  • Last visited

5 Followers

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

GOO_'s Achievements

Enthusiast

Enthusiast (6/15)

  • One Year In
  • Dedicated
  • Collaborator
  • Week One Done
  • One Month Later

Recent Badges

19

Reputation

  1. Changed Status from Pending to Can't Reproduce
  2. Changed Status from Pending to Can't Reproduce
  3. GOO_

    OpenAI Integration

    I guess that is a matter of perspective. From what I'm told by users it is not expensive. You can also restrict how many tokens your plugins use in the API call. Honestly gpt-4o is so cheap i didn't even consider the costs recently. Anyway, I'll be updating RustGPT to also use Groq which is free at the moment.
  4. GOO_

    OpenAI Integration

    I'll be updating RustGPT to use this as a dependency soon. Also a few other plugins I am developing (eventually) will use this. However if you want to get started you can easily make your own version of RustGPT to get a better understanding of how the tech works. There is ample documentation on the platform.openai.com site. You can also message me on discord if you need help. https://discord.gg/EQNPBxdjRu
  5. Version 1.0.1

    29 downloads

    For developers to integrate OpenAI endpoints into their plugins. Features API Key Verification: Automatically verifies the provided OpenAI API key. Chat Commands: Provides in-game commands for administrators to interact with the OpenAI API. Model Listing: Fetches and lists available models from OpenAI. Chat Completions: Handles chat-based interactions with OpenAI's language models. Configuration { "DefaultAssistantModel": { "max_completion_tokens": 150, "max_prompt_tokens": 150, "Model": "gpt-4o" }, "DefaultCompletionsModel": { "MaxTokens": 150, "Model": "gpt-4o" }, "OpenAI_Api_Key": { "OpenAI API Key": "your-api-key-here" } } Commands /openaitest Tests the connection to the OpenAI API using a predefined message. Only available to administrators. /listmodels Fetches and lists all available models from the OpenAI API. Only available to administrators. Public Methods There are two main API interactions through the completions and the assistant API. Completions_SimpleChat Example of Completions_SimpleChat - Creates a simple chat interaction with OpenAI. private void AskGptCommand(BasePlayer player, string command, string[] args) { if (!permission.UserHasPermission(player.UserIDString, "RustGPT.chat")) { player.ChatMessage("<color=#ff0000>You do not have permission to use this command.</color>"); return; } if (args.Length == 0) { player.ChatMessage("Usage: /askgpt <your question>"); return; } if (!HasCooldownElapsed(player)) { return; } var userMessage = string.Join(" ", args); var messages = new List<object> { new { role = "system", content = _config.DefaultContent }, new { role = "user", content = userMessage } }; player.ChatMessage("Sending your message to OpenAI..."); OpenAI?.Call("Completions_SimpleChat", messages, (System.Action<JObject>)((response) => { if (response != null && response["choices"] != null && response["choices"].HasValues) { string GPT_Chat_Reply = response["choices"][0]["message"]["content"].ToString().Trim(); if (GPT_Chat_Reply.Length > 1200) { CreateNotesForResponse(player, GPT_Chat_Reply); } else { SendChatMessageInChunks(player, $"<color={_config.ReplyPrefixColor}>{_config.ReplyPrefix}</color> {GPT_Chat_Reply}", 250); } } else { player.ChatMessage("<color=#ff0000>Failed to get a valid response from OpenAI. Please try again later.</color>"); } })); } Assistant_CreateAssistant [HookMethod("Assistant_CreateAssistant")] public void Assistant_CreateAssistant(string name = null, string description = null, string instructions = null, List<object> tools = null, object toolResources = null, Dictionary<string, string> metadata = null, double? temperature = null, double? topP = null, object responseFormat = null, Action<JObject> callback = null) Example: var openAIPlugin = (OpenAI)plugins.Find("OpenAI"); openAIPlugin.Assistant_CreateAssistant("MyAssistant", "An assistant for my game", "You are a helpful assistant.", null, null, null, null, null, null, response => { if (response != null) { Puts("Assistant created successfully: " + response.ToString()); } else { Puts("Failed to create assistant."); } }); Assistant_CreateVectorStore Example use of Assistant_CreateVectorStore to save chat interactions in the OpenAI platform using the Assistants API. var openAIPlugin = (OpenAI)plugins.Find("OpenAI"); List<string> fileIds = new List<string>(); // Initially, no file IDs string name = "OpenAIChatHistory"; object expiresAfter = DateTime.UtcNow.AddDays(30); // Expires after 30 days object chunkingStrategy = null; // Define your chunking strategy if any Dictionary<string, string> metadata = new Dictionary<string, string> { { "game", "Rust" }, { "description", "Vector store for storing chat interactions with OpenAI" } }; openAIPlugin.Assistant_CreateVectorStore(fileIds, name, expiresAfter, chunkingStrategy, metadata, response => { if (response != null) { Puts("Vector store created successfully: " + response.ToString()); } else { Puts("Failed to create vector store."); } }); Pubic Methods FetchModels Completions_CreateChat Completions_SimpleChat Assistant_CreateAssistant CreateThread RetrieveThread ModifyThread DeleteThread Assistant_CreateMessage Assistant_ListMessages Assistant_RetrieveMessage Assistant_ModifyMessage Assistant_DeleteMessage Assistant_CreateRun Assistant_CreateThreadAndRun Assistant_ListRuns Assistant_RetrieveRun Assistant_ModifyRun Assistant_CancelRun Assistant_ListRunSteps Assistant_RetrieveRunStep Assistant_CreateVectorStore Assistant_ListVectorStores Assistant_RetrieveVectorStore Assistant_ModifyVectorStore Assistant_DeleteVectorStore Assistant_SubmitToolOutput All of these interactions are built using the OpenAI platform as a scaffold. Using the OpenAI documentation you can see response examples for all of the available methods. https://platform.openai.com/docs/api-reference/introduction
    Free
  6. Changed Status from Work in Progress to Closed
  7. It's an error from openAi. Check your API key.
  8. GOO_

    Rust GPT

    @Covfefe can you start a support thread so I can better help you?
  9. Changed Status from Pending to Work in Progress Changed Fixed In to Next Version
  10. Changed Status from Pending to Closed
  11. I'm updating the plugin tonight but I can't make any promises of the death commentary working with multiple plugins. After this update Ill try and work in fixes for popular plugins that have zombies and special turrets, etc.
  12. I will be updating the plugin tonight.
  13. GOO_

    Rust GPT

    Here is what I have in my RustGPT.json { "OpenAI_Api_Key": { "OpenAI API Key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }, "OutboundAPIUrl": { "API URL": "https://api.openai.com/v1/chat/completions" }, "AIResponseParameters": { "Model": "gpt-4", "Temperature": 0.9, "Max Tokens": 575, "Presence Penalty": 0.6, "Frequency Penalty": 0.0 }, "AIPromptParameters": { "System role": "You are a helpful assistant on Rust game server called Rust.Haus Testing Server.", "User Server Details": "Server wipes Thursdays at 2pm CST. Blueprints are wiped on forced wipes only. Gather rate is 5X. Available commands available by using /info. Server admin is Goo. The discord link is https://discord.gg/EQNPBxdjRu" }, "OptionalPlugins": { "Turn on GPT Powered Death Notes": true, "Kill GPT Prompt": "You are an extremely rude color commentator. You use profanity and make fun of the people involved. Only respond in one sentence.", "DiscordMessages Webhook URL": "https://discord.com/api/webhooks/1158127241046282371/8D3OZcQBmXYUWn_liNNir6g_qld3eO8fhBZs6N6hGTFJRoKKRax_mo5o7ScgptaVeg58", "Broadcast RustGPT Messages to Discord?": true, "Steam API Key": "XXXXXXXXXXXXXXXXXXXXXXXX" }, "DeathNoteSettings": { "Kill Message Color": "#ADD8E6", "Kill Message Font Size": 12, "Show simple kill feed in chat": true }, "Response Prefix": "[RustGPT]", "Question Pattern": "!gpt", "Response Prefix Color": "#55AAFF", "Broadcast Response to the server": false, "Plugin Version": "1.7.6", "Chat cool down in seconds": 10 }
  14. GOO_

    Rust GPT

    What model are you using?
  15. GOO_

    Rust GPT

    I tried doing this a few months ago and it was way too janky. I'll try again though. I need someone smarter than myself to help me out with that.
1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.5k

Files Sold

Total number of files sold.

2.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.