Logo

openai

#10113

request_parameter_error

Invalid request: "functions" and "tools" cannot both be provided. "Functions" are deprecated; use the "tools" parameter instead.

This error has been identified and solved.

Reason

The error you are encountering, where the OpenAI API returns a 400 status code with the message "Invalid request: 'functions' and 'tools' cannot both be provided. 'functions' are deprecated; use the 'tools' parameter instead," is due to the following reasons:

  • The API request is including both the deprecated functions parameter and the new tools parameter, which is not allowed.

  • The functions parameter has been deprecated, and the API expects you to use the tools parameter instead.

This indicates a mismatch between the deprecated and current API parameters in your request configuration.

Solution

To fix the 400 status error due to the invalid request where both functions and tools are provided, you need to adjust your API request configuration as follows:

  • Remove the functions parameter from your request since it is deprecated.

  • Use the tools parameter instead to specify the necessary tools.

Here are the key steps:

  • Ensure your request only includes the tools parameter.

  • Update your code to comply with the current API requirements, eliminating any references to the deprecated functions parameter.

  • Verify that your API request adheres to the latest OpenAI API documentation guidelines.

Original Error Message

Raw

Invalid request: "functions" and "tools" cannot both be provided. "Functions" are deprecated; use the "tools" parameter instead.

Original Error Message

Raw

Invalid request: "functions" and "tools" cannot both be provided. "Functions" are deprecated; use the "tools" parameter instead.

Suggested Links

© 2024 Portkey, Inc. All rights reserved

HIPAA

COMPLIANT

GDPR

Transform Your AI app prototypes to be production-ready

Talk to us →