Skip to content

Commit b4e225f

Browse files
committed
Fixed issue where email address was being left off response. Fixed images and/or highlighting to match words.
1 parent 8be9391 commit b4e225f

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed
296 KB
Loading
Binary file not shown.
-91.2 KB
Loading

content/modules/ROOT/pages/module-prompt.adoc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,16 +670,23 @@ Add the following html to the `email-response` div block:
670670
</div>
671671
----
672672

673-
image::prompt/email_response_addresse.png[email_response_addresse]
673+
image::prompt/email_response_address.png[email_response_address]
674674

675675
Additionally, we must add the address field to the REST Service's JSON Response.
676676

677-
Open the `src/main/java/org/parasol/model/EmailResponse.java` file to `replace` the constructor with the following code.
677+
Open the `src/main/java/org/parasol/model/EmailResponse.java` file and `replace` the Java record signature with the following code.
678+
679+
[IMPORTANT]
680+
====
681+
The new field you are adding for email address must be first in the EmailResponse method signature.
682+
683+
LangChain4j uses this to suggest JSON response syntax to the LLM and our examples in the system prompt have the email address first in the response. If the examples do not match LangChain4j's suggestion, the effect is that email address is sometimes left off the response and will be blank in the UI.
684+
====
678685

679686
[.console-input]
680687
[source,java,subs="+attributes,macros+"]
681688
----
682-
public record EmailResponse(String subject, String message, String address) { }
689+
public record EmailResponse(String address, String subject, String message) { }
683690
----
684691

685692
image::prompt/new-field-added-to-email-response.png[Add "address" field to EmailResponse Record]

0 commit comments

Comments
 (0)