Skip to content

It seems do not support vision request? #2

@Summer-Shen98

Description

@Summer-Shen98

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions