Is Semantic Kernel dependent on the deployment version of GPT?

Thibault Verlinde 120 Reputation points
2024-03-19T15:33:03.2333333+00:00

Hiya

I'm currently making a chatbot by using the RAG principle. I made a zero-shot version that doesn't use history or anything. This works perfectly.
I recently started creating a version that uses the history of the chat. I'm encountering a problem where the chatmodel doesn't use my chat history. It's integrated with the Microsoft.SemanticKernel.
I'm using a deployment in west eu, version 0301 of gpt-35-turbo. When testing this with a deployment in sweden central, version 0613 of gpt-35-turbo, it seems like it uses the history a lot more, almost always. The answers are way more inconsistent in comparison though, it mostly doesn't follow the restrictions of the prompt that i constructed.

My question now is: does version 0301 not support chat history functionality? Or is there something wrong in my code?

var chat = new ChatHistory(promptConfig.PersonalityHistory);
if (history != null) {
    foreach (var chatTurn in history)
    {
        if (chatTurn.User != null)
        {
            _logger.LogInformation("Adding user message to chat history");
            chat.AddUserMessage(chatTurn.User);
        }
        if (chatTurn.Bot != null)
        {
            _logger.LogInformation("Adding bot message to chat history");
            chat.AddAssistantMessage(chatTurn.Bot);
        }
    }
}
chat.AddUserMessage(question);

chat.AddUserMessage(prompt);

var answerResponse = await chatCompletion.GetChatMessageContentAsync(chat, chatSettings, _kernel);

My code is based on the csharp example of Azure itself: https://github.com/Azure-Samples/azure-search-openai-demo-csharp

Thanks in advance for the help!

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,087 questions
0 comments No comments
{count} votes

Accepted answer
  1. VasaviLankipalle-MSFT 17,281 Reputation points
    2024-03-19T21:06:38.32+00:00

    Hello @Thibault Verlinde , Thanks for using Microsoft Q&A Platform.

    GPT-3.5 Turbo is used with the Chat Completion API. GPT-3.5 Turbo version 0301 can also be used with the Completions API. GPT-3.5 Turbo versions 0613 and 1106 only support the Chat Completions API.

    Please refer to the similar issue: https://github.com/Azure-Samples/azure-search-openai-demo-csharp/issues/158

    Since the model version changed to 0613 might be causing this issue. Try to change and see if that helps. Please refer to: https://github.com/Azure-Samples/azure-search-openai-demo-csharp/blob/main/infra/main.bicep#L26

    I hope this helps.

    Regards,

    Vasavi

    -Please kindly accept the answer and vote 'yes' if you feel helpful to support the community, thanks.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.