Skip to content

[azure-ai-inference] (BadRequest) Invalid input format when input messages contain tool calling history #41659

Closed
@dunalduck0

Description

@dunalduck0
  • Package Name: azure-ai-inference
  • Package Version: 1.0.0b9
  • Operating System: Ubuntu
  • Python Version: 3.12.10

Describe the bug
Tried the example code sample_chat_completions_with_tools.py. Replacing the endpoint and key with my GPT-4o deployment. Getting error as follows:

azure.core.exceptions.HttpResponseError: (BadRequest) Invalid input format.
Code: BadRequest
Message: Invalid input format.

To Reproduce
Steps to reproduce the behavior:

  1. Download the sample code as shown in the link
  2. Update endpoint and key
  3. Run it locally

Expected behavior
The code should run without error

Screenshots
Image

Metadata

Metadata

Assignees

Labels

AI Model InferenceIssues related to the client library for Azure AI Model Inference (\sdk\ai\azure-ai-inference)ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions