Why isn't GPT-35-turbo-16k capable of handling chat completions?

Milne, Cameron 0 Reputation points
2023-08-11T12:53:57.96+00:00

I'm using AzureOpenAI in a Python script and I'm trying to use the "gpt-35-turbo-16k" model in order to pass larger prompts. While there's nothing in the model documentation that says this model isn't designed for chat completions, I'm getting this error when trying to send a request:

User's image

For reference, I'm using LangChain to build a personalize document Q&A chain. Here's how I've set up the model:

User's image

What am I missing? Is the model currently down?

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

1 answer

Sort by: Most helpful
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2023-08-11T20:54:23.39+00:00

    Hello @Milne, Cameron , Thanks for using Microsoft Q&A Platform.

    May I know the version you are using for the gpt-35-turbo model?

    Version 0613 and all future versions of gpt-35-turbo will only be made available in the /chat/completions API.

    Please visit this to know more: How to work with the GPT-35-Turbo and GPT-4 models - Azure OpenAI Service | Microsoft Learn

    Here is the code for the reference: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/chatgpt?pivots=programming-language-chat-completions#working-with-the-gpt-35-turbo-and-gpt-4-models

    import os
    import openai
    openai.api_type = "azure"
    openai.api_version = "2023-05-15" 
    openai.api_base = os.getenv("OPENAI_API_BASE")  # Your Azure OpenAI resource's endpoint value.
    openai.api_key = os.getenv("OPENAI_API_KEY")
    
    response = openai.ChatCompletion.create(
        engine="gpt-35-turbo", # The deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 model.
        messages=[
            {"role": "system", "content": "Assistant is a large language model trained by OpenAI."},
            {"role": "user", "content": "Who were the founders of Microsoft?"}
        ]
    )
    
    print(response)
    
    print(response['choices'][0]['message']['content'])
    

    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

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.