Comments (2)
我修改了我的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:
```json
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()}}"}}"""
from chatgpt.
我又做了更多的测试, 并略微修改了一下提示词, 我确信这是一个bug:
你们可以尝试下面的代码, 会发现无论如何都会报错, 但是当我在提示词的末尾, """}}select function, 添加一个空格, 变成""" }}select function, 这个代码就会变成下面的情况
- "英文" : 正常, 示例: "hi"
- "中文: error ,示例: "你好"
- 中文+英文 ,正常 , 示例: 你好 hi
- 英文+ 中文, error, 示例, hi 你好
"""""""""""""
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:
```json
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)
""""""""""""
from chatgpt.
Related Issues (20)
- The Functions HOT 1
- [Feature Request]: Additions to Awesome ChatGPT HOT 1
- [Bug]: ValueError: PUID is required HOT 1
- [Bug]: Error querying GPT 4 HOT 7
- [Bug]: access_denied: Your version of the ChatGPT app is out of date. Please update to the newest build of the app. HOT 11
- [Bug]: Field missing. Details: {'conversation_id': 'abf665f2-3c8f-4725-8263-5893bb5847ff', 'message_id': 'b8fe1067-2610-4bea-b33b-93b099b3803b', 'is_completion': False, 'moderation_response': {'flagged': False, 'blocked': False, 'moderation_id': 'modr-7eEtljxtdnGEn9sCjBEKoPBeuGh7M'}} HOT 13
- ValueError: Field missing. Details: {'conversation_id': '289a9ec4-cf13-45f5-bc3f-f96046e487c7', 'message_id': 'a5be1cb9-610f-4c53-a019-73abfd2b68ab', 'is_completion': False, 'moderation_response': {'flagged': False, 'blocked': False, 'moderation_id': 'modr-7eJ0uKhi6TSRvHoiBzCxVBTu7GA2v'}} HOT 4
- [Bug]: 应该是chat.openai新更新的json返回的格式,导致了现在只有message_id,没message这个字段了 HOT 3
- [Bug]: Support for 32bit and Arm processors
- Email/Password storing the Access token HOT 3
- [Bug]: Exception(resp_json.get("error", "Unknown error")) Exception: unable to log requests HOT 2
- [Bug]: https://bypass.churchless.tech/conversation HOT 1
- I registered on https://nat.dev verified by email however I am not getting verification code on mobile and that bug is not letting me login[Bug]:
- It asks to manually input captcha HOT 8
- [Feature Request]: personal advice HOT 2
- A timeout occurred Error code 524
- [Bug]:
- revChatGPT.typings.Error: OpenAI: {"error":"Post \"https://tcr9i.chat.openai.com/fc/gt2/public_key/35536E1E-65B4-4D96-9D97-6ADB7EFF8147\": http2: server sent GOAWAY and closed the connection; LastStreamID=1, ErrCode=ENHANCE_YOUR_CALM, debug=\"\""} (code: 500) HOT 1
- [Bug]: access token is expired in a minute! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt.