sgraaf/chatgpt-php

Possibility to add a system-message with a method

Opened this issue · 1 comments

Now the system message is defined into the constructor.
But is it an idea to set this into a method?

Like: $message = $client->system("My name is Anna, and i'm friendly");

sgraaf commented

Hi! Thank you for raising this issue. 😊

While it is definitely possible (and maybe even trivial) to add the possibility to set the system message via a method rather than via the constructor, I am currently inclined not to do so.

In my mind, initializing the ChatGPT Client is akin to starting a new "session" (i.e. "New chat" on https://chat.openai.com), and the system message is the kick-off to that particular session. So if you want to change the system message, you should start a new "session" by initializing a new ChatGPT Client.

As such, adding the possibility to set the system message via a method rather than the constructor does not really rhyme with my mental model of how the ChatGPT Client should be used.

Besides this, this change would also increase the complexity of the API design slightly, which I am hesitant to do. Not only would I like there to be only one way to do things (and no more), but it also raises the question as to what should happen to the conversation history when you set a new system message? Should it be cleared? Should it be kept? Should it be modified in some way? I don't know the correct answer to this question (if there is one).

I hope you understand my reasoning. 😄 If you have any further thoughts on this, please let me know. I am definitely willing to consider this further if you have a compelling argument for it.