Microsoft.Extensions.AI Supports Multi-Modal Messages
At Microsoft.Extensions.AI, IChatClient unifies OpenAI service providers through IList<ChatMessage> with Contents property, supporting multi-modal messages (text, images, audio & function calls).
At the core of Microsoft.Extensions.AI is an IChatClient, which serves as a unified approach to working with various OpenAI service providers.
It utilizes a list of messages (IList<ChatMessage>) to provide input for CompleteAsync().
Each message has a property called Contents, allowing each message have multiple contents sequentially, making it a multi-modal message.
IList<ChatMessage>
1- ChatMessage
- Role: User
- Contents:
- Text: "Hello, what is in my image?"
- Image: "[Image1.jpg]"
2- ChatMessage
- Role: Assistant
- Contents:
- Text: "There is a BMW c...