package com.iwe3.langchain4j.controller;

import com.iwe3.langchain4j.service.ChatAssistant;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HighLevelController {

    @Resource
    private ChatAssistant chatAssistant;

    // http://localhost:9003/lc4j/boot/declarative?prompt=我是谁
    @GetMapping(value = "/lc4j/boot/declarative")
    public String declarative(@RequestParam(value = "prompt", defaultValue = "你是谁") String prompt)
    {
        return chatAssistant.chat(prompt);
    }
}
