Skip to content

Commit 834bfa1

Browse files
committed
1. Fix 400 Bad Request max_tokens error
2. update g4f version to 0.1.8.2
1 parent 1b4a30e commit 834bfa1

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,5 @@ The markdown rendering of the message used is another [project](https://github.c
182182

183183
## License
184184

185-
This project is licensed under GPLv3, which means you are free to copy, distribute, and modify the software, as long as all modifications and derivative works are also released under the same license
185+
This project is licensed under GPLv3, which means you are free to copy, distribute, and modify the software, as long as all modifications and derivative works are also released under the same license.
186186

chatgpt2api/chatgpt2api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def ask_stream(
268268
Ask a question
269269
"""
270270
# Make conversation if it doesn't exist
271-
if convo_id not in self.conversation:
271+
if convo_id not in self.conversation or pass_history == False:
272272
self.reset(convo_id=convo_id, system_prompt=self.system_prompt)
273273
self.add_to_conversation(prompt, "user", convo_id=convo_id)
274274
self.__truncate_conversation(convo_id=convo_id)
@@ -371,7 +371,7 @@ async def ask_stream_async(
371371
Ask a question
372372
"""
373373
# Make conversation if it doesn't exist
374-
if convo_id not in self.conversation:
374+
if convo_id not in self.conversation or pass_history == False:
375375
self.reset(convo_id=convo_id, system_prompt=self.system_prompt)
376376
self.add_to_conversation(prompt, "user", convo_id=convo_id)
377377
self.__truncate_conversation(convo_id=convo_id)

config.py

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from chatgpt2api.chatgpt2api import Imagebot
2525
if API:
2626
ChatGPTbot = GPT(api_key=f"{API}", engine=GPT_ENGINE, system_prompt=systemprompt, temperature=temperature)
27-
Claude2bot = GPT(api_key=f"{API}", engine="claude-2-web")
2827
dallbot = Imagebot(api_key=f"{API}")
2928
else:
3029
ChatGPTbot = None

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ unstructured[pdf]
1616
duckduckgo-search==3.8.5
1717
langchain==0.0.271
1818
oauth2client==3.0.0
19-
g4f==0.1.8.0
19+
g4f==0.1.8.2

0 commit comments

Comments
 (0)