Skip to content

Commit

Permalink
updated customer support agent example
Browse files Browse the repository at this point in the history
  • Loading branch information
LangChain4j committed Jan 7, 2025
1 parent fc428dc commit 98cf6cc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import dev.langchain4j.example.booking.BookingService;
import dev.langchain4j.example.booking.Customer;
import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.output.TokenUsage;
import dev.langchain4j.service.Result;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -70,6 +71,10 @@ void should_provide_booking_details_for_existing_booking() {
verify(bookingService).getBookingDetails(BOOKING_NUMBER, CUSTOMER_NAME, CUSTOMER_SURNAME);
verifyNoMoreInteractions(bookingService);

TokenUsage tokenUsage = result.tokenUsage();
assertThat(tokenUsage.inputTokenCount()).isLessThan(1000);
assertThat(tokenUsage.outputTokenCount()).isLessThan(200);

with(judgeModel).assertThat(answer)
.satisfies("mentions that booking starts on %s".formatted(BOOKING_BEGIN_DATE));
}
Expand Down

0 comments on commit 98cf6cc

Please sign in to comment.