From 1a45c04b8855b90838318dbfb145a94b10e5c20a Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Mon, 23 Sep 2024 15:02:02 +0200 Subject: [PATCH 1/3] WebView better --- py/requirements.txt | 3 +++ py/webapp.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/py/requirements.txt b/py/requirements.txt index 8a79dc1..a5fe3e6 100644 --- a/py/requirements.txt +++ b/py/requirements.txt @@ -5,4 +5,7 @@ mistralai openai anthropic pyOpenSSL +pywebview +tkhtmlview +cefpython3 pywebview \ No newline at end of file diff --git a/py/webapp.py b/py/webapp.py index 6ad4725..e97750b 100644 --- a/py/webapp.py +++ b/py/webapp.py @@ -1,3 +1,3 @@ import webview -webview.create_window('Interstellar AI', 'http://localhost:3000') +webview.create_window('Hello world', 'http://localhost:3000') webview.start() From 065b241f19ab2edbecb0fcab411caad97ec5354f Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Mon, 23 Sep 2024 16:06:20 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index e69de29..0efe25b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,46 @@ +# Installation Guide + +In order to use this app, you need quite a lot of things, so buckle up. + +## Dependencies + +Install the following: + +https://ollama.com/download + +https://www.python.org/downloads/ + +https://nodejs.org/en/download/prebuilt-installer + +For Linux and NodeJS, see: + +https://nodejs.org/en/download/package-manager/all + +## Running the project for the first time + +In order to now actually run the program, you have to open a terminal in the project folder, then you can run: + +``` +npm install +cd py +pip install -R requirements.txt +``` + +In case you need a virtual environment however, we provide a custom install.sh file for GNU/Linux. + +``` +sh install.sh +``` + +From then on, you can run the project by: +1. Opening two terminal windows, one in the main project folder, and one in the py subfolder. +2. In the py subfolder, you will run: +``` +python3 api.py +``` +3. In the main project folder, you will run: +``` +npm run dev +``` +4. Open http://localhost:3000/ in your browser. +5. Enjoy! \ No newline at end of file From 5a7961b10f6a4c8fb1bb885e3287feb313ee0e90 Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Mon, 23 Sep 2024 16:35:16 +0200 Subject: [PATCH 3/3] WebView better, i think? --- py/api.py | 5 ----- py/requirements.txt | 3 --- py/run.py | 7 +++++++ py/webapp.py | 4 +--- 4 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 py/run.py diff --git a/py/api.py b/py/api.py index 55d0483..be44561 100644 --- a/py/api.py +++ b/py/api.py @@ -118,8 +118,3 @@ class API: ssl_context = ("cert.pem", "key.pem") self.app.run(debug=True, host='0.0.0.0', port=5000) - - -if __name__ == '__main__': - api = API() - api.run() diff --git a/py/requirements.txt b/py/requirements.txt index a5fe3e6..8a79dc1 100644 --- a/py/requirements.txt +++ b/py/requirements.txt @@ -5,7 +5,4 @@ mistralai openai anthropic pyOpenSSL -pywebview -tkhtmlview -cefpython3 pywebview \ No newline at end of file diff --git a/py/run.py b/py/run.py new file mode 100644 index 0000000..612d72e --- /dev/null +++ b/py/run.py @@ -0,0 +1,7 @@ +import os +import webview + +os.system("python api.py") +webview.create_window('Hello world', 'http://localhost:3000') +webview.start() + diff --git a/py/webapp.py b/py/webapp.py index e97750b..8b13789 100644 --- a/py/webapp.py +++ b/py/webapp.py @@ -1,3 +1 @@ -import webview -webview.create_window('Hello world', 'http://localhost:3000') -webview.start() +