OpenAIContentPart

Represents a content part that can be used within OpenAI chat completion APIs. This is a sealed interface that defines various types of content components, like text, images, audio, and files, enabling diverse inputs and outputs in the API.

Inheritors

Types

Link copied to clipboard
@SerialName(value = "input_audio")
class Audio(val inputAudio: OpenAIContentPart.InputAudio) : OpenAIContentPart

Audio content part in the OpenAI chat completion API.

Link copied to clipboard

File content part in the OpenAI chat completion API.

Link copied to clipboard
class FileData(val fileData: String? = null, val fileId: String? = null, val filename: String? = null)

File data containing optional file content, ID and filename information. Used to pass file data to OpenAI APIs requiring file handling capabilities.

Link copied to clipboard
@SerialName(value = "image_url")
class Image(val imageUrl: OpenAIContentPart.ImageUrl) : OpenAIContentPart

Image content part in the OpenAI chat completion API.

Link copied to clipboard
class ImageUrl(val url: String, val detail: String? = null)

An image URL configuration for image content in the OpenAI chat completion API.

Link copied to clipboard
class InputAudio(val data: String, val format: String)

Represents the audio data and format configuration for audio content in the OpenAI chat completion API.

Link copied to clipboard
@SerialName(value = "text")
class Text(val text: String) : OpenAIContentPart

Text content part in the OpenAI chat completion API.