-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I have add "Copilot-Vision-Request": "true" to the headers of config.json
but when i use the following code to analyze image it raise: {'error': {'message': 'missing required Copilot-Vision-Request header for vision requests', 'code': ''}}
import base64
from openai import OpenAI
client = OpenAI(
base_url="http://10.40.2.26:8081/v1",
api_key="test-key"
)
with open("1.jpg", "rb") as f:
img_base64 = base64.b64encode(f.read()).decode("utf-8")
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "what is in the picture?"},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{img_base64}"
}
}
]
}
]
)
print(response.choices[0].message.content)
Metadata
Metadata
Assignees
Labels
No labels