π Let's test this Python-Unreal Engine 5 thing for Video Game Production Management!
Project Settings -> Plugins -> Python and enable developer mode.
chatGPT
You can use talkGPT (but not yet in Android) to talk to the console and the AI will respond using a custom voice too.
talkGPT
- Voice to text recognizement & pytorch install seems not to work in Android (Termux)
- real-time history for conversate.py and talk.py
Also you can generate code using the function codeGPT to generate code when commentaries are passed to it.
Example:
codeGPT "# Python3 # A code to store a list of dictionaries of fruits and vegetables"
A string can also be passed to chatGPT and talkGPT and it will only run that line. Put the text in between matching "" quotes.
chatGPT "Kant vs. Nietzsche. Give me a well formatted table containing relationships of similarity and opposite thoughts on the deepest issues of their careers and thoughts on philosophy topic, in a json format so I can import it to python. With that json file, tell me proportionally in what they agree in a percentage, and form that percentages, only show me one which resumes all the other percentages to I only have a total percentage of agreement they had overall they careers and explain to me why it's overall pertentage is what it is. Specify more information on the topics they disagree and show quotes of them
to prove it"
talkGPT "Tell me any playing card"
- Install Python3 and Git
GNU/Linux:
sudo apt-get install -y python3 git
Termux (Android):
pkg install -y root-repo
pkg update -y
pkg upgrade -y
apt install -y git build-essential python3
- Install Python dependencies
GNU/Linux:
pip3 install openai python-dotenv colorama
Windows:
pip install openai python-dotenv colorama
Termux (Android):
MATHLIB="m" pip3 install numpy openai
pip3 install wheel setuptools python-dotenv colorama
- Clone git repository
git clone https://github.com/Axlfc/UE5-python
-
Navigate to Content/Python/chatBot repository directory
-
Log into openAI web page and get your API key.
-
Edit .env file from the chatBot repository folder and paste your API Key to set the variable OPENAI_API_KEY
-
Run conversate.py to begin to conversate with the AI locally on your terminal.
GNU/Linux & Termux (Android):
python3 conversate.py
Windows:
python conversate.py
- Use exit or quit words to end the conversation.
If you want to run a simple command chat
to run chatGPT in Windows Terminal, you can edit the C:\Users\Your_Username\Documents\WindowsPowershell\Microsoft.PowerShell_profile.ps1 file and add to it the following lines:
function chat_function {
python C:\Users\Your_Username\Desktop\UE5-python\Content\Python\chatBot\conversate.py
}
Set-Alias chat chat_function
If you also want that chat
alias in GNU/Linux or Android, you can edit ~/.bash_aliases
file and add:
chat()
{
python3 "~/UE5-python/Content/Python/chatBot/conversate.py"
}
Now when you type chat
in your Terminal it will start chatGPT.
If you want the AI to talk to you using a concrete voice, you should try running talk.py script which is used to make the AI process an audio file of their response, for the moment voice chat works only on Windows or GNU/Linux:
- Install portaudio
GNU/Linux:
sudo apt-get install -y build-essential portaudio19-dev
- Install the required Python dependencies and it should work:
GNU/Linux:
pip3 install git+https://github.com/openai/whisper.git jiwer gitpython gdown pathlib setuptools pyaudio soundfile pathlib numpy librosa SpeechRecognition langdetect googletrans==4.0.0-rc1
Windows:
pip install git+https://github.com/openai/whisper.git jiwer gitpython gdown pathlib setuptools pyaudio soundfile pathlib numpy librosa SpeechRecognition langdetect googletrans==4.0.0-rc1
Run talk.py to begin to talk with the AI locally on your terminal, the voice will process and then played.
GNU/Linux:
python3 talk.py
Windows:
python talk.py
Voice processing in talk.py script isn't able to mantain a conversation (almost) real time with the ChatGPT AI due to long audio processing time, but it is definitely possible.
If you only want the AI to generate code for you, use the script code.py and pass some commented code to it and it will reply creating code for you!
GNU/Linux & Termux (Android):
python3 code.py "# Python3 # A code to store a list of dictionaries of fruits and vegetables"
Windows:
python code.py "# Python3 # A code to store a list of dictionaries of fruits and vegetables"
There are more scripts inside the chatBot folder, you can check them out too.
Twitter stuff (API bot) (Scraping engine)
Reddit stuff (API bot) (Scraping engine)
Test script with hython3.9.exe from Houdinit's folder.
hython3.9.exe houdini.py
- Trick houdini to be able to import hou module correctly in houdini.py script using a regular python3 version trying to not rely on hython.
Nothing yet