From 96c0486eebda82c5c9185d2cfd12d790943cf492 Mon Sep 17 00:00:00 2001 From: NovaOSS Admins Date: Fri, 20 Oct 2023 13:30:33 +0000 Subject: [PATCH] minor improvements --- requirements.txt | 1 + web/app.py | 5 +++-- web/static/css/base.css | 4 ++++ web/static/css/base.css.map | 2 +- web/static/css/base.sass | 4 ++++ web/templates/get-started.html | 11 +++++++---- web/templates/index.html | 24 +++++++++++++++--------- 7 files changed, 35 insertions(+), 16 deletions(-) diff --git a/requirements.txt b/requirements.txt index fd4d749..3bfd48b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,6 @@ pandas cherrypy requests werkzeug +watchdog python-dotenv requests-oauthlib \ No newline at end of file diff --git a/web/app.py b/web/app.py index 4748314..306cca7 100755 --- a/web/app.py +++ b/web/app.py @@ -60,5 +60,6 @@ def create_app() -> flask.Flask: production = create_app() if __name__ == '__main__': - print('* DEV environment online at http://localhost:2211') - create_app().run(debug=True, use_reloader=True, use_evalex=False, port=2211, host='0.0.0.0', threaded=True) + PORT = int(os.environ.get('DEV_PORT', 2211)) + print(f'* DEV environment online at http://localhost:{PORT}') + create_app().run(debug=True, use_reloader=True, use_evalex=False, port=PORT, host='0.0.0.0', threaded=True) diff --git a/web/static/css/base.css b/web/static/css/base.css index ba1363d..08f5464 100644 --- a/web/static/css/base.css +++ b/web/static/css/base.css @@ -104,6 +104,10 @@ pre code *, pre code { font-weight: normal; } +pre { + white-space: pre-wrap; +} + p, p *, ol, ul, li { line-height: 32px; } diff --git a/web/static/css/base.css.map b/web/static/css/base.css.map index 775dc58..ccdcd51 100644 --- a/web/static/css/base.css.map +++ b/web/static/css/base.css.map @@ -1 +1 @@ -{"version":3,"sources":["base.sass","base.css","_vars.sass"],"names":[],"mappings":"AAEA;EACI,uBAAA;ACDJ;;ADGA;EACI,yBELS;ADKb;;ADEA;EACI,gBEUS;EFTT,cAAA;ACCJ;;ADCA;EACI,sBAAA;EACA,YAAA;EACA,cEfG;EFgBH,gCAAA;ACEJ;;ADAA;EACI,qBAAA;ACGJ;;ADAI;EACI,gBAAA;EACA,iBAAA;EACA,+BAAA;ACGR;;ADAI;EACI,mBAAA;ACGR;;ADAI;EACI,mBAAA;ACGR;;ADDA;EACI,0BAAA;EACA,8BE9BM;EF+BN,0BAAA;EACA,8BAAA;EAEA,gBAAA;ACGJ;ADDI;EACI,4BAAA;EACA,4CEpCO;ADuCf;;ADDA;EACI,YAAA;ACIJ;;ADFA;EACI,cAAA;EACA,eAAA;ACKJ;;ADHA;EACI,cEvDG;EFwDH,mBEjDM;EFkDN,gBAAA;EACA,kBAAA;ACMJ;;ADJA;EACI,8CAAA;EACA,gBAAA;EACA,mBE7DQ;EF8DR,kBE/CG;EFgDH,sBAAA;EACA,gCAAA;ACOJ;;ADLA;EACI,cAAA;EACA,kBAAA;EACA,8BAAA;EACA,YAAA;EACA,mBEvEQ;EFwER,WAAA;EACA,kBE1DG;ADkEP;ADNI;EACI,0BEjEA;ADyER;ADPI;EACI,0BElED;AD2EP;ADRI;EACI,0BEnEE;AD6EV;;ADRA;EACI,8CAAA;EACA,gBAAA;EACA,mBErFQ;EFsFR,kBEvEG;EFwEH,sBAAA;ACWJ;;ADRI;EACI,mBAAA;ACWR;;ADTA;EACI,iBAAA;ACYJ;;ADVA;EACI,YAAA;EACA,mBAAA;ACaJ;;ADXA;EAEI,aAAA;ACaJ;;ADXA;EACI,4DAAA;EACA,6BAAA;EACA,oCAAA;ACcJ;;ADZA;EACI,mBAAA;EACA,6CEvGW;EFwGX,mDAAA;EACA,kBElGG;EFmGH,kBAAA;ACeJ;;ADbA;EACI;IACI,cAAA;IACA,gBAAA;ECgBN;AACF","file":"base.css","sourcesContent":["@import '_vars'\n\nhtml\n scroll-behavior: smooth\n\nbody\n background-color: $background\n\nnav, main, footer\n max-width: $main-width\n margin: 0 auto\n\n*, *::before, *::after\n box-sizing: border-box\n border: none\n color: $text\n font-family: 'Inter', sans-serif\n\na\n text-decoration: none\n\nh1, h2, h3\n &, *\n font-weight: 700\n line-height: 3rem\n font-family: 'Syne', sans-serif\n\nh2\n &, *\n line-height: 2.2rem\n\nh3\n &, *\n line-height: 1.5rem\n\nmain a\n text-decoration: underline\n text-decoration-color: $primary\n text-underline-offset: 2px\n text-decoration-thickness: 5px\n\n transition: 0.2s\n\n &:hover\n text-decoration-thickness: 0\n background: $primary-glow\n\nmain p\n opacity: 0.9\n\nimg\n display: block\n max-width: 100%\n\nmark\n color: $text\n background: $primary\n padding: 5px 7px\n border-radius: 5px\n\nkbd\n font-family: 'Courier New', Courier, monospace\n font-weight: 600\n background: $secondary\n border-radius: $edge\n padding: 0.2rem 0.4rem\n border-bottom: 3px solid $secondary-dark\n\nblockquote\n margin-left: 0\n padding: 1rem 1rem\n border-left: 5px solid $accent\n opacity: 0.8\n background: $secondary\n width: 100%\n border-radius: $edge\n\n &.error\n border-left-color: $error\n &.warning\n border-left-color: $warn\n &.success\n border-left-color: $success\n\ncode\n font-family: 'Courier New', Courier, monospace\n font-weight: 600\n background: $secondary\n border-radius: $edge\n padding: 0.2rem 0.4rem\n\npre code\n *, &\n font-weight: normal\n\np, p *, ol, ul, li\n line-height: 32px\n\nh6\n opacity: 0.7\n font-weight: normal\n\n:focus:not(:focus-visible)\n\n outline: none\n\n.special-gradient\n background: linear-gradient(45deg, #be89ec 7%, #2867f0 100%)\n -webkit-background-clip: text\n -webkit-text-fill-color: transparent\n\n.box\n margin-bottom: 1rem\n background: $primary-soft\n border: 2px solid $primary-soft\n border-radius: $edge\n padding: 0rem 1rem\n\n@media (max-width: 900px)\n body\n margin: 0 2rem\n margin-top: 2rem\n","html {\n scroll-behavior: smooth;\n}\n\nbody {\n background-color: #03060d;\n}\n\nnav, main, footer {\n max-width: 800px;\n margin: 0 auto;\n}\n\n*, *::before, *::after {\n box-sizing: border-box;\n border: none;\n color: #f3f3f3;\n font-family: \"Inter\", sans-serif;\n}\n\na {\n text-decoration: none;\n}\n\nh1, h1 *, h2, h2 *, h3, h3 * {\n font-weight: 700;\n line-height: 3rem;\n font-family: \"Syne\", sans-serif;\n}\n\nh2, h2 * {\n line-height: 2.2rem;\n}\n\nh3, h3 * {\n line-height: 1.5rem;\n}\n\nmain a {\n text-decoration: underline;\n text-decoration-color: #5f44b9;\n text-underline-offset: 2px;\n text-decoration-thickness: 5px;\n transition: 0.2s;\n}\nmain a:hover {\n text-decoration-thickness: 0;\n background: rgba(104, 58, 150, 0.2196078431);\n}\n\nmain p {\n opacity: 0.9;\n}\n\nimg {\n display: block;\n max-width: 100%;\n}\n\nmark {\n color: #f3f3f3;\n background: #5f44b9;\n padding: 5px 7px;\n border-radius: 5px;\n}\n\nkbd {\n font-family: \"Courier New\", Courier, monospace;\n font-weight: 600;\n background: #252a38;\n border-radius: 5px;\n padding: 0.2rem 0.4rem;\n border-bottom: 3px solid #0e0e0e;\n}\n\nblockquote {\n margin-left: 0;\n padding: 1rem 1rem;\n border-left: 5px solid #28aaf0;\n opacity: 0.8;\n background: #252a38;\n width: 100%;\n border-radius: 5px;\n}\nblockquote.error {\n border-left-color: #ef3628;\n}\nblockquote.warning {\n border-left-color: #f09928;\n}\nblockquote.success {\n border-left-color: #28ef6b;\n}\n\ncode {\n font-family: \"Courier New\", Courier, monospace;\n font-weight: 600;\n background: #252a38;\n border-radius: 5px;\n padding: 0.2rem 0.4rem;\n}\n\npre code *, pre code {\n font-weight: normal;\n}\n\np, p *, ol, ul, li {\n line-height: 32px;\n}\n\nh6 {\n opacity: 0.7;\n font-weight: normal;\n}\n\n:focus:not(:focus-visible) {\n outline: none;\n}\n\n.special-gradient {\n background: linear-gradient(45deg, #be89ec 7%, #2867f0 100%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n\n.box {\n margin-bottom: 1rem;\n background: rgba(204, 154, 247, 0.1411764706);\n border: 2px solid rgba(204, 154, 247, 0.1411764706);\n border-radius: 5px;\n padding: 0rem 1rem;\n}\n\n@media (max-width: 900px) {\n body {\n margin: 0 2rem;\n margin-top: 2rem;\n }\n}","$text: #f3f3f3\n$background: #03060d\n$secondary: #252a38\n$secondary-dark: #0e0e0e\n$border: #161d2bb0\n$soft: #fcf7f824\n\n$primary: #5f44b9\n$primary-light: #b88df0\n$primary-glow: #683a9638\n$primary-soft: #cc9af724\n$accent: #28aaf0\n\n$error: #ef3628\n$warn: #f09928\n$success: #28ef6b\n\n$edge: 5px\n\n$main-width: 800px\n$more-width: 1000px\n"]} \ No newline at end of file +{"version":3,"sources":["base.sass","base.css","_vars.sass"],"names":[],"mappings":"AAEA;EACI,uBAAA;ACDJ;;ADGA;EACI,yBELS;ADKb;;ADEA;EACI,gBEUS;EFTT,cAAA;ACCJ;;ADCA;EACI,sBAAA;EACA,YAAA;EACA,cEfG;EFgBH,gCAAA;ACEJ;;ADAA;EACI,qBAAA;ACGJ;;ADAI;EACI,gBAAA;EACA,iBAAA;EACA,+BAAA;ACGR;;ADAI;EACI,mBAAA;ACGR;;ADAI;EACI,mBAAA;ACGR;;ADDA;EACI,0BAAA;EACA,8BE9BM;EF+BN,0BAAA;EACA,8BAAA;EAEA,gBAAA;ACGJ;ADDI;EACI,4BAAA;EACA,4CEpCO;ADuCf;;ADDA;EACI,YAAA;ACIJ;;ADFA;EACI,cAAA;EACA,eAAA;ACKJ;;ADHA;EACI,cEvDG;EFwDH,mBEjDM;EFkDN,gBAAA;EACA,kBAAA;ACMJ;;ADJA;EACI,8CAAA;EACA,gBAAA;EACA,mBE7DQ;EF8DR,kBE/CG;EFgDH,sBAAA;EACA,gCAAA;ACOJ;;ADLA;EACI,cAAA;EACA,kBAAA;EACA,8BAAA;EACA,YAAA;EACA,mBEvEQ;EFwER,WAAA;EACA,kBE1DG;ADkEP;ADNI;EACI,0BEjEA;ADyER;ADPI;EACI,0BElED;AD2EP;ADRI;EACI,0BEnEE;AD6EV;;ADRA;EACI,8CAAA;EACA,gBAAA;EACA,mBErFQ;EFsFR,kBEvEG;EFwEH,sBAAA;ACWJ;;ADRI;EACI,mBAAA;ACWR;;ADRA;EACI,qBAAA;ACWJ;;ADTA;EACI,iBAAA;ACYJ;;ADVA;EACI,YAAA;EACA,mBAAA;ACaJ;;ADXA;EAEI,aAAA;ACaJ;;ADXA;EACI,4DAAA;EACA,6BAAA;EACA,oCAAA;ACcJ;;ADZA;EACI,mBAAA;EACA,6CE3GW;EF4GX,mDAAA;EACA,kBEtGG;EFuGH,kBAAA;ACeJ;;ADbA;EACI;IACI,cAAA;IACA,gBAAA;ECgBN;AACF","file":"base.css","sourcesContent":["@import '_vars'\n\nhtml\n scroll-behavior: smooth\n\nbody\n background-color: $background\n\nnav, main, footer\n max-width: $main-width\n margin: 0 auto\n\n*, *::before, *::after\n box-sizing: border-box\n border: none\n color: $text\n font-family: 'Inter', sans-serif\n\na\n text-decoration: none\n\nh1, h2, h3\n &, *\n font-weight: 700\n line-height: 3rem\n font-family: 'Syne', sans-serif\n\nh2\n &, *\n line-height: 2.2rem\n\nh3\n &, *\n line-height: 1.5rem\n\nmain a\n text-decoration: underline\n text-decoration-color: $primary\n text-underline-offset: 2px\n text-decoration-thickness: 5px\n\n transition: 0.2s\n\n &:hover\n text-decoration-thickness: 0\n background: $primary-glow\n\nmain p\n opacity: 0.9\n\nimg\n display: block\n max-width: 100%\n\nmark\n color: $text\n background: $primary\n padding: 5px 7px\n border-radius: 5px\n\nkbd\n font-family: 'Courier New', Courier, monospace\n font-weight: 600\n background: $secondary\n border-radius: $edge\n padding: 0.2rem 0.4rem\n border-bottom: 3px solid $secondary-dark\n\nblockquote\n margin-left: 0\n padding: 1rem 1rem\n border-left: 5px solid $accent\n opacity: 0.8\n background: $secondary\n width: 100%\n border-radius: $edge\n\n &.error\n border-left-color: $error\n &.warning\n border-left-color: $warn\n &.success\n border-left-color: $success\n\ncode\n font-family: 'Courier New', Courier, monospace\n font-weight: 600\n background: $secondary\n border-radius: $edge\n padding: 0.2rem 0.4rem\n\npre code\n *, &\n font-weight: normal\n\n// fix whitespace at beginning of
\npre\n    white-space: pre-wrap\n\np, p *, ol, ul, li\n    line-height: 32px\n\nh6\n    opacity: 0.7\n    font-weight: normal\n\n:focus:not(:focus-visible)\n\n    outline: none\n\n.special-gradient\n    background: linear-gradient(45deg, #be89ec 7%, #2867f0 100%)\n    -webkit-background-clip: text\n    -webkit-text-fill-color: transparent\n\n.box\n    margin-bottom: 1rem\n    background: $primary-soft\n    border: 2px solid $primary-soft\n    border-radius: $edge\n    padding: 0rem 1rem\n\n@media (max-width: 900px)\n    body\n        margin: 0 2rem\n        margin-top: 2rem\n","html {\n  scroll-behavior: smooth;\n}\n\nbody {\n  background-color: #03060d;\n}\n\nnav, main, footer {\n  max-width: 800px;\n  margin: 0 auto;\n}\n\n*, *::before, *::after {\n  box-sizing: border-box;\n  border: none;\n  color: #f3f3f3;\n  font-family: \"Inter\", sans-serif;\n}\n\na {\n  text-decoration: none;\n}\n\nh1, h1 *, h2, h2 *, h3, h3 * {\n  font-weight: 700;\n  line-height: 3rem;\n  font-family: \"Syne\", sans-serif;\n}\n\nh2, h2 * {\n  line-height: 2.2rem;\n}\n\nh3, h3 * {\n  line-height: 1.5rem;\n}\n\nmain a {\n  text-decoration: underline;\n  text-decoration-color: #5f44b9;\n  text-underline-offset: 2px;\n  text-decoration-thickness: 5px;\n  transition: 0.2s;\n}\nmain a:hover {\n  text-decoration-thickness: 0;\n  background: rgba(104, 58, 150, 0.2196078431);\n}\n\nmain p {\n  opacity: 0.9;\n}\n\nimg {\n  display: block;\n  max-width: 100%;\n}\n\nmark {\n  color: #f3f3f3;\n  background: #5f44b9;\n  padding: 5px 7px;\n  border-radius: 5px;\n}\n\nkbd {\n  font-family: \"Courier New\", Courier, monospace;\n  font-weight: 600;\n  background: #252a38;\n  border-radius: 5px;\n  padding: 0.2rem 0.4rem;\n  border-bottom: 3px solid #0e0e0e;\n}\n\nblockquote {\n  margin-left: 0;\n  padding: 1rem 1rem;\n  border-left: 5px solid #28aaf0;\n  opacity: 0.8;\n  background: #252a38;\n  width: 100%;\n  border-radius: 5px;\n}\nblockquote.error {\n  border-left-color: #ef3628;\n}\nblockquote.warning {\n  border-left-color: #f09928;\n}\nblockquote.success {\n  border-left-color: #28ef6b;\n}\n\ncode {\n  font-family: \"Courier New\", Courier, monospace;\n  font-weight: 600;\n  background: #252a38;\n  border-radius: 5px;\n  padding: 0.2rem 0.4rem;\n}\n\npre code *, pre code {\n  font-weight: normal;\n}\n\npre {\n  white-space: pre-wrap;\n}\n\np, p *, ol, ul, li {\n  line-height: 32px;\n}\n\nh6 {\n  opacity: 0.7;\n  font-weight: normal;\n}\n\n:focus:not(:focus-visible) {\n  outline: none;\n}\n\n.special-gradient {\n  background: linear-gradient(45deg, #be89ec 7%, #2867f0 100%);\n  -webkit-background-clip: text;\n  -webkit-text-fill-color: transparent;\n}\n\n.box {\n  margin-bottom: 1rem;\n  background: rgba(204, 154, 247, 0.1411764706);\n  border: 2px solid rgba(204, 154, 247, 0.1411764706);\n  border-radius: 5px;\n  padding: 0rem 1rem;\n}\n\n@media (max-width: 900px) {\n  body {\n    margin: 0 2rem;\n    margin-top: 2rem;\n  }\n}","$text: #f3f3f3\n$background: #03060d\n$secondary: #252a38\n$secondary-dark: #0e0e0e\n$border: #161d2bb0\n$soft: #fcf7f824\n\n$primary: #5f44b9\n$primary-light: #b88df0\n$primary-glow: #683a9638\n$primary-soft: #cc9af724\n$accent: #28aaf0\n\n$error: #ef3628\n$warn: #f09928\n$success: #28ef6b\n\n$edge: 5px\n\n$main-width: 800px\n$more-width: 1000px\n"]}
\ No newline at end of file
diff --git a/web/static/css/base.sass b/web/static/css/base.sass
index e918a75..e978bc5 100644
--- a/web/static/css/base.sass
+++ b/web/static/css/base.sass
@@ -93,6 +93,10 @@ pre code
     *, &
         font-weight: normal
 
+// fix whitespace at beginning of 
+pre
+    white-space: pre-wrap
+
 p, p *, ol, ul, li
     line-height: 32px
 
diff --git a/web/templates/get-started.html b/web/templates/get-started.html
index b57ba77..e785799 100644
--- a/web/templates/get-started.html
+++ b/web/templates/get-started.html
@@ -13,7 +13,9 @@
     
     
import openai as novaai
 
-novaai.api_base = 'https://api.nova-oss.com/v1'
+novaai.api_base = 'https://api.nova-oss.com/v1' +# you're an enterprise-level donator? use: +# novaai.api_base = 'https://api.nova-oss.com/enterprise/v1'
Info: @@ -23,19 +25,20 @@ novaai.api_base = 'https://api.nova-oss.com/v1'

API Key

+ You can currently only obtain your API key using the Discord server. The API key is something like a password. So keep it safe. Don't share it with anyone!

-
novaai.api_key = 'nv-...'
+
novaai.api_key = 'nv2-...'

curl

curl https://api.nova-oss.com/v1/chat/completions \
         -H "Content-Type: application/json" \
-        -H "Authorization: Bearer nv-..." \
+        -H "Authorization: Bearer nv2-..." \
         -d '{
             "model": "gpt-3.5-turbo",
-            "messages": [{"role": "user", "content": "Whats a wormhole?"}]
+            "messages": [{"role": "user", "content": "1+1="}]
         }'

Unofficial front-ends (Better ChatGPT, ...)

diff --git a/web/templates/index.html b/web/templates/index.html index 791f28f..b3d20a4 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -3,30 +3,36 @@

Free Generative AI for Everyone

-

Open source

+

100% Open Source

- +

Welcome

Nova is a free, open source, easy to use, and powerful API for accessing all sorts of AI models. -
- - Get started -

+

Donate

+

Huge thanks to all donators! You're the reason we can continue serving our project for free.

+
+Bitcoin - bc1qwxc3ww4j7ahtdaqav29h22sh6serluxkrcl7kp
+Litecoin - LcyQ5txPtLmSY6bBDYfKa8raXBw1ZNxaZL
+Ethereum - 0xDE7022779AD09a40A2dc3de7226E073A638b338f
+Monero - please contact us!
+
+

About Nova