-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta
Description
Describe the bug
When adding the --stream
parameter to the OpenAI command, an error occurred.
To Reproduce
When adding the --stream
parameter to the OpenAI command, an error occurred.
> openai api chat_completions.create -m gpt-3.5-turbo -g user "Hello" --stream
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\openai.exe\__main__.py", line 7, in <module>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\openai\_openai_scripts.py", line 70, in main
args.func(args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\openai\cli.py", line 144, in create
sys.stdout.write(c["message"]["content"])
KeyError: 'message'
Code snippets
No response
OS
Windows
Python version
Python v3.10.6
Library version
openai v0.27.4
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta