MultimodalConversableAgent 사용 이미지 생성용 로직을 짜는 과정에서 지속적인 이슈 발생..
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'messages[1]'. Image URLs are only allowed for messages with role 'user', but this message with role 'assistant' contains an image URL.", 'type': 'invalid_request_error', 'param': 'messages[1]', 'code': 'invalid_value'}}
=>
지금 프롬프트에 이미지 url을 써 놨는데 이게 assistant 말고 user 타입에만 된다고 한다.
openai 프롬프트 api 문서에 나온 이 부분
https://platform.openai.com/docs/guides/text-generation#messages-and-roles
지금 코드에서는 따로 설정하지 않았기 때문에 오토젠 클래스 내부에서 아마 처리하는 것 같은데..
MultimodalConversableAgent가 assistant 날리나? ㅠㅠ
스택으로 호출 반환된 패키지를 들어가 봐도... 어떻게 해야 하는지 모르겠음,..,.
실력 부족
https://www.instagram.com/reel/DF7DpsUNerb/?igsh=MXc1NXhoZmIzYXVsYQ==
공식 문서가 뭔가 02 -> 04 업그레이드되면서 먼가 좀 불확실한 늒김...
agentchat.contrib.multimodal_conversable_agent | AutoGen 0.2
MultimodalConversableAgent
microsoft.github.io
너무 짧아요...
어케 하라거여?
=>
UserProxyAgent를 발견했다!
https://microsoft.github.io/autogen/0.2/docs/reference/agentchat/user_proxy_agent#userproxyagent
agentchat.user_proxy_agent | AutoGen 0.2
UserProxyAgent
microsoft.github.io
=>
user프록시에이전트로 생성한 객체에 기존 에이전트 2개 엮은 그룹챗을 전달하고 initiate를 걸어주면
정상작동!
'🤖 AI > AI' 카테고리의 다른 글
📑 머신러닝(ML) 기본 개념 (0) | 2025.02.15 |
---|---|
🫧 DBSCAN (Density-Based Spatial Clustering of Applications with Noise) 클러스터링 알고리즘🫐 (0) | 2025.02.14 |
🎠 AutoGen 공식문서 following : Advanced - Custom Agents (0) | 2025.02.11 |
🎠 AutoGen 공식문서 following : Human-in-the-Loop, Termination, Managing State (0) | 2025.02.10 |
🎠 AutoGen 공식문서 following : intro, model, messages, agents, Teams (0) | 2025.02.10 |