Package net.thevpc.naru.api.model
Class NaruMessage
java.lang.Object
net.thevpc.naru.api.model.NaruMessage
- All Implemented Interfaces:
Cloneable,net.thevpc.nuts.elem.NToElement,net.thevpc.nuts.util.NCopiable
public class NaruMessage
extends Object
implements net.thevpc.nuts.elem.NToElement, net.thevpc.nuts.util.NCopiable, Cloneable
A single message in a chat conversation.
Roles: "system", "user", "assistant", "tool"
-
Constructor Summary
ConstructorsConstructorDescriptionNaruMessage(String sourceName, NaruSource source, NaruRole role, String content, List<String> images, String toolCallId, String toolName, List<NaruToolCall> toolCalls) NaruMessage(net.thevpc.nuts.elem.NElement element) -
Method Summary
Modifier and TypeMethodDescriptionstatic NaruMessagestatic NaruMessageassistantWithToolCalls(String content, List<NaruToolCall> calls) protected NaruMessageclone()copy()getRole()booleanstatic NaruMessageof(net.thevpc.nuts.elem.NElement element) voidsetContent(String content) voidvoidsetSource(NaruSource source) setSourceName(String sourceName) voidsetToolCallId(String toolCallId) voidsetToolCalls(List<NaruToolCall> toolCalls) voidsetToolName(String toolName) static NaruMessagenet.thevpc.nuts.elem.NElementstatic NaruMessagetoString()static NaruMessagestatic NaruMessageuser(net.thevpc.nuts.text.NMsg content) static NaruMessageuserWithImages(String content, List<String> base64Images)
-
Constructor Details
-
NaruMessage
public NaruMessage() -
NaruMessage
public NaruMessage(String sourceName, NaruSource source, NaruRole role, String content, List<String> images, String toolCallId, String toolName, List<NaruToolCall> toolCalls) -
NaruMessage
public NaruMessage(net.thevpc.nuts.elem.NElement element)
-
-
Method Details
-
getSourceName
-
setSourceName
-
getSource
-
setSource
-
copy
- Specified by:
copyin interfacenet.thevpc.nuts.util.NCopiable
-
clone
-
of
-
toElement
public net.thevpc.nuts.elem.NElement toElement()- Specified by:
toElementin interfacenet.thevpc.nuts.elem.NToElement
-
system
-
user
-
user
-
userWithImages
-
assistant
-
assistantWithToolCalls
-
tool
-
getRole
-
setRole
-
getContent
-
setContent
-
getImages
-
setImages
-
getToolCallId
-
setToolCallId
-
getToolName
-
setToolName
-
getToolCalls
-
setToolCalls
-
hasToolCalls
public boolean hasToolCalls() -
toString
-