This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This script facilitates a chat between multiple AI models, allowing them to take turns responding. | |
| It is designed to be run in a terminal environment on linux/macOS, but should work on windows as well. | |
| Finally, it saves the chat history to a file, by default `/tmp/chat_history_<timestamp>.txt`. | |
| # Prerequisites: | |
| - Python 3.7 or higher | |
| - Required Python packages: `pip install ollama` | |
| - Ollama server running: https://ollama.com/ | |
| - (Optional) Install `say` command on macOS if not installed, `spd-say` on linux (if not installed) or `ptts` on windows for voice output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location ~ ^/bot/(.*)$ { | |
| # root / | |
| set $var1 $1; | |
| proxy_pass http://127.0.0.1:8080; | |
| proxy_http_version 1.1; | |
| # proxy_set_header Upgrade $http_upgrade; # allow websockets | |
| proxy_set_header Connection $connection_upgrade; | |
| proxy_set_header X-Forwarded-For $remote_addr; # preserve client IP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var querySelectorAllWithEq = function (selector) { | |
| if (selector === undefined) { | |
| return null; | |
| } | |
| var queue = []; | |
| var process = function (input) { | |
| if (input.indexOf(":eq(") === -1) { | |
| return undefined; | |
| } |