返回提交历史
Modified
.gitignore
+2
-0
Modified
conversations.pkl
+0
-0
Modified
gui/query_methods.py
+11
-13
Modified
gui/streamlit_chat_app.py
+2
-2
Modified
openai_rev/forefront/__pycache__/__init__.cpython-39.pyc
+0
-0
Modified
openai_rev/forefront/__pycache__/mail.cpython-39.pyc
+0
-0
Modified
openai_rev/forefront/__pycache__/models.cpython-39.pyc
+0
-0
Modified
openai_rev/quora/__pycache__/__init__.cpython-39.pyc
+0
-0
Modified
openai_rev/quora/__pycache__/api.cpython-39.pyc
+0
-0
Modified
openai_rev/quora/__pycache__/mail.cpython-39.pyc
+0
-0
Modified
openai_rev/theb/__pycache__/__init__.cpython-39.pyc
+0
-0
Modified
openai_rev/you/__pycache__/__init__.cpython-39.pyc
+0
-0
XFEstudio/gpt4free
merged pr #218 with the new streamlit
104e58a3
代码差异
12 个文件
+15
-15
@@ -20,6 +20,8 @@ accounts.txt
20
20
21
21
**/__pycache__/
22
22
23
__pycache__/
24
23
25
*.log
24
26
25
27
cookie.json
二进制文件已变更,无法进行逐行预览。
@@ -53,19 +53,19 @@ def query_you(question: str) -> str:
53
53
# Return error message if an exception occurs
54
54
return f'An error occurred: {e}. Please make sure you are using a valid cloudflare clearance token and user agent.'
55
55
56
# Define a dictionary containing all query methods
57
avail_query_methods = {
58
"Forefront": query_forefront,
59
"Poe": query_quora,
60
"Theb": query_theb,
61
"You": query_you,
62
# "Writesonic": query_writesonic,
63
# "T3nsor": query_t3nsor,
64
# "Phind": query_phind,
65
# "Ora": query_ora,
66
}
67
56
68
57
def query(user_input: str, selected_method: str = "Random") -> str:
58
# Define a dictionary containing all query methods
59
avail_query_methods = {
60
"Forefront": query_forefront,
61
"Poe": query_quora,
62
"Theb": query_theb,
63
"You": query_you,
64
# "Writesonic": query_writesonic,
65
# "T3nsor": query_t3nsor,
66
# "Phind": query_phind,
67
# "Ora": query_ora,
68
}
69
69
70
70
# If a specific query method is selected (not "Random") and the method is in the dictionary, try to call it
71
71
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:
98
98
99
99
return result
100
100
101
102
__all__ = ['query', 'avail_query_methods']
@@ -5,10 +5,11 @@ sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir))
5
5
6
6
import streamlit as st
7
7
from streamlit_chat import message
8
from query_methods import query, avail_query_methods
8
from query_methods import query
9
9
import pickle
10
10
import openai_rev
11
11
12
12
13
conversations_file = "conversations.pkl"
13
14
14
15
def load_conversations():
@@ -71,7 +72,6 @@ if st.sidebar.button("New Conversation"):
71
72
st.session_state['current_conversation'] = {'user_inputs': [], 'generated_responses': []}
72
73
st.session_state['input_field_key'] += 1
73
74
74
print(openai_rev.Provider.__methods__.keys())
75
75
st.session_state['query_method'] = st.sidebar.selectbox(
76
76
"Select API:",
77
77
options=openai_rev.Provider.__members__.keys(),
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。