From 346033a796c5cb253ad7e531b0bd3d9acb065d98 Mon Sep 17 00:00:00 2001 From: NghiaDinh003 <92510310055@Ãispace.edu.vn> Date: Tue, 20 Jun 2023 21:14:50 +0700 Subject: [PATCH] add feedback feature --- Pipfile.lock | 74 +++++++++++++++++++++++----------------------------- chat.py | 13 +++++++++ 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index b543301..e914818 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "c8c2610ea6cf8a550e350124e0833a4b4a2f51757b3b81990aa5074552a1969e" + "sha256": "d3f378ddd9846512a9ecd84c93fffa1e2ebc7c2086158f9e49b86d1ba78ee75c" }, "pipfile-spec": 6, "requires": { @@ -339,6 +339,14 @@ "markers": "python_version >= '3.7'", "version": "==8.1.3" }, + "colorama": { + "hashes": [ + "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", + "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" + ], + "markers": "platform_system == 'Windows'", + "version": "==0.4.6" + }, "cryptography": { "hashes": [ "sha256:059e348f9a3c1950937e1b5d7ba1f8e968508ab181e75fc32b879452f08356db", @@ -387,14 +395,6 @@ "markers": "python_version >= '3.6'", "version": "==0.4" }, - "exceptiongroup": { - "hashes": [ - "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e", - "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785" - ], - "markers": "python_version < '3.11'", - "version": "==1.1.1" - }, "firebase-admin": { "hashes": [ "sha256:3daa806d16a35d83a809a70a325f973ba9dc242601fe69cd68e6f54a6ffdcd57", @@ -504,11 +504,11 @@ "grpc" ], "hashes": [ - "sha256:25d29e05a0058ed5f19c61c0a78b1b53adea4d9364b464d014fbda941f6d1c9a", - "sha256:d92a5a92dc36dd4f4b9ee4e55528a90e432b059f93aee6ad857f9de8cc7ae94a" + "sha256:6fb380f49d19ee1d09a9722d0379042b7edb06c0112e4796c7a395078a043e71", + "sha256:7421474c39d396a74dfa317dddbc69188f2336835f526087c7648f91105e32ff" ], "markers": "platform_python_implementation != 'PyPy'", - "version": "==2.11.1" + "version": "==1.34.0" }, "google-api-python-client": { "hashes": [ @@ -780,11 +780,11 @@ }, "httpcore": { "hashes": [ - "sha256:c5d6f04e2fc530f39e0c077e6a30caa53f1451096120f1f38b954afd0b17c0cb", - "sha256:da1fb708784a938aa084bde4feb8317056c55037247c787bd7e19eb2c2949dc0" + "sha256:125f8375ab60036db632f34f4b627a9ad085048eef7cb7d2616fea0f739f98af", + "sha256:5581b9c12379c4288fe70f43c710d16060c10080617001e6b22a3b6dbcbefd36" ], "markers": "python_version >= '3.7'", - "version": "==0.16.3" + "version": "==0.17.2" }, "httplib2": { "hashes": [ @@ -796,19 +796,19 @@ }, "httpx": { "hashes": [ - "sha256:9818458eb565bb54898ccb9b8b251a28785dd4a55afbc23d0eb410754fe7d0f9", - "sha256:a211fcce9b1254ea24f0cd6af9869b3d29aba40154e947d2a07bb499b3e310d6" + "sha256:06781eb9ac53cde990577af654bd990a4949de37a28bdb4a230d434f3a30b9bd", + "sha256:5853a43053df830c20f8110c5e69fe44d035d850b2dfe795e196f00fdb774bdd" ], "markers": "python_version >= '3.7'", - "version": "==0.23.3" + "version": "==0.24.1" }, "httpx-oauth": { "hashes": [ - "sha256:11a2c79111e61a7bd70624606ad6a3013b6756ce4817dd5d5b44f70bacb45940", - "sha256:690e4d0a03b1974b9e600436a6d7a8c064e0707a3d86a41a12153cc797244ac6" + "sha256:40c839b3863f41db110e5cffb85ab4549ad9d3cf4a8e69ec4f195fda11260ac6", + "sha256:f76e7fab029e70ff2bd2d82af51aac2a52dfcacf35835458a145a1bd4a322268" ], "markers": "python_version >= '3.7'", - "version": "==0.11.2" + "version": "==0.12.0" }, "idna": { "hashes": [ @@ -844,19 +844,19 @@ }, "langchain": { "hashes": [ - "sha256:1ea8cfa641a1fc5dbc40d543f4b4fe6f308d0db6460ffb24267f434789bde30d", - "sha256:f6423dcc95d6feaa5e78aeaedd6e1b3ef7a03be0a02c2508dffaab26c83ae858" + "sha256:5e401c45eb8facba78ae9c8c85d3bb97d12cfe025b498ef8ade058956eae5d50", + "sha256:98acf40c6169f53e6c289024a5f06988639c409e290dff6f9b86cb6896fa8ca3" ], "markers": "python_version < '4.0' and python_full_version >= '3.8.1'", - "version": "==0.0.204" + "version": "==0.0.206" }, "langchainplus-sdk": { "hashes": [ - "sha256:e50679309a31d9526f467aa13d4dbcfba0dc00a295cea72ffcc9972865ecac1b", - "sha256:fbe3482ffe253e439ec8386a2904594a875b590e29e4adcbd938452a69a6c7c6" + "sha256:2894e8ca1bbd41404925c3916099cd31ccea74e558a311c9aad67e02bcfa5ef8", + "sha256:2fc067dd038edcf18086d342da2c690984c4d37f9bfa684ffccaea34b43edb28" ], "markers": "python_version < '4.0' and python_full_version >= '3.8.1'", - "version": "==0.0.11" + "version": "==0.0.16" }, "markdown-it-py": { "hashes": [ @@ -1297,10 +1297,10 @@ }, "promptlayer": { "hashes": [ - "sha256:a7ed3875416d4f29c07a3f5ffe803b42ed9745d741f79cd4ed164deb3f312f3e" + "sha256:116739ffdf2a8a592364b86b8fa3e6f83810f185ed782b378988d039568312df" ], "index": "pypi", - "version": "==0.1.89" + "version": "==0.1.90" }, "proto-plus": { "hashes": [ @@ -1587,16 +1587,6 @@ "markers": "python_version >= '3.7'", "version": "==2.31.0" }, - "rfc3986": { - "extras": [ - "idna2008" - ], - "hashes": [ - "sha256:270aaf10d87d0d4e095063c65bf3ddbc6ee3d0b226328ce21e036f946e421835", - "sha256:a86d6e1f5b1dc238b218b012df0aa79409667bb209e58da56d0b94704e712a97" - ], - "version": "==1.5.0" - }, "rich": { "hashes": [ "sha256:8f87bc7ee54675732fa66a05ebfe489e27264caeeff3728c945d25971b6485ec", @@ -2029,11 +2019,11 @@ }, "setuptools": { "hashes": [ - "sha256:5df61bf30bb10c6f756eb19e7c9f3b473051f48db77fddbe06ff2ca307df9a6f", - "sha256:62642358adc77ffa87233bc4d2354c4b2682d214048f500964dbe760ccedf102" + "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f", + "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235" ], "markers": "python_version >= '3.7'", - "version": "==67.8.0" + "version": "==68.0.0" }, "virtualenv": { "hashes": [ diff --git a/chat.py b/chat.py index b085a08..eed68e4 100644 --- a/chat.py +++ b/chat.py @@ -75,6 +75,19 @@ def render_new_chat(sidebar): ): reinitialize_chat(model_type) + if model_type == "gpt-4": + render_feedback_link(sidebar) + + +def render_feedback_link(sidebar): + Feedback_text = "Share Your Feedback with Us!!!" + Feedback_link = "https://coda.io/form/PusherGPT-Quick-Like-Wish_dWWuBv7G80O" + styled_text = ( + f"

" + f"{Feedback_text}

" + ) + sidebar.markdown(styled_text, unsafe_allow_html=True) + def reinitialize_chat(model: str): st.session_state["conversation"] = DEFAULT_CONVERSATION