feat: 集成 KieAI 服务,移除 models-integration 子项目

- 添加 Gemini 2.5 Flash 对话接口(流式+非流式)
- 添加 NanoBanana 图像生成/编辑接口
- 添加 Sora2 视频生成接口(文生视频、图生视频、去水印)
- 移除 models-integration 子项目(功能已迁移至主后端)
- 新增测试文档和 Playwright E2E 配置
- 更新前端页面和 API 接口
- 更新后端配置和日志处理
This commit is contained in:
2026-03-03 15:33:50 +08:00
parent 1ddb051977
commit 4be53dcd1b
586 changed files with 21142 additions and 25130 deletions

View File

@@ -0,0 +1,85 @@
package com.zbkj.common.request.kieai;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* KieAI Gemini 2.5 Flash Chat Completions 请求 DTO
* 对应 https://docs.kie.ai/market/gemini/gemini-2.5-flash
* +----------------------------------------------------------------------
* | Author:ScottPan
* +----------------------------------------------------------------------
*/
@Data
@NoArgsConstructor
@ApiModel(value = "KieAIGeminiChatRequest", description = "Gemini 2.5 Flash Chat Completions 请求")
public class KieAIGeminiChatRequest implements Serializable {
private static final long serialVersionUID = 1L;
@Valid
@NotEmpty(message = "messages不能为空")
@ApiModelProperty(value = "消息列表", required = true)
private List<Message> messages;
@ApiModelProperty(value = "是否流式返回", example = "false")
private Boolean stream;
@ApiModelProperty(value = "工具定义(如 googleSearch 或 function calling与 response_format 互斥")
private List<Map<String, Object>> tools;
@ApiModelProperty(value = "是否在响应中包含思考过程", example = "true")
private Boolean includeThoughts;
@ApiModelProperty(value = "响应格式 JSON Schema与 function calling 互斥")
private Map<String, Object> responseFormat;
@Data
@NoArgsConstructor
@ApiModel(value = "Message", description = "单条消息")
public static class Message implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "角色: developer, system, user, assistant, tool")
private String role;
@NotNull(message = "content不能为空")
@ApiModelProperty(value = "内容:字符串或多模态数组 [{type,text} | {type,image_url}]", required = true)
private Object content;
}
@Data
@NoArgsConstructor
@ApiModel(value = "ContentItem", description = "多模态内容项")
public static class ContentItem implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "类型: text | image_url")
private String type;
@ApiModelProperty(value = "文本内容type=text 时使用)")
private String text;
@ApiModelProperty(value = "图片 URLtype=image_url 时使用)")
private ImageUrl imageUrl;
}
@Data
@NoArgsConstructor
@ApiModel(value = "ImageUrl", description = "图片 URL")
public static class ImageUrl implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "图片地址")
private String url;
}
}