Closed cancelself closed 9 months ago
Currently the chat API uses the role
value to identify the "speaker" as the user, assistant, or system. Do you have a link to any documentation that mentions using the name
value?
@FizzyAgent see:
But I do agree that it's weird that it's not specified in the official documentation.
In addition to @ character I would strongly suggest we enable:
Very useful for a multi user chatbot.
ß should also be enabled. It is a very common char for a chatbot
Thanks for filing, this feature request makes sense to me and I've pass it along to the backend teams.
I'm going to close this since it's not a limitation imposed in the Python library; if you'd like to continue to advocate for it, I recommend community.openai.com
Describe the bug
Lots of existing usernames contain @ as namespace and prefixing. Complete understand why this is defined narrowly, but you are pushing a bunch of work on to developers and this surprised me.
File "/Users/dmp/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py", line 679, in _interpret_response_line raise self.handle_errorresponse( openai.error.InvalidRequestError: '@username' does not match '^[a-zA-Z0-9-]{1,64}$' - 'messages.6.name'
To Reproduce
`#add the user + message in the third argument whoiam = getpass.getuser() whoiam = "@" + whoiam prompt = {"role": "user", "content": sys.argv[3], "name": whoiam}
talk to chatGPT
completion = openai.ChatCompletion.create( model = "gpt-3.5-turbo", messages = chatml + [prompt] )`
Code snippets
OS
macOS
Python version
Python
Library version
openai-python