3 天以前 83e1b4d0e661f11a407fd6ea86e906b9b87b7180
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package cn.iocoder.yudao.module.ai.api.chat;
 
/**
 * AI 对话 API,供其他模块调用
 */
public interface AiChatApi {
 
    /**
     * 发送对话请求(纯文本)
     *
     * @param systemPrompt 系统提示词(角色设定)
     * @param userMessage  用户消息
     * @return AI 回复内容
     */
    String chat(String systemPrompt, String userMessage);
 
    /**
     * 发送带图片的对话请求(多模态视觉识别)
     *
     * @param systemPrompt 系统提示词(角色设定)
     * @param userMessage  用户消息
     * @param imageBase64  图片 base64 编码
     * @param mimeType     图片 MIME 类型(如 image/png)
     * @return AI 回复内容
     */
    String chatWithImage(String systemPrompt, String userMessage, String imageBase64, String mimeType);
 
}