[Bugfix] Honor explicit empty and zero CLI arguments (#55710)
Signed-off-by: Cenab Batu Bora <40250311+cenab@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -171,7 +171,7 @@ class ChatCommand(CLISubcommand):
|
|||||||
if stats:
|
if stats:
|
||||||
create_kwargs["stream_options"] = {"include_usage": True}
|
create_kwargs["stream_options"] = {"include_usage": True}
|
||||||
|
|
||||||
if args.quick:
|
if args.quick is not None:
|
||||||
conversation.append({"role": "user", "content": args.quick})
|
conversation.append({"role": "user", "content": args.quick})
|
||||||
|
|
||||||
stream = client.chat.completions.create(
|
stream = client.chat.completions.create(
|
||||||
@@ -248,12 +248,12 @@ class CompleteCommand(CLISubcommand):
|
|||||||
"model": model_name,
|
"model": model_name,
|
||||||
"stream": True,
|
"stream": True,
|
||||||
}
|
}
|
||||||
if args.max_tokens:
|
if args.max_tokens is not None:
|
||||||
kwargs["max_tokens"] = args.max_tokens
|
kwargs["max_tokens"] = args.max_tokens
|
||||||
if stats:
|
if stats:
|
||||||
kwargs["stream_options"] = {"include_usage": True}
|
kwargs["stream_options"] = {"include_usage": True}
|
||||||
|
|
||||||
if args.quick:
|
if args.quick is not None:
|
||||||
stream = client.completions.create(prompt=args.quick, **kwargs)
|
stream = client.completions.create(prompt=args.quick, **kwargs)
|
||||||
_print_completion_stream(stream, stats)
|
_print_completion_stream(stream, stats)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user