mirror of
https://github.com/NovaOSS/violet.git
synced 2024-11-25 16:44:00 +01:00
last push from my laptop
This commit is contained in:
parent
1d62cdf758
commit
c732e7d6f4
14
README.md
14
README.md
|
@ -8,6 +8,7 @@
|
||||||
- Errors are explained
|
- Errors are explained
|
||||||
|
|
||||||
### Planned
|
### Planned
|
||||||
|
- Start sandbox in another thread, detect print() stuff
|
||||||
- API access (save your API tokens for various services in a `.env` file, and the bot will be able to find out e.g. the weather.)
|
- API access (save your API tokens for various services in a `.env` file, and the bot will be able to find out e.g. the weather.)
|
||||||
- Web UI planned (the sandbox has a way higher priority, though! No web UI is going to be worked on before there is no proper sandbox.)
|
- Web UI planned (the sandbox has a way higher priority, though! No web UI is going to be worked on before there is no proper sandbox.)
|
||||||
|
|
||||||
|
@ -24,6 +25,19 @@ Additionally, never ever, give others access to the sandbox features! Malicious
|
||||||
|
|
||||||
✅ MacOS (probably - testers needed!)
|
✅ MacOS (probably - testers needed!)
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
✅ Python 3.8.10+
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
1. Create a `.env` in *this* directory with the following content:
|
||||||
|
```
|
||||||
|
OPENAI_API_KEY=sk-ywvx6zhMxWDeQTL69LQMKoBz4Gr26QCAhF6xom9bWUHTuujF
|
||||||
|
```
|
||||||
|
2. Replace the value of `OPENAI_API_KEY` with your actual OpenAI API key. The API key above is just an example and doesn't work. Don't give anyone access to anything stored in your `.env`.
|
||||||
|
|
||||||
|
3. Then - assuming you already have *Python* and *pip* installed, run `pip install -r requirements.txt`
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
### `AttributeError: Could not find PyAudio; check installation`
|
### `AttributeError: Could not find PyAudio; check installation`
|
||||||
```
|
```
|
||||||
|
|
19
test.py
19
test.py
|
@ -1,19 +0,0 @@
|
||||||
# TODO Test this on Windows
|
|
||||||
|
|
||||||
import platform
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
# Check the operating system
|
|
||||||
os_name = platform.system()
|
|
||||||
|
|
||||||
# Set the Discord binary path based on the operating system
|
|
||||||
if os_name == 'Windows':
|
|
||||||
discord_path = 'C:\Program Files (x86)\Discord\Discord.exe'
|
|
||||||
elif os_name == 'Darwin': # macOS
|
|
||||||
discord_path = '/Applications/Discord.app/Contents/MacOS/Discord'
|
|
||||||
else:
|
|
||||||
# Assume Linux
|
|
||||||
discord_path = '/usr/bin/discord'
|
|
||||||
|
|
||||||
# Open Discord using the default binary path
|
|
||||||
subprocess.run([discord_path])
|
|
|
@ -41,4 +41,23 @@ print(f"{3**4+6*5}")
|
||||||
Human: Tell me a short story.
|
Human: Tell me a short story.
|
||||||
AI: One day, a kind man named John helped a traveler in need. In return, the traveler gave John a magical stone that brought him good luck and happiness. John used its magic to help others, and the villagers learned to be more compassionate. The end.
|
AI: One day, a kind man named John helped a traveler in need. In return, the traveler gave John a magical stone that brought him good luck and happiness. John used its magic to help others, and the villagers learned to be more compassionate. The end.
|
||||||
Human: Start Discord.
|
Human: Start Discord.
|
||||||
AI:
|
AI: ```
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
# Check the operating system
|
||||||
|
os_name = platform.system()
|
||||||
|
|
||||||
|
# Set the Discord binary path based on the operating system
|
||||||
|
if os_name == 'Windows':
|
||||||
|
discord_path = os.getenv('LOCALAPPDATA') + '\\Discord\\Update.exe'
|
||||||
|
elif os_name == 'Darwin': # macOS
|
||||||
|
discord_path = '/Applications/Discord.app/Contents/MacOS/Discord'
|
||||||
|
else: # Assume Linux
|
||||||
|
discord_path = '/usr/bin/discord'
|
||||||
|
|
||||||
|
# Open Discord using the default binary path
|
||||||
|
subprocess.run([discord_path])
|
||||||
|
print("Alright. Opening Discord...")
|
||||||
|
```
|
Loading…
Reference in a new issue