Hello folks
I’m new to working with all things openAI APIs (so apologies, I’m a newb here). Most of the other forum posts that are similar to this questions are out of date or don’t provide enough insight for me to get traction.
I’m simply trying to allow an assistant to have a conversation using the C# sdk. I can get the initial set up working with the first message but all my attempts to add to the thread just end up with the assistant going back to whatever initial message was passed in. It seems like this should be easier to do. Here’s what I’ve got for the code, just no clue how to add a message to the thread for the next run in the else statement below. Any help is greatly appreciated.
ThreadRun run;
if (string.IsNullOrEmpty(_threadId))
{
var threadOptions = new ThreadCreationOptions
{
InitialMessages =
{
new ThreadInitializationMessage(MessageRole.User, new { MessageContent.FromText(userMessage) })
}
};
run = _assistantClient.CreateThreadAndRun(assistantId, threadOptions);
_threadId = run.ThreadId; // Store the thread ID for later use
}
else
{
//???
}