Skip to content

Commit

Permalink
1. Fix 400 Bad Request max_tokens error
Browse files Browse the repository at this point in the history
2. update g4f version to 0.1.8.2
  • Loading branch information
yym68686 committed Nov 13, 2023
1 parent 1b4a30e commit 834bfa1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,5 @@ The markdown rendering of the message used is another [project](https://github.c

## License

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
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.

4 changes: 2 additions & 2 deletions chatgpt2api/chatgpt2api.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def ask_stream(
Ask a question
"""
# Make conversation if it doesn't exist
if convo_id not in self.conversation:
if convo_id not in self.conversation or pass_history == False:
self.reset(convo_id=convo_id, system_prompt=self.system_prompt)
self.add_to_conversation(prompt, "user", convo_id=convo_id)
self.__truncate_conversation(convo_id=convo_id)
Expand Down Expand Up @@ -371,7 +371,7 @@ async def ask_stream_async(
Ask a question
"""
# Make conversation if it doesn't exist
if convo_id not in self.conversation:
if convo_id not in self.conversation or pass_history == False:
self.reset(convo_id=convo_id, system_prompt=self.system_prompt)
self.add_to_conversation(prompt, "user", convo_id=convo_id)
self.__truncate_conversation(convo_id=convo_id)
Expand Down
1 change: 0 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from chatgpt2api.chatgpt2api import Imagebot
if API:
ChatGPTbot = GPT(api_key=f"{API}", engine=GPT_ENGINE, system_prompt=systemprompt, temperature=temperature)
Claude2bot = GPT(api_key=f"{API}", engine="claude-2-web")
dallbot = Imagebot(api_key=f"{API}")
else:
ChatGPTbot = None
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ unstructured[pdf]
duckduckgo-search==3.8.5
langchain==0.0.271
oauth2client==3.0.0
g4f==0.1.8.0
g4f==0.1.8.2

0 comments on commit 834bfa1

Please sign in to comment.