Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图像如何上传呢? #63

Open
xiao-11 opened this issue Dec 13, 2024 · 0 comments
Open

图像如何上传呢? #63

xiao-11 opened this issue Dec 13, 2024 · 0 comments

Comments

@xiao-11
Copy link

xiao-11 commented Dec 13, 2024

想利用gpt4的能力同时处理图像和文字?那图像如何上传呢?
我尝试使用如下代码上传,但返回结果说“没有任何图像上传”。
messages=[
{"role": "user",
"content": [
{
"type": "text",
"text": prompt
},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}",
"detail": "high",
},
}
]},
]
completion = openai.chat.completions.create(
# model="gpt-3.5-turbo",
model = "gpt-4o-mini",
messages = messages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant