minimaxir / simpleaichat

Python package for easily interfacing with chat apps, with robust features and minimal code complexity.
MIT License
3.43k stars 224 forks source link

[feature req]parameter n support #59

Closed HaveF closed 11 months ago

HaveF commented 11 months ago

Great lib, Thanks, Max!

Btw, I find it don't support parameter n: https://github.com/minimaxir/simpleaichat/blob/main/simpleaichat/chatgpt.py#L111

https://platform.openai.com/docs/api-reference/chat/create#chat/create-n

n Defaults to 1
How many chat completion choices to generate for each input message.

This parameter can improve diversity and make it easier for users to observe multiple results at once, and I think this parameter is somewhat underestimated.

LLMs tend to answer questions in an expert tone, will be very easy to give a single authoritative answer, and this parameter adds variety, and it would be great if it had this parameter. But it's not clear how to add this feature so as not to break the existing structure...

minimaxir commented 11 months ago

This is probably a good idea to support at some point, however there are usability concerns with it, especially around conversation persistence.

However, since async sessions/calls allow both multiple conversations and handles multiple conversation persistence correctly, that's the more recommended workflow currently to handle it.

LLMs tend to answer questions in an expert tone, will be very easy to give a single authoritative answer, and this parameter adds variety, and it would be great if it had this parameter.

The intended way resolve that is through system prompt engineering, and with latest ChatGPT it does a good job of it.

HaveF commented 11 months ago

That makes sense, thanks for your input.

however there are usability concerns with it, especially around conversation persistence.