MessageBuilder

Entry point for creating Message instances from Java code using the builder pattern.

Usage from Java:

Message.User userMsg = MessageBuilder.user()
.content("Hello!")
.timestamp(Instant.now())
.build();

Message.Assistant assistantMsg = MessageBuilder.assistant()
.content("Hi there!")
.finishReason("stop")
.build();

Message.System systemMsg = MessageBuilder.system()
.content("You are a helpful assistant.")
.build();

Message.Tool.Call toolCall = MessageBuilder.toolCall()
.id("call_123")
.tool("search")
.content("{\"query\": \"hello\"}")
.build();

Message.Tool.Result toolResult = MessageBuilder.toolResult()
.id("call_123")
.tool("search")
.content("Found 5 results")
.build();

Message.Reasoning reasoning = MessageBuilder.reasoning()
.content("Let me think...")
.summary("Thinking")
.build();

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Creates a new SystemMessageBuilder for building Message.System instances.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Creates a new UserMessageBuilder for building Message.User instances.