You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/modules/ROOT/pages/module-prompt.adoc
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -391,19 +391,6 @@ If you run into challenges while drafting the prompt, ask your instructor for as
391
391
392
392
=== Test emails to speed up prompt development
393
393
394
-
[IMPORTANT]
395
-
====
396
-
If you haven't created *a new Gen AI email service* in the previous module yet, create the new email service by running the following magic bash script in VS Code terminal. If you're still running the Quarkus dev mode, open a new terminal window to run the script.
397
-
398
-
[.console-input]
399
-
[source,shell,subs="+attributes,macros+"]
400
-
----
401
-
sh ${PROJECT_SOURCE}/scripts/create-email-ai-service.sh
402
-
----
403
-
404
-
Access the https://parasol-app-{user}-dev-parasol-app-{user}-dev.{openshift_cluster_ingress_domain}[Parasol web page^],to verify the Gen AI email service. To access the email service, click on the `Email Generate` tab on the left and use it in the following sections:
Now that you've developed a working prompt that can help satisfy leadership objectives with its first Generative AI initiative, you need to incorporate this logic into the Parasol Insurance application so that ongoing business value may be realized. For this exercise that involves updating the Email Response REST service and UI to provide an recommended recipient, email subject, and automated response based on a given customer email.
538
525
526
+
[IMPORTANT]
527
+
====
528
+
If you haven't created *a new Gen AI email service* in the previous module yet, create the new email service by running the following magic bash script in VS Code terminal. If you're still running the Quarkus dev mode, open a new terminal window to run the script.
529
+
530
+
[.console-input]
531
+
[source,shell,subs="+attributes,macros+"]
532
+
----
533
+
sh ${PROJECT_SOURCE}/scripts/create-email-ai-service.sh
534
+
----
535
+
536
+
Access the https://parasol-app-{user}-dev-parasol-app-{user}-dev.{openshift_cluster_ingress_domain}[Parasol web page^],to verify the Gen AI email service. To access the email service, click on the `Email Generate` tab on the left and use it in the following sections:
537
+
====
538
+
539
539
=== Integrate Prompt with the Parasol Insurance Application
540
540
541
541
Now that we've developed a robust prompt that helps address the Parasol Insurance use case for email handling, we must integrate that prompt into the Parasol application.
@@ -666,16 +666,23 @@ Add the following html to the `email-response` div block:
Additionally, we must add the address field to the REST Service's JSON Response.
672
672
673
-
Open the `src/main/java/org/parasol/model/EmailResponse.java` file to `replace` the constructor with the following code.
673
+
Open the `src/main/java/org/parasol/model/EmailResponse.java` file and `replace` the Java record signature with the following code.
674
+
675
+
[IMPORTANT]
676
+
====
677
+
The new field you are adding for email address must be first in the EmailResponse method signature.
678
+
679
+
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.
680
+
====
674
681
675
682
[.console-input]
676
683
[source,java,subs="+attributes,macros+"]
677
684
----
678
-
public record EmailResponse(String subject, String message, String address) { }
685
+
public record EmailResponse(String address, String subject, String message) { }
679
686
----
680
687
681
688
image::prompt/new-field-added-to-email-response.png[Add "address" field to EmailResponse Record]
0 commit comments