aallam / openai-kotlin

OpenAI API client for Kotlin with multiplatform and coroutines capabilities.
MIT License
1.49k stars 179 forks source link

Attach images to assistant messages #379

Open kostiaalio opened 2 months ago

kostiaalio commented 2 months ago

Feature Description

Attach images to Assistant messages, similarly to how it's implemented now for chatCompletions. OpenAI API allows the inclusion of images in Assistant message requests, as an array of content parts. Attachment of image files is only supported on Vision-compatible models.

Problem it Solves

Right now the library allows to send only text messages to OpenAi Assistants.

Proposed Solution

This might be implemented in the same way as it's done now in ChatCompletionRequest (where message content is a list of ContentParts)