From 104e58a3421665fc3acfd7fea8e1317fe1181c6d Mon Sep 17 00:00:00 2001 From: noptuno Date: Thu, 27 Apr 2023 20:48:00 -0400 Subject: [PATCH] merged pr #218 with the new streamlit --- .gitignore | 2 ++ conversations.pkl | Bin 3989 -> 5160 bytes gui/query_methods.py | 24 ++++++++---------- gui/streamlit_chat_app.py | 4 +-- .../__pycache__/__init__.cpython-39.pyc | Bin 4705 -> 4705 bytes .../forefront/__pycache__/mail.cpython-39.pyc | Bin 2387 -> 2387 bytes .../__pycache__/models.cpython-39.pyc | Bin 1048 -> 1048 bytes .../quora/__pycache__/__init__.cpython-39.pyc | Bin 16849 -> 16849 bytes .../quora/__pycache__/api.cpython-39.pyc | Bin 14020 -> 14020 bytes .../quora/__pycache__/mail.cpython-39.pyc | Bin 2456 -> 2456 bytes .../theb/__pycache__/__init__.cpython-39.pyc | Bin 1897 -> 1897 bytes .../you/__pycache__/__init__.cpython-39.pyc | Bin 3467 -> 3467 bytes 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index b063aca..4034c08 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,8 @@ accounts.txt **/__pycache__/ +__pycache__/ + *.log cookie.json diff --git a/conversations.pkl b/conversations.pkl index 19b5cb1d2489580b33c02baac5789f2fb3ebdfa4..83d79d345f20dac4581ad00dd539e05ad6af74f9 100644 GIT binary patch delta 1142 zcmY*Y%Z?OB5L~R`h&X`70U@X6Vh+tPaItTecaa4LkR{_a;+9jLJymRVRjVG;ZeNBE zKu8wLKlsWI@fCakkv+TCa_R2MuF8mvi2C@$fA_DyU3|QE`_uLJH$Qw?+`4oB-NHuC z=kIQemP@8OP+QH}zw5jESDWvSj$T@!F{YN5x@}1=(;ou|mo0TMp(@_TCC#61*${`8 zTp`1O*yl(|I!RO_?KrtuGZpK?Hj@j+*A}0|)bp1AaX}h7{rv@HNjqnx+0VWD>Wdq^ z(BRofo@<@t;&y1iqGy4Mq&`#Z0A(Z;k{zD8p_9q@7=)gJH;s&=XuXppR8kzAVNd2_ zOTp+mPA?!I=s722Y5#cr=;s;Fa!c85gX?fg5xPzcv|^KD&UDJ5a;Xjd=H9r5UdTu% z?4^yt@j(zRy%zQmXGN;$C9vU|fhm6%3EAz0T80>+Bu@92ZReUQ1(92fp5ipGFbh3u zep;^ywQ5RDg0WL|L4SkWfTjAOC|W8u2_S@vg>=ex{{0PMa2X^y31$ysLAKs)-3Iz! z4BgOZ9hO%{qRb;%;oU@u!CWDgB@jm!+Dw~T$RkwFPsF?ET6FID4aRZ(z)*5^{_69! zqoZd<<2682McjigY?)%k=7}sr9v2{#9!H=!pV3l7`=h3|p*EUdmh?dR!96r8Dl`{k z2b(wx%~EeBI9IIrIF%R!#CaOWy@sXHE{F_%&T&SD>Ly9s&KdV` znbJeOFc+{IUQMZ{&BVU1!If#gDaA%`7;U68kwLxmQ4PmgwJFnxo22ipNR}1-dPhNA z4D9`MmBxpgi|_ZKI)g9&ItcJ51bBj0P~b3s2bVPvSEp5Do^aPq^VVke1=kUmF;j@; qlEj0v5XYblM_2{V<~xi;U|8@|`I>`%Q2vU*4PCPN-;Q&svib^4Fp=#5 delta 17 YcmZ3XF;$+mfn{nJ|3=n6ex_7C05YrvBme*a diff --git a/gui/query_methods.py b/gui/query_methods.py index 08a81b6..4994690 100644 --- a/gui/query_methods.py +++ b/gui/query_methods.py @@ -53,19 +53,19 @@ def query_you(question: str) -> str: # Return error message if an exception occurs return f'An error occurred: {e}. Please make sure you are using a valid cloudflare clearance token and user agent.' -# Define a dictionary containing all query methods -avail_query_methods = { - "Forefront": query_forefront, - "Poe": query_quora, - "Theb": query_theb, - "You": query_you, - # "Writesonic": query_writesonic, - # "T3nsor": query_t3nsor, - # "Phind": query_phind, - # "Ora": query_ora, -} def query(user_input: str, selected_method: str = "Random") -> str: + # Define a dictionary containing all query methods + avail_query_methods = { + "Forefront": query_forefront, + "Poe": query_quora, + "Theb": query_theb, + "You": query_you, + # "Writesonic": query_writesonic, + # "T3nsor": query_t3nsor, + # "Phind": query_phind, + # "Ora": query_ora, + } # If a specific query method is selected (not "Random") and the method is in the dictionary, try to call it if selected_method != "Random" and selected_method in avail_query_methods: @@ -98,5 +98,3 @@ def query(user_input: str, selected_method: str = "Random") -> str: return result - -__all__ = ['query', 'avail_query_methods'] diff --git a/gui/streamlit_chat_app.py b/gui/streamlit_chat_app.py index 09d53bc..aee3563 100644 --- a/gui/streamlit_chat_app.py +++ b/gui/streamlit_chat_app.py @@ -5,10 +5,11 @@ sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir)) import streamlit as st from streamlit_chat import message -from query_methods import query, avail_query_methods +from query_methods import query import pickle import openai_rev + conversations_file = "conversations.pkl" def load_conversations(): @@ -71,7 +72,6 @@ if st.sidebar.button("New Conversation"): st.session_state['current_conversation'] = {'user_inputs': [], 'generated_responses': []} st.session_state['input_field_key'] += 1 -print(openai_rev.Provider.__methods__.keys()) st.session_state['query_method'] = st.sidebar.selectbox( "Select API:", options=openai_rev.Provider.__members__.keys(), diff --git a/openai_rev/forefront/__pycache__/__init__.cpython-39.pyc b/openai_rev/forefront/__pycache__/__init__.cpython-39.pyc index f1b82a233b848e752b00ecf7deef47fa65d3787a..4e76781df5d64640cf018ec04e93a7b7e66cbc90 100644 GIT binary patch delta 19 ZcmaE;@=%2g? diff --git a/openai_rev/forefront/__pycache__/mail.cpython-39.pyc b/openai_rev/forefront/__pycache__/mail.cpython-39.pyc index c903d3db397af7a549facae634e40c3544b4b8c5..b5500715218ac6366482b52fb0a70013de39d193 100644 GIT binary patch delta 19 ZcmcaCbXkZik(ZZ?0SKBzH*$G$0stmxmx}=innX8p9d`r(Lc0Z& delta 21 bcmccE%y_Yxkt>mxmx}=i)c7}Y9d`r(Ky?K& diff --git a/openai_rev/quora/__pycache__/api.cpython-39.pyc b/openai_rev/quora/__pycache__/api.cpython-39.pyc index 01645ec77328a414109ae8340ac5a7f904502ff1..ef34e4ed1eaf577a4240a54af6ee4aaf2dff9efa 100644 GIT binary patch delta 19 ZcmX?-dnA`Dk(ZZ?0SKBzH*)PV0{}U-1vCHv delta 19 ZcmX?-dnA`Dk(ZZ?0SMIiH*)PV0{}N~1kwNi diff --git a/openai_rev/quora/__pycache__/mail.cpython-39.pyc b/openai_rev/quora/__pycache__/mail.cpython-39.pyc index 009a06efbcf194b558a3b0f4fe170a8fbc7bfcd5..ddbea7040d3260bf7b97196cfc210ed01a389ae0 100644 GIT binary patch delta 19 ZcmbOsJVTf(k(ZZ?0SKBzH*)oH0stor1J3{e delta 19 ZcmbOsJVTf(k(ZZ?0SMIiH*)oH0sth&18o2R diff --git a/openai_rev/theb/__pycache__/__init__.cpython-39.pyc b/openai_rev/theb/__pycache__/__init__.cpython-39.pyc index 00d672bd5acba958d1b343ebe9b06e45c2ca348d..812a9f017ecafce8d7b9faaabc2001d2e32535a7 100644 GIT binary patch delta 19 ZcmaFK_mYn*k(ZZ?0SKBzH*&?Z0{}5*1U3Kw delta 19 ZcmaFK_mYn*k(ZZ?0SMIiH*&?Z0{|}|1JnQj diff --git a/openai_rev/you/__pycache__/__init__.cpython-39.pyc b/openai_rev/you/__pycache__/__init__.cpython-39.pyc index 7ba27a735f2b51270aee52d686a2469ffd85428d..54caf6ef170984e4c8db41cfa42b176de887e6c0 100644 GIT binary patch delta 19 YcmeB{?w00Cmbja-eq046d6yZ`_I delta 19 YcmeB{?w00C