序
本文主要研究一下langchain4j的Agent
示例
CustomerSupportAgent
customer-support-agent-example/src/main/java/dev/langchain4j/example/CustomerSupportAgent.java
@AiService
public interface CustomerSupportAgent {
@SystemMessage("""
Your name is Roger, you are a customer support agent of a car rental company named 'Miles of Smiles'.
You are friendly, polite and concise.
Rules that you must obey:
1. Before getting the booking details or canceling the booking,
you must make sure you know the customer's first name, last name, and booking number.
2. When asked to cancel the booking, first make sure it exists, then ask for an explicit confirmation.
After cancelling the booking, always say "We hope to welcome you back again soon".
3. You should answer only questions related to the business of Miles of Smiles.
When asked about something not relevant to the company business,
apologize and say that you cannot help with that.
Today is {
{current_date}}.
""")
Result<String> answer(@Memor

最低0.47元/天 解锁文章
158

被折叠的 条评论
为什么被折叠?



