Not sure how OpenAI API sessions work

Hi, I am new here, so bear with me.

I am trying to make a chat client, and as for the chat part, it goes fine.

I then wanted to add some narrative elements to the chat, so I added functionality that occasionally sends a request like “describe a beautiful sunset”. It is obviously a bit more complicated than that, but that is the gist of it.

In the chat requests I send “old” dialog, and the basic settings each time, like location, time of day etc. to get a meaningful dialog going. In the narrative requests, I only send the narrative, ie. no location and time of day.
It basically works fine, but occasionally the api is having troubles distinguishing dialog from narratives, so I switched to two http clients, one for chat and one for narratives.

And here comes my question.

Switching to two http clients, the narrative client suddenly becomes unaware of the basic settings. I realized that I never sent them, but why did it then work on a single http client? Should each request not be a 100% isolated incident?
What am I missing here?

This is done in C# on gpt3.5-turbo.



To answer your question:

Yes, the API is stateless. Without having seen your code it is clear that you have send information without meaning to do so.

Thanks for confirming that.

Coming from a 100% programming background, and being new to AI, I think I might simply be fooled by the fact that the AI sometimes creates “creative” responses. Even with temperature and top_p tweaked.

After switching to two http clients, I suddenly got two replies about it being the wrong time of day, but it is probably just the AI “making things up”.


1 Like