microsoft / microsoft/azurechat

Title: Error BadRequestError: 400 Additional properties are not allowed ('parsed', 'refusal' were unexpected)

Open
#503 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.4k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
1

Description

Bug Report: BadRequestError 400 - Unexpected Properties in OpenAI API Response (Function Call to Azure AI Search)

Description

When making a function call to Azure AI Search using the OpenAI API, I
encountered a error: BadRequestError: 400 Additional properties are not allowed ('parsed', 'refusal' were unexpected) - 'messages.2'

Error Details

BadRequestError: 400 Additional properties are not allowed ('parsed', 'refusal' were unexpected) - 'messages.2' at APIError.generate (openai/error.mjs:58:20) at OpenAI.makeStatusError (openai/core.mjs:338:65) at OpenAI.makeRequest (openai/core.mjs:389:30) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ChatCompletionStreamingRunner._createChatCompletion (openai/lib/ChatCompletionStream.mjs:73:24) at async ChatCompletionStreamingRunner._runTools (openai/lib/AbstractChatCompletionRunner.mjs:252:36)

Expected Behavior

The OpenAI API should process the function call to Azure AI Search successfully without returning an error for unexpected properties.

Actual Behavior

The request fails with a BadRequestError due to additional properties that are not allowed in the response.

Steps to Reproduce

  1. Make a function call to Azure AI Search via the OpenAI API.
  2. Pass a valid payload.
  3. Observe the error response.

Environment

  • API Endpoint: OpenAI ChatCompletion Streaming
  • Function Call Target: Azure AI Search
  • Region: Sweden Central
  • Library Version: OpenAI SDK 4.26.0
  • Date of Occurrence: March 11, 2025

Additional Information

  • Request ID: 0fe457bc-cdcf-4345-9f1c-d86ed3559fe5
  • Error Type: invalid_request_error

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the reported stack-trace paths in openai/error.mjs, openai/core.mjs, ChatCompletionStream.mjs, and AbstractChatCompletionRunner.mjs, focusing on messages.2 and the Azure AI Search function-call request. Reproduce the streaming call with OpenAI SDK 4.26.0 in Sweden Central; done means the valid function call no longer fails with the unexpected parsed/refusal properties error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, typescript
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.