Hey friends, currently trying to utilize the API for the first time and I keep getting an error with this:
Response content: {‘error’: {‘message’: ‘Unrecognized request argument supplied: prompt’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}}
I am using python and trying to call gpt in order to get relationships between words from a text file I have. This is the python code I have to call get
def call_gpt_api(api_key, prompt_text):
global API_ENDPOINT
try:
data = {
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"prompt": prompt_text,
"max_tokens": 3000,
"stop": "\n",
"temperature": 0
}
headers = {"Content-Type": "application/json", "Authorization": "Bearer " + api_key}
r = requests.post(url=API_ENDPOINT, headers=headers, json=data)
response_data = r.json() # Parse the response as JSON
print("Response content:", response_data)
return response_data
except Exception as e:
print("Error:", e)
I am just curious if this is correct for making the api request? Keep getting an error as listed above. Thanks!