tbckr / sgpt

SGPT is a command-line tool that provides a convenient way to interact with OpenAI models, enabling users to run queries, generate shell commands and produce code directly from the terminal.
MIT License
202 stars 22 forks source link

"No stream" mode does not work #249

Closed johnd0e closed 1 month ago

johnd0e commented 2 months ago

What happened?

There is an command line option to "--stream" output. But even when I do not specify it - the output is also streamed.

How can we reproduce this?

sgpt "tell me a story"

As there is no options, I expect the output appears all at once, but it is streamed instead.

sgpt version

2.13.0

Search

Project

Code of Conduct

Additional context

No response

tbckr commented 2 months ago

Hey, thank you for your bug report. Could you please share your configuration with me? You can get your current config with the sgpt config show command.

johnd0e commented 2 months ago
maxtokens: 2048
model: gpt-4
stream: true
temperature: "0.7"
topp: "1"

And after reading https://sgpt.readthedocs.io/en/latest/configuration/, I now see the point:

These options override the default values for the corresponding command line options.

But that seems not good to me. The common pattern is opposite: commandline options, being dynamic, should have higher priority over static config file.

tbckr commented 1 month ago

You are correct. What you describe is the intended behavior and the implemented state. If you do not want your response to be streamed, remove the entry from the config file or set it to false. The default for streaming is false.

If you specify the stream flag from the command line, the response is streamed. See the help output for more information.

The command line flags override the configuration values.