Within Make, an automation collects and organizes data which is then routed to various Assistants.
I created a new project and configured all the assistants within. Each assistant is on v2 - ChatGPT-4o, but the API key is still linked to v1. When the Make automation reaches that point of the flow, this message appears at the point of failure:
The operation failed with an error. [400] The requested model 'gpt-4o-2024-05-13' cannot be used with the Assistants API in v1. Follow the migration guide to upgrade to v2: / docs / assistants / migration
Using Terminal, I followed the various instructions, but I canāt seem to resolve this issue. My OpenAI API key is still showing as v1, which I believe could be the cause of the conflict.
Can anyone shed any light on this? Thanks in advance.
I did. My Assistant APIs are all on v2. However, I believe the issue is with the overarching API which is still show v1. Iām not sure. Hereās a quick look at the steps I took.
I launched Terminal and followed the steps, ultimately creating the openai_test.py file:
cd ~/Desktop
python3 openai_test.py
This should have executed the Python script, set the default headers to use the v2 version of the OpenAI API, make a request to the API using the gpt-4o model and the openai.beta.completions.create() method, and print the response.
Lesson: donāt trust an AI model produced in 2024 by OpenAI with your code.
The crux of the problem is: you must send the correct āv2ā header to the API when making the request to the API, or you will be denied usage of the new model in Assistants.
Neither an assistant or an API key has any setting that indicates the API version within, it is all selected by network requests.
The site is not sending the headers required. If you cannot update the OpenAI libraries or code being used, there is nothing you can do to fix this, apart from writing a complete request yourself with network requests that can pass headers.
Assistants, the only place where one would need the header, does not have a ācompletionā method. There is a multi-step procedure for creating resources and running a job.
Also, pip show openai will show you the version of openAI is being used as below.
Name: openai
Version: 1.30.1
Summary: The official Python library for the openai API
Home-page:
Author:
Author-email: OpenAI support@openai.com
License:
pip install --upgrade openai shall upgrade to the latest version.