| | |
| | | package com.ard.agent.controller; |
| | | |
| | | import com.alibaba.cloud.ai.graph.exception.GraphRunnerException; |
| | | import com.ard.agent.service.AIChatService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.ai.chat.messages.AssistantMessage; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import reactor.core.publisher.Flux; |
| | | |
| | |
| | | public Flux<String> streamChat(@RequestParam String message) { |
| | | return aiChatService.streamChat(message); |
| | | } |
| | | @Operation(summary = "ReactAgent聊天接口") |
| | | @GetMapping(value = "/chat") |
| | | public String chat(@RequestParam String message) throws GraphRunnerException { |
| | | return aiChatService.chat(message); |
| | | } |
| | | } |