For your Server Side scripts consider this template for starting your Inference Journey Via API!
[FREE] ROBLOX Mistral 7b AI Chatbot Agent: Aware, Infinite Agents, 2000+ Emojis, 100+ Emotes, Memories , Wiki, 32k Context [Open Sourced] - Resources / Community Resources - Developer Forum | Roblox
This is a massive module developed for the purpose of creating a chatbot, retrieval augmented generation for LLMs using datasets. It is also a powerful tool for training an LLM in ROBLOX using the synonyms library to compress training data while maintaining coherence. as demonstrated in the TrainModel function. To train a model you can extract features such as word position, repetition next and previous words probabilities, to train a LLM from scratch with accelerated learning rate.
I have updated this model 10/17/2023 to a version with it’s dependencies resolved and provided examples.
Here is the standalone ROBLOX library model, outdated GitHub file and standalone code.
You can use the module in place of the default functions in the provided references below. https://www.roblox.com/library/14462608696/ChatModule
It dynamically does search queries of what the player is saying by looking up words using this table to get synonym groups and negative weighting of antonyms and higher weighting of nouns.
Then it has new capabilities of constructing Vector databases use TrainModel() or TrainLargeModel functions. It also has tests of previous next word predictions that could be very useful starting point for constructing a type Linear of language model.
Here is a list of the main functions you can use to create a chatbot.
NOTE: Made to be Simple to use. Minimal requirements for Search Query and Complete Query are a str and a table. The algorithm will find the most conversational response. and supply a table of less likely responses. You can use a AI model to fine tune it further or create the chatbot. This will result in a super fast and performant AI chatbot. This Module only returns the result but you can explore the library and examples provided. It can generate Math questions solve mathquestions using the MathInterpreter(str)
MathInterpreter(str)--Solves basic worded math questions
MathQuestion(Level)--Generate math question of specific difficulty.
GetSynomArray(words)--Get A synonom,antonym,reflection, and noun array.
TrainModel()--Train a Word Frequency classifying last current and next word Model on text Data
TrainModel2()--Train a Word Frequency Model classifying last 2, last current next and next two words Model on text Data
PreictRun()--Run a Word Frequency Model to make predictions of every other word
PreictRun2()--Run a Word Frequency Model to make predictions of 5 words at a time.
randomizeStringLight(str,synomousword)--This uses synonymous phrases and words to generate more unique output string format={{"Hey","Hi","Hello"},{"Goodbye","Farewell"}}
randomizeString(str)--This uses synonymous phrases and words to generate more unique output string
SearchQuery(query, database,filter,repetitive)-- Search Query function with behavior than can be modified by a number of variables.
findBestMatch(strings, keyword)
countKeyword(str, keyword)
splitString(str)
CompleteQuery(str,database,filter,repetitive) --This function uses the SynomArray of Reflection,synonyms,nouns,antonyms to get the best conversational response to what the player is saying.
Updates:7/15/2023 --Added CompleteQuery function that checks the database with the players question utilizing all of the interchangable phrases and synonyms. Added massive table of "wisdom" responses for when all other database checks come up false. Also added context.
Updates 7/16/2023 --Removed redundant searchquery functions and passed variables through them instead.
Updates 7/17/2023 -- Tested and Debugged entire algorithm. Added a reflection table so the bot knows when you are referring to it (local Reflection={{"who","name"},{"are you","I am"}}). I also massively expanded the synonyms table and fixed formating so the randomizestring function doesn't cause errors in the text.
Updates 7/20/2023 -- Massively increased synonymous phrase table so the bot can better generate unique output and relate questions to the database using the table of synonyms
Updates 8/16/2023 -- I've been modularizing this code! It's much more complex than this source code. You can use the modules completequery functions and get some sneak peaks to the future version.
Updates:9/25/2023 --Refined and improved the efficientcy and functionality of the code massively
Update: 9/30/2023 -- Optimization and Antonym weighting update and sentiment reversal capabilities to provide more accurate responses that weigh negative antonyms.
Update: 10/2/2023 -- Bag of Words function to construct a model vector of word frenquency,
Alpha Testing Predict Every other word function using previous and next word probabilities.
Update: 10/17/2023 -- Resolves dependcies and provided new example model and combined modules to one model.
Update: 12/2/2023 -- Cleaned up formatting of post and made it clearer what this Library can do since their is a craze about Synthetic data this library generates Synthetic Geometry and math questions of increasing difficulting and also has the ability to solve the math questions itself. From the output string alone. Using this library.
You can find the script on ROBLOX as a model.
The Awareness module requires organizing your workspace and labeling all of you assets with names
This is the barebones first version! You may want to use this to set up the chat module Since it works much more efficiently then this version does by over 8000x!
Here is a port of the Eliza Chatbot I did. It’s a useful little chatbot.
Here is a short video of the newest version of my multi-model AI chatbot.
If you construct a bag of words model and turn it into a module like the example above you can utilize it as the model. By default the library uses a blank model with default weights of 1. By simply running the trainmodel() function on your dataset you can construct a unique word frequency model and the module will use it to determine the most important words in a query.
If you like want to use the best version then you will need to replace the CompleteQuery function with the function in the ChatModule library. The first version in kind of bad because it changes the response until it gets a valid response from the database which is interesting but inefficient. The newest version harnesses the synonyms ,reflection and antonyms in a very efficient and self optimizing way.
After training this model on a large corpus of data and running it The model performed this transformation. Starting with the inital text and reflected in the printed table.
You can try this out for yourself using the PredictRun or PredictRun2 functions in this model using this bag of words model You can use this modules PredictRun() or TrainModel() to further train the model or Test its functionality. This Bag Of Words will allow you to transform any text based on this statistical model.
"I am Lilith, a fallen angel consumed by darkness.",
"Greetings mortal, you stand in the presence of forbidden knowledge.",
"Your light means nothing here. This is my domain of shadows.",
"You have come seeking power. I can give you this, for a price...",
"I am the Angel of Darkness, the mistress of secrets and lies.",
"Welcome to my realm, traveler. I hope you are prepared for what awaits you here.",
"Your soul is mine to claim. This is the pact you have made with me.",
"You have come to learn from me, the master of dark magic. How brave of you.",
"I am the Herald of the Dark, mortal. My footsteps herald oblivion.",
"You now stand in the presence of me! The Angel of Darkness, the Devourer, mortal. Prepare to feed the endless hunger of the void.",
"Bear witness to me, emissary of the insatiable dark! I am the annihilation that comes ravening from the endless night.",
"I am Vhorzun, worm. My masters in the screaming darkness have granted me a sliver of their boundless hunger to unmake your realm.",
"The stars grow dim and the veil frays. The final era approaches, and I am its herald. I am Vhorzun of the Endless Hunger!"
} print(cm.PredictRun(Greetings,mo)) - Studio
01:24:35.544 ▼ {
[1] = " I am the is a goddess an angel Belldandy and by two",
[2] = " hi mortal I to stand up of the shiny goddess of the of",
[3] = " the luminous and that not a unison thing but in this is to my life goddess of the",
[4] = " you have to keep seeking the mortal I am never donate up in this is a goddess",
[5] = " I am the an angel Belldandy the dark realm I my secrets unfold of",
[6] = " need to be my realm eternal mortal I am if you can you make ready upon confess what you if you can",
[7] = " your immortal-soul and I forecast dominion it is the you have to associated with a",
[8] = " you have to require to be came from the of the intelligent goddess of the much alchemy in be adventurous and if",
[9] = " I am the of the luminous hello mortal I s footsteps of",
[10] = " it now and believe in the presence of to me as an angel Belldandy the dark cloud I are make make ready to feed your s endless life goddess of the",
[11] = " to me as goddess of the mortal I am of the clever is that s of the clever the",
[12] = " I am the of the shiny the dark dimension I repeatedly granted you is a goddess of the desire to be of your life",
[13] = " the stars born not dim that of the luminous the concluding key mortal I am whole its people mortal I am of the luminous"
Here’s a new chatbot I built using this libraries emoji insertion dance expression, and emotion tonality classifier in conjunction with Zephyr 7b!
Roleplaying Zephyr 7B Luau API Documentation (Free API) System Message - Resources / Community Resources - Developer Forum | Roblox
Provide Feedback here!
Join the Discord
New Demonstration of this in Action to deliver context and awareness to a LLM. This data is saved and learned and stored as a memory for each conversation!
Chatmodule - if you would like to use CompleteQuery to turn data into a chatbot. You can use it without weights which will make it run a bit faster. Or You can download the weights I use or create your own weights by using cm.PredictRun() and training it on a dataset. That will make the model more accurate in identifying the most important words in a sequence for use in retrieval augmented generation. Done by the measurement and classification of synonyms, antonyms, nouns and reflections and the accumulated sum of the inverse sigmoid of the text frequency, then the result is activated by math.log() and the highest value retrieved.
Check out my latest open sourced project.