Class GPTChatMessage
- java.lang.Object
 - 
- com.composum.ai.backend.base.service.chat.GPTChatMessage
 
 
- 
public class GPTChatMessage extends Object
A chat message in a dialog with ChatGPT. Currently limited to at most a text message and an image.- See Also:
 - "https://platform.openai.com/docs/guides/chat"
 
 
- 
- 
Constructor Summary
Constructors Constructor Description GPTChatMessage(GPTMessageRole role, String content)GPTChatMessage(GPTMessageRole role, String content, String imageUrl)GPTChatMessage(GPTMessageRole role, String content, String imageUrl, String tool_call_id)GPTChatMessage(GPTMessageRole role, String content, String imageUrl, String tool_call_id, List<GPTToolCall> tool_calls) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetContent()The content of the message, be that an answer of the assistant or a question of the user.StringgetImageUrl()The URL with the content of the image to be analyzed.GPTMessageRolegetRole()Function of the message in the dialog.StringgetToolCallId()The ID of a prior tool call.List<GPTToolCall>getToolCalls()The tool calls that were made in the context of this message.inthashCode()StringtoString()String representation only for debugging. 
 - 
 
- 
- 
Constructor Detail
- 
GPTChatMessage
public GPTChatMessage(@Nonnull GPTMessageRole role, @Nonnull String content)
 
- 
GPTChatMessage
public GPTChatMessage(@Nonnull GPTMessageRole role, @Nullable String content, @Nullable String imageUrl)
 
- 
GPTChatMessage
public GPTChatMessage(@Nonnull GPTMessageRole role, @Nullable String content, @Nullable String imageUrl, String tool_call_id)
 
- 
GPTChatMessage
public GPTChatMessage(@Nonnull GPTMessageRole role, @Nullable String content, @Nullable String imageUrl, String tool_call_id, List<GPTToolCall> tool_calls)
 
 - 
 
- 
Method Detail
- 
getRole
public GPTMessageRole getRole()
Function of the message in the dialog. 
- 
getContent
public String getContent()
The content of the message, be that an answer of the assistant or a question of the user. 
- 
getImageUrl
public String getImageUrl()
The URL with the content of the image to be analyzed. 
- 
getToolCallId
public String getToolCallId()
The ID of a prior tool call. 
- 
getToolCalls
@Nullable public List<GPTToolCall> getToolCalls()
The tool calls that were made in the context of this message. 
- 
toString
public String toString()
String representation only for debugging. 
 - 
 
 -