Skip to content

Commit

Permalink
[docs] Publishing the docs for commit(s) dc51ffb
Browse files Browse the repository at this point in the history
  • Loading branch information
kdubois committed Jul 12, 2024
1 parent cdf997b commit 2ada681
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 46 deletions.
49 changes: 27 additions & 22 deletions quarkus-tutorial/20_embed_documents.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,16 @@ <h2 id="_adding_temperature_property_to_your_configuration"><a class="anchor" hr

%dev.quarkus.mailer.mock=false

quarkus.langchain4j.openai.chat-model.temperature=0.0 <i class="conum" data-value="1"></i><b>(1)</b>
quarkus.langchain4j.easy-rag.path=src/main/resources/catalog <i class="conum" data-value="2"></i><b>(2)</b>
quarkus.langchain4j.openai.chat-model.temperature=0.0
quarkus.langchain4j.easy-rag.path=src/main/resources/catalog

booking.daystostart=1
booking.daystostart=1 <i class="conum" data-value="3"></i><b>(3)</b>
booking.daystoend=3
booking.firstname=john
booking.lastname=doe
booking.number=123-456

quarkus.langchain4j.openai.chat-model.model-name=gpt-4o <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
quarkus.langchain4j.openai.chat-model.model-name=gpt-4o <i class="conum" data-value="4"></i><b>(4)</b></code></pre>
</div>
</div>
<div class="colist arabic">
Expand All @@ -251,6 +254,10 @@ <h2 id="_adding_temperature_property_to_your_configuration"><a class="anchor" hr
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Sample booking data</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The specific model to use. IMPORTANT: gpt3.5-turbo is much cheaper but the results will be slower and less reliable.</td>
</tr>
</table>
Expand Down Expand Up @@ -384,27 +391,24 @@ <h2 id="_create_the_booking_functionality"><a class="anchor" href="#_create_the_
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package com.redhat.developers;

import java.time.LocalDate;
import java.util.Map;

import org.eclipse.microprofile.config.inject.ConfigProperty;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

@ApplicationScoped
public class BookingService {

@ConfigProperty(name="booking.daystostart")
int daystostart;

@ConfigProperty(name="booking.daystoend")
int daystoend;

private static String FIRSTNAME="john";
private static String LASTNAME="doe";
private static String BOOKINGNUMBER ="123-456"; <i class="conum" data-value="1"></i><b>(1)</b>
@Inject
@ConfigProperty(name = "booking") <i class="conum" data-value="1"></i><b>(1)</b>
Map&lt;String, String&gt; booking;

public Booking getBookingDetails(String bookingNumber, String customerName, String customerSurname) {
ensureExists(bookingNumber, customerName, customerSurname);
LocalDate bookingFrom = LocalDate.now().plusDays(daystostart);
LocalDate bookingTo = LocalDate.now().plusDays(daystoend);
LocalDate bookingFrom = LocalDate.now().plusDays(Long.parseLong(booking.get("daystostart")));
LocalDate bookingTo = LocalDate.now().plusDays(Long.parseLong(booking.get("daystoend")));
// Retrieval from DB mocking
Customer customer = new Customer(customerName, customerSurname);
return new Booking(bookingNumber, bookingFrom, bookingTo, customer);
Expand All @@ -413,15 +417,16 @@ <h2 id="_create_the_booking_functionality"><a class="anchor" href="#_create_the_
public void cancelBooking(String bookingNumber, String customerName, String customerSurname) {
ensureExists(bookingNumber, customerName, customerSurname);

// TODO add logic to double check booking conditions in case the LLM got it wrong.
// TODO add logic to double check booking conditions in case the LLM got it
// wrong.
// throw new BookingCannotBeCancelledException(bookingNumber);
}

private void ensureExists(String bookingNumber, String customerName, String customerSurname) {
// Check mocking
if (!(bookingNumber.equals(BOOKINGNUMBER)
&amp;&amp; customerName.toLowerCase().equals(FIRSTNAME)
&amp;&amp; customerSurname.toLowerCase().equals(LASTNAME))) {
if (!(bookingNumber.equals(booking.get("number"))
&amp;&amp; customerName.toLowerCase().equals(booking.get("firstname"))
&amp;&amp; customerSurname.toLowerCase().equals(booking.get("lastname")))) {
throw new BookingNotFoundException(bookingNumber);
}
}
Expand All @@ -446,7 +451,7 @@ <h2 id="_create_the_booking_functionality"><a class="anchor" href="#_create_the_
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>We hardcoded a booking entry for simplicity&#8217;s sake. Of course, in a real world scenario this would likely come from a database.</td>
<td>Retrieve a single booking from the application.properties file. (in the real world this data would likely come from a DB instead :) )</td>
</tr>
</table>
</div>
Expand Down Expand Up @@ -531,7 +536,7 @@ <h2 id="_create_the_customer_support_service"><a class="anchor" href="#_create_t
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package com.redhat.developers;

import jakarta.websocket.OnOpen;
import io.quarkus.websockets.next.OnOpen;
import io.quarkus.websockets.next.OnTextMessage;
import io.quarkus.websockets.next.WebSocket;

Expand All @@ -550,7 +555,7 @@ <h2 id="_create_the_customer_support_service"><a class="anchor" href="#_create_t
}

@OnTextMessage
public String onMessage(String userMessage){
public String onMessage(String userMessage) {
return assistant.chat(userMessage);
}
}</code></pre>
Expand Down
48 changes: 24 additions & 24 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,98 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/01_setup.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/02_basics.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/03_configuration.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/04_panache.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/05_kubernetes.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/06_dev-services.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/07_spring.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/08_rest-client.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/09_fault-tolerance.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/10_health.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/11_observability.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/12_security.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/13_security-oidc.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/14_reactive.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/15_reactive-messaging.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/16_kafka-and-streams.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/17_prompts.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/18_chains_memory.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/19_agents_tools.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/20_embed_documents.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/21_podman_ai.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/22_local_models.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/23_kubernetes_kafka_ai.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
<url>
<loc>https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/index.html</loc>
<lastmod>2024-07-04T08:02:37.457Z</lastmod>
<lastmod>2024-07-12T15:27:22.798Z</lastmod>
</url>
</urlset>

0 comments on commit 2ada681

Please sign in to comment.