I am using langchain and azure openai and i face this issue when i try to talk, saying this model does not work. I guess i used gpt-4-32k,gpt-4

zhen tan 20 Reputation points
2024-03-29T01:43:52.7733333+00:00

I have tried all versions of the models for GPT4 and GPT4-32K, such as 0613,1106 Review, 0125 Review, and so on. I am sure that my other parameters were not filled in incorrectly and all returned this result:openai.BadRequestError: Error code: 400 - {'error': {'code': 'OperationNotSupported', 'message': 'The completion operation does not work with the specified model, gpt-4. Please choose different model and try again. You can learn more about which models can be used with each operation here: https://go.microsoft.com/fwlink/?linkid=2197993.'}} my code:

# 初始化 AzureOpenAI
llm = AzureOpenAI(
    openai_api_key=OPENAI_API_KEY,
    deployment_name=OPENAI_DEPLOYMENT_NAME,
    api_version="2024-02-15-preview",
    verbose=True,
    azure_endpoint="https://cdr1106.openai.azure.com/",
)

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

Accepted answer
  1. AshokPeddakotla-MSFT 27,391 Reputation points
    2024-03-29T03:08:19.45+00:00

    zhen tan Greetings & Welcome to Microsoft Q&A forum!

    result:openai.BadRequestError: Error code: 400 - {'error': {'code': 'OperationNotSupported', 'message': 'The completion operation does not work with the specified model, gpt-4. Please choose different model and try again.

    You are getting this error as Completion operation is not supported by gpt-4 models. These models only support Chat Completions API. The Chat Completion API is also the only way to access the GPT-4 models.

    To learn more about how to interact with GPT-4 and the Chat Completions API check out our in-depth how-to.

    Additionally, Models page of Azure AI Studio displays the features supported by the Model as shown in the below screenshot

    User's image

    I hope this helps. Do let me know if you have any further queries.

    If the response helped, please do click Accept Answer and Yes for was this answer helpful.

    Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful