Class ChatCompletionMessagePart
- java.lang.Object
-
- com.composum.ai.backend.base.service.chat.impl.chatmodel.ChatCompletionMessagePart
-
public class ChatCompletionMessagePart extends Object
Represents a part of a chat completion message, which may be a text or an image URL. This allows messages to include multiple types of content.{ "type": "text", "text": "What’s in this image?" } or { "type": "image_url", "image_url": { "url": "https://www.example.net/somepicture.jpg" } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChatCompletionMessagePart.ChatCompletionMessagePartListDeSerializer
static class
ChatCompletionMessagePart.ChatCompletionMessageUrlPart
Encodes URL part: { "url": "https://example.com/somepicture.jpg" }static class
ChatCompletionMessagePart.ImageDetail
static class
ChatCompletionMessagePart.Type
-
Constructor Summary
Constructors Constructor Description ChatCompletionMessagePart()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChatCompletionMessagePart.ChatCompletionMessageUrlPart
getImageUrl()
String
getText()
ChatCompletionMessagePart.Type
getType()
static ChatCompletionMessagePart
imageUrl(String imageUrl)
boolean
isEmpty(Void ignoreJustPreventSerialization)
void
setImageUrl(ChatCompletionMessagePart.ChatCompletionMessageUrlPart image_url)
void
setText(String text)
void
setType(ChatCompletionMessagePart.Type type)
static ChatCompletionMessagePart
text(String text)
-
-
-
Method Detail
-
text
public static ChatCompletionMessagePart text(String text)
-
imageUrl
public static ChatCompletionMessagePart imageUrl(String imageUrl)
-
getType
public ChatCompletionMessagePart.Type getType()
-
setType
public void setType(ChatCompletionMessagePart.Type type)
-
getText
public String getText()
-
setText
public void setText(String text)
-
getImageUrl
public ChatCompletionMessagePart.ChatCompletionMessageUrlPart getImageUrl()
-
setImageUrl
public void setImageUrl(ChatCompletionMessagePart.ChatCompletionMessageUrlPart image_url)
-
isEmpty
public boolean isEmpty(Void ignoreJustPreventSerialization)
-
-