Open Kiyliy opened 1 year ago
我修改了我的User_question, 于是出现了使用英文提问可以, 使用中文提问不行的情况 User_question = input("User: ") prompt = r"""{ {"role": "system","content":"You are a function_selector engine, you can only selecte one function from the following functions,and cannot interpret or explain user questions:
1.{{webfun.WebSearch(search=YOUR_SEARCH)}}
2.{{webfun.ReadWeb(IsProxy=bool,url=URL)}}
3.{{echo(str)}}
4.{{Translation(text=TEXT)}}
5.{{AiDrawPrompt()}}
6.{{QuestionAnswer()}}(default function)
7.{{CodeInterpret()}}}",{{"role": "user","content": "select function to assistant user,
please do not explain anything,user question:"""+f"{{{{\"{User_question}\"}}}}"+""" select function like {{exampleFunction()}}"}}"""
我又做了更多的测试, 并略微修改了一下提示词, 我确信这是一个bug: 你们可以尝试下面的代码, 会发现无论如何都会报错, 但是当我在提示词的末尾, """}}select function, 添加一个空格, 变成""" }}select function, 这个代码就会变成下面的情况
from revChatGPT.V1 import Chatbot
def echo(str): return str
chatbot = Chatbot(config={ "access_token": "token" })
print("Chatbot: ") prev_text = "" User_question = input("User: ") prompt_test ="hi" prompt = r"""{ {"role": "system","content":"You are a function_selector engine, you can only selecte one function from the following functions,and cannot interpret or explain user questions:
1.{{webfun.WebSearch(search=YOUR_SEARCH)}}
2.{{webfun.ReadWeb(IsProxy=bool,url=URL)}}
3.{{echo(str)}}
4.{{Translation(text=TEXT)}}
5.{{AiDrawPrompt()}}
6.{{QuestionAnswer()}}(default function)
7.{{CodeInterpret()}}}",{{"role": "user","content": "select function to assistant user,
please do not explain anything,user question:{{"""+f"{User_question}"+"""}}select function like {{exampleFunction()}}"}}"""
print(prompt)
print("type(prompt)=",type(prompt))
print("type(prompt_test)=",type(prompt_test))
for data in chatbot.ask(
prompt,
):
message = data["message"][len(prev_text):]
print(message, end="", flush=True)
prev_text = data["message"]
print()
print("message=",message)
print("prev_text=",prev_text)
print("data=",data)
""""""""""""
Is there an existing issue for this?
What happened?
当我请求的时候, 出现了这个错误, 我认为是我的提示词的缘故, 当我将我的提示词换成了简单的"hi" , 工作起来一切正常 当时当我使用一个结构类似于json格式的str, 会出现这个错误 错误日志: (error log:) """""""""""""""""""""""""""" Traceback (most recent call last): File "e:\Code_project\Python\reChatGPT\venv_reChatGPT\Lib\site-packages\revChatGPT\V1.py", line 870, in __check_response
response.raise_for_status() File "e:\Code_project\Python\reChatGPT\venv_reChatGPT\Lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://bypass.churchless.tech/conversation
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "e:\Code_project\Python\reChatGPT\reChatGPT\dev_plugin0.1.py", line 35, in
for data in chatbot.ask(
File "e:\Code_project\Python\reChatGPT\venv_reChatGPT\Lib\site-packages\revChatGPT\V1.py", line 757, in ask
yield from self.post_messages(
File "e:\Code_project\Python\reChatGPT\venv_reChatGPT\Lib\site-packages\revChatGPT\V1.py", line 710, in post_messages
yield from self.send_request( File "e:\Code_project\Python\reChatGPT\venv_reChatGPT\Lib\site-packages\revChatGPT\V1.py", line 545, in __send_request
self.check_response(response) File "e:\Code_project\Python\reChatGPT\venv_reChatGPT\Lib\site-packages\revChatGPT\V1.py", line 102, in wrapper out = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "e:\Code_project\Python\reChatGPT\venv_reChatGPT\Lib\site-packages\revChatGPT\V1.py", line 877, in __check_response
raise error from ex revChatGPT.typings.Error: OpenAI:
(code: 403) Please check that the input is correct, or you can resolve this issue by filing an issue Project URL: https://github.com/acheong08/ChatGPT
Steps to reproduce the problem
1.运行这个代码便会出现这个错误
def echo(str): return str
chatbot = Chatbot(config={ "access_token": ""
})
print("Chatbot: ") prev_text = "" User_question = input("User: ") prompt_test ="hi" prompt = r"""{ {"role": "system","content":"You are a function_selector engine, you can only selecte one function from the following functions,and cannot interpret or explain user questions:
Console logs
Additional information
No response