Was running the search GPT API’s on Python.
Code as follows :
completion = client.chat.completions.create(
model="gpt-4o-search-preview",
web_search_options={
"search_context_size": "low",
"user_location": {
"type": "approximate",
"approximate": {
"country": "GB",
"city": "London",
"region": "London",
}
},
},
messages=[
{
"role": "user",
"content": "Give me trends in AI?",
},
],
)
Keep getting this error :
TypeError: Completions.create() got an unexpected keyword argument ‘web_search_options’
Anybody know why?
When i remove the keyword it works just fine.