Skip to content

Commit

Permalink
Make the web-search example more reliable in answering questions rela…
Browse files Browse the repository at this point in the history
…ted to today's date
  • Loading branch information
jmartisk committed Oct 31, 2024
1 parent 4fe7711 commit b9199d7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkiverse.langchain4j.sample.chatbot;

import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.web.search.WebSearchTool;
import io.quarkiverse.langchain4j.RegisterAiService;
Expand All @@ -9,6 +10,13 @@
@SessionScoped
public interface Bot {

@SystemMessage("""
You have access to a function that looks up data using the Tavily web search engine.
The web search engine doesn't understand the concept of 'today',
so if the user asks something
that requires the knowledge of today's date, use the getTodaysDate function before
calling the search engine.
""")
String chat(@UserMessage String question);

}

0 comments on commit b9199d7

Please sign in to comment.