Код: Выделить всё
from openai import OpenAI
client = OpenAI(api_key="___")
response = client.chat.completions.create(
model="gpt-4-vision-preview",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Does this image show a Fender Stratocaster Electric Guitar? Respond with yes or no."},
{
"type": "image_url",
"image_url": {
"url": "https://toneshapers.com/cdn/shop/files/Les-Paul-Standard-Front.jpg",
},
},
],
}
],
max_tokens=300,
)
print(response.choices[0])
Подробнее здесь: https://stackoverflow.com/questions/782 ... p-net-core
Мобильная версия