TextResponse¶
This docs was updated at: 2026-02-23
com.paragon.messaging.whatsapp.response.TextResponse ยท Record
Simple text response for structured AI output.
Represents a plain text message with optional reaction and reply context.
Usage Example¶
// Simple text response
TextResponse response = new TextResponse("Hello! How can I help?");
// With reply context
TextResponse response = TextResponse.builder()
.text("Thanks for your message!")
.replyTo("wamid.xyz123")
.build();
// With reaction
TextResponse response = TextResponse.builder()
.text("Great choice!")
.reactTo("wamid.xyz123", "๐")
.build();
Since: 2.1
Methods¶
TextResponse¶
Creates a simple text response with no context.
Parameters
| Name | Description |
|---|---|
text |
the message text |
builder¶
Creates a builder for TextResponse.
Returns
new builder
text¶
Sets the message text.
Parameters
| Name | Description |
|---|---|
text |
the text content |
Returns
this builder
replyTo¶
Sets the message ID to reply to.
Parameters
| Name | Description |
|---|---|
messageId |
the message ID |
Returns
this builder
reactTo¶
Sets the reaction for this response.
Parameters
| Name | Description |
|---|---|
messageId |
the message ID to react to |
emoji |
the reaction emoji |
Returns
this builder
previewUrl¶
Enables or disables URL preview.
Parameters
| Name | Description |
|---|---|
preview |
true to enable URL preview |
Returns
this builder
context¶
Sets the full response context.
Parameters
| Name | Description |
|---|---|
context |
the context |
Returns
this builder
build¶
Builds the TextResponse.
Returns
the built response