聊聊langchain4j的Agent

本文主要研究一下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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值