종합 속보

[{'role': 'system', 'content': 'You are a helpful Korean assistant.'}, {'role': 'user', 'content': [{'type': 'text', 'text': '이 이미지에 대해 설명해줘'}, {'type': 'image_url', 'image_url': {'url': 'https://i.imgur.com/gCNw4DJ.png', 'detail': 'high'}}]}, {'role': 'assistant', 'content': '안녕하세요! 어떻게 도와드릴까요? 필요

한 정보나 도움이 필요하신가요?'}]


메시지 받았을 때 프롬프트인데 뭐가 잘못된 걸까




아래는 openai에서 제공하는 형식임


from openai import OpenAI


client = OpenAI()


response = client.chat.completions.create(

  model="gpt-4o",

  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",

          },

        },

      ],

    }

],

  max_tokens=300,

)


print(response.choices[0])


메시지 보낼 때 형식이 잘못된 것 같지는 않은데 이미지를 인식 못하는 것 같네