Logo

openai

#10114

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, specifically the message "Invalid request: 'functions' and 'tools' cannot both be provided. 'functions' are deprecated; use the 'tools' parameter instead," indicates a few key issues:

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

  • The functions parameter is deprecated and should no longer be used.

This error occurs because the OpenAI API has updated its parameters, and the deprecated functions parameter is no longer compatible with the current API version.

Solution

To fix the error, you need to adjust your API request to comply with the current OpenAI API specifications. Here are the steps to take:

  • Remove the functions parameter from your API request.

  • Use the tools parameter instead, as it is the replacement for the deprecated functions parameter.

  • Ensure that your request only includes the tools parameter and does not mix it with the functions parameter.

By making these changes, you should be able to resolve the "Invalid request" error and successfully interact with the OpenAI API.

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.

© 2024 Portkey, Inc. All rights reserved

HIPAA

COMPLIANT

GDPR

Transform Your AI app prototypes to be production-ready

Talk to us →