-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
I was trying to use an image input in my chat completion, but it appears its not working at all.
My code:
client = OpenAIUnofficial()
response = client.chat.completions.create(
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What's in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
}
},
],
}],
model="gpt-4o-mini-2024-07-18"
)
print("Response:", response.choices[0].message.content)```
and console return this error:
```File "C:\Users\~\AppData\Local\Programs\Python\Python310\lib\site-packages\openai_unofficial\main.py", line 256, in create
response = self.api_handler._make_request(
File "C:\Users\~\AppData\Local\Programs\Python\Python310\lib\site-packages\openai_unofficial\main.py", line 65, in _make_request
getattr(e.response, 'json', lambda: None)())
File "C:\Users\~\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char
0)```
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels