mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 17:40:05 +08:00
【优化】AI:调整 ai starter 的包封装
This commit is contained in:
parent
eb8cd3d736
commit
56caa3d598
@ -1,11 +1,11 @@
|
|||||||
package cn.iocoder.yudao.module.ai.config;
|
package cn.iocoder.yudao.module.ai.config;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
|
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.ChatClient;
|
import org.springframework.ai.chat.ChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.StreamingChatClient;
|
import org.springframework.ai.chat.StreamingChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chatqianwen.QianWenChatClient;
|
import org.springframework.ai.models.tongyi.QianWenChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatClient;
|
import org.springframework.ai.models.xinghuo.XingHuoChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatClient;
|
import org.springframework.ai.models.yiyan.YiYanChatClient;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.ai.convert;
|
package cn.iocoder.yudao.module.ai.convert;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyMessage;
|
import org.springframework.ai.models.midjourney.MidjourneyMessage;
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageDallDrawingReqVO;
|
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageDallDrawingReqVO;
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageDallDrawingRespVO;
|
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageDallDrawingRespVO;
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageListRespVO;
|
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageListRespVO;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.ai.dal.dataobject.chat;
|
package cn.iocoder.yudao.module.ai.dal.dataobject.chat;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.MessageType;
|
import org.springframework.ai.chat.messages.MessageType;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModelDO;
|
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatModelDO;
|
||||||
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO;
|
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.ai.dal.dataobject.model;
|
package cn.iocoder.yudao.module.ai.dal.dataobject.model;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
|
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.ai.dal.dataobject.model;
|
package cn.iocoder.yudao.module.ai.dal.dataobject.model;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
|
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package cn.iocoder.yudao.module.ai.dal.vo;
|
package cn.iocoder.yudao.module.ai.dal.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.ai.models.xinghuo.XingHuoChatModel;
|
||||||
|
import org.springframework.ai.models.yiyan.YiYanChatModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* modal config
|
* modal config
|
||||||
@ -16,13 +19,13 @@ public class AiChatModalConfigVO {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 模型平台 (冗余,方便类型转换)
|
* 模型平台 (冗余,方便类型转换)
|
||||||
* 参考:{@link cn.iocoder.yudao.framework.ai.AiPlatformEnum}
|
* 参考:{@link AiPlatformEnum}
|
||||||
*/
|
*/
|
||||||
private String platform;
|
private String platform;
|
||||||
/**
|
/**
|
||||||
* 模型类型(冗余,方便类型转换)
|
* 模型类型(冗余,方便类型转换)
|
||||||
* {@link cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatModel}
|
* {@link YiYanChatModel}
|
||||||
* {@link cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatModel}
|
* {@link XingHuoChatModel}
|
||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.ai.dal.vo;
|
package cn.iocoder.yudao.module.ai.dal.vo;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageStyleEnum;
|
import org.springframework.ai.models.openai.enums.OpenAiImageStyleEnum;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.ai.service.impl;
|
package cn.iocoder.yudao.module.ai.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||||
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
|
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.ChatClient;
|
import org.springframework.ai.chat.ChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.ChatResponse;
|
import org.springframework.ai.chat.ChatResponse;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.StreamingChatClient;
|
import org.springframework.ai.chat.StreamingChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.MessageType;
|
import org.springframework.ai.chat.messages.MessageType;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.prompt.Prompt;
|
import org.springframework.ai.chat.prompt.Prompt;
|
||||||
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
|
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.ai.ErrorCodeConstants;
|
import cn.iocoder.yudao.module.ai.ErrorCodeConstants;
|
||||||
|
@ -2,18 +2,18 @@ package cn.iocoder.yudao.module.ai.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.framework.ai.exception.AiException;
|
import cn.iocoder.yudao.framework.ai.core.exception.AiException;
|
||||||
import cn.iocoder.yudao.framework.ai.image.ImageGeneration;
|
import org.springframework.ai.image.ImageGeneration;
|
||||||
import cn.iocoder.yudao.framework.ai.image.ImagePrompt;
|
import org.springframework.ai.image.ImagePrompt;
|
||||||
import cn.iocoder.yudao.framework.ai.image.ImageResponse;
|
import org.springframework.ai.image.ImageResponse;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageClient;
|
import org.springframework.ai.models.openai.OpenAiImageClient;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageOptions;
|
import org.springframework.ai.models.openai.OpenAiImageOptions;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageModelEnum;
|
import org.springframework.ai.models.openai.enums.OpenAiImageModelEnum;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageStyleEnum;
|
import org.springframework.ai.models.openai.enums.OpenAiImageStyleEnum;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.api.MidjourneyInteractionsApi;
|
import org.springframework.ai.models.midjourney.api.MidjourneyInteractionsApi;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.api.req.ReRollReq;
|
import org.springframework.ai.models.midjourney.api.req.ReRollReq;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.MidjourneyWebSocketStarter;
|
import org.springframework.ai.models.midjourney.webSocket.MidjourneyWebSocketStarter;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.WssNotify;
|
import org.springframework.ai.models.midjourney.webSocket.WssNotify;
|
||||||
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
|
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||||
|
@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.ai.service.midjourneyHandler;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyMessage;
|
import org.springframework.ai.models.midjourney.MidjourneyMessage;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.constants.MidjourneyGennerateStatusEnum;
|
import org.springframework.ai.models.midjourney.constants.MidjourneyGennerateStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.MidjourneyMessageHandler;
|
import org.springframework.ai.models.midjourney.webSocket.MidjourneyMessageHandler;
|
||||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||||
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageMidjourneyOperationsVO;
|
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageMidjourneyOperationsVO;
|
||||||
import cn.iocoder.yudao.module.ai.convert.AiImageConvert;
|
import cn.iocoder.yudao.module.ai.convert.AiImageConvert;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.ai.service.model;
|
package cn.iocoder.yudao.module.ai.service.model;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
|
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
@ -14,7 +14,6 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>yudao-spring-boot-starter-ai</artifactId>
|
<artifactId>yudao-spring-boot-starter-ai</artifactId>
|
||||||
|
<!-- TODO 芋艿:这里需要进一步减少 -->
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
@ -17,6 +18,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- TODO fan:这里包,要进一步减少 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-core</artifactId>
|
<artifactId>spring-core</artifactId>
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.config;
|
package cn.iocoder.yudao.framework.ai.config;
|
||||||
|
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import cn.iocoder.yudao.framework.ai.chatqianwen.QianWenChatClient;
|
import org.springframework.ai.models.tongyi.QianWenChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chatqianwen.QianWenChatModal;
|
import org.springframework.ai.models.tongyi.QianWenChatModal;
|
||||||
import cn.iocoder.yudao.framework.ai.chatqianwen.QianWenOptions;
|
import org.springframework.ai.models.tongyi.QianWenOptions;
|
||||||
import cn.iocoder.yudao.framework.ai.chatqianwen.api.QianWenApi;
|
import org.springframework.ai.models.tongyi.api.QianWenApi;
|
||||||
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatClient;
|
import org.springframework.ai.models.xinghuo.XingHuoChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoOptions;
|
import org.springframework.ai.models.xinghuo.XingHuoOptions;
|
||||||
import cn.iocoder.yudao.framework.ai.chatxinghuo.api.XingHuoApi;
|
import org.springframework.ai.models.xinghuo.api.XingHuoApi;
|
||||||
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatClient;
|
import org.springframework.ai.models.yiyan.YiYanChatClient;
|
||||||
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanOptions;
|
import org.springframework.ai.models.yiyan.YiYanOptions;
|
||||||
import cn.iocoder.yudao.framework.ai.chatyiyan.api.YiYanApi;
|
import org.springframework.ai.models.yiyan.api.YiYanApi;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageApi;
|
import org.springframework.ai.models.openai.OpenAiImageApi;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageClient;
|
import org.springframework.ai.models.openai.OpenAiImageClient;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageOptions;
|
import org.springframework.ai.models.openai.OpenAiImageOptions;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
|
import org.springframework.ai.models.midjourney.MidjourneyConfig;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyMessage;
|
import org.springframework.ai.models.midjourney.MidjourneyMessage;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.api.MidjourneyInteractionsApi;
|
import org.springframework.ai.models.midjourney.api.MidjourneyInteractionsApi;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.MidjourneyMessageHandler;
|
import org.springframework.ai.models.midjourney.webSocket.MidjourneyMessageHandler;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.MidjourneyWebSocketStarter;
|
import org.springframework.ai.models.midjourney.webSocket.MidjourneyWebSocketStarter;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.listener.MidjourneyMessageListener;
|
import org.springframework.ai.models.midjourney.webSocket.listener.MidjourneyMessageListener;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.config;
|
package cn.iocoder.yudao.framework.ai.config;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
|
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||||
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatModel;
|
import org.springframework.ai.models.xinghuo.XingHuoChatModel;
|
||||||
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoOptions;
|
import org.springframework.ai.models.xinghuo.XingHuoOptions;
|
||||||
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatModel;
|
import org.springframework.ai.models.yiyan.YiYanChatModel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.config;
|
package cn.iocoder.yudao.framework.ai.config;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
|
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||||
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatModel;
|
import org.springframework.ai.models.xinghuo.XingHuoChatModel;
|
||||||
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatModel;
|
import org.springframework.ai.models.yiyan.YiYanChatModel;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageModelEnum;
|
import org.springframework.ai.models.openai.enums.OpenAiImageModelEnum;
|
||||||
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageStyleEnum;
|
import org.springframework.ai.models.openai.enums.OpenAiImageStyleEnum;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai;
|
package cn.iocoder.yudao.framework.ai.core.enums;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.exception;
|
package cn.iocoder.yudao.framework.ai.core.exception;
|
||||||
|
|
||||||
|
// TODO @fan:这个有办法干掉么?
|
||||||
/**
|
/**
|
||||||
* ai 异常
|
* ai 异常
|
||||||
*
|
*
|
@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* 芋道 AI Starter,整体参考 spring-ai 拓展
|
||||||
|
*/
|
||||||
|
package cn.iocoder.yudao.framework.ai.core;
|
@ -1,15 +0,0 @@
|
|||||||
/**
|
|
||||||
* author: fansili
|
|
||||||
* time: 2024/3/12 20:29
|
|
||||||
*
|
|
||||||
* TODO @fansili:包的想法,需要重点看看
|
|
||||||
*
|
|
||||||
* 1. org.springframework.ai:包括 chat、image、model、parser、util 部分
|
|
||||||
*
|
|
||||||
* 2. yudao.framework.models
|
|
||||||
* \qianwen 通义千问
|
|
||||||
* \yiyan 文心一言
|
|
||||||
* \xinghuo 星火
|
|
||||||
* \midjourney
|
|
||||||
*/
|
|
||||||
package cn.iocoder.yudao.framework.ai;
|
|
@ -14,12 +14,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat;
|
package org.springframework.ai.chat;
|
||||||
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.UserMessage;
|
import org.springframework.ai.chat.messages.UserMessage;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.prompt.Prompt;
|
import org.springframework.ai.chat.prompt.Prompt;
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelClient;
|
import org.springframework.ai.model.ModelClient;
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ChatClient extends ModelClient<Prompt, ChatResponse> {
|
public interface ChatClient extends ModelClient<Prompt, ChatResponse> {
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.chat;
|
package org.springframework.ai.chat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 聊天异常
|
* 聊天异常
|
@ -13,13 +13,12 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.iocoder.yudao.framework.ai.chat;
|
package org.springframework.ai.chat;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.metadata.ChatResponseMetadata;
|
import org.springframework.ai.chat.metadata.ChatResponseMetadata;
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelResponse;
|
import org.springframework.ai.model.ModelResponse;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
@ -14,11 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat;
|
package org.springframework.ai.chat;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.AssistantMessage;
|
import org.springframework.ai.chat.messages.AssistantMessage;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.metadata.ChatGenerationMetadata;
|
import org.springframework.ai.chat.metadata.ChatGenerationMetadata;
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelResult;
|
import org.springframework.ai.model.ModelResult;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
@ -14,10 +14,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat;
|
package org.springframework.ai.chat;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.prompt.Prompt;
|
import org.springframework.ai.chat.prompt.Prompt;
|
||||||
import cn.iocoder.yudao.framework.ai.model.StreamingModelClient;
|
import org.springframework.ai.model.StreamingModelClient;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
public enum MessageType {
|
public enum MessageType {
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.messages;
|
package org.springframework.ai.chat.messages;
|
||||||
|
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
|
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.metadata;
|
package org.springframework.ai.chat.metadata;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ResultMetadata;
|
import org.springframework.ai.model.ResultMetadata;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
@ -14,10 +14,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.metadata;
|
package org.springframework.ai.chat.metadata;
|
||||||
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ResponseMetadata;
|
import org.springframework.ai.model.ResponseMetadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract Data Type (ADT) modeling common AI provider metadata returned in an AI
|
* Abstract Data Type (ADT) modeling common AI provider metadata returned in an AI
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.metadata;
|
package org.springframework.ai.chat.metadata;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.metadata;
|
package org.springframework.ai.chat.metadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A EmpytUsage implementation that returns zero for all property getters
|
* A EmpytUsage implementation that returns zero for all property getters
|
@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.iocoder.yudao.framework.ai.chat.metadata;
|
package org.springframework.ai.chat.metadata;
|
||||||
|
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.metadata;
|
package org.springframework.ai.chat.metadata;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.metadata;
|
package org.springframework.ai.chat.metadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 抽象数据类型(ADT)封装关于人工智能提供商API使用的元数据根据AI请求。
|
* 抽象数据类型(ADT)封装关于人工智能提供商API使用的元数据根据AI请求。
|
@ -11,4 +11,4 @@
|
|||||||
* This bounded context is designed to encapsulate all aspects of chat-based AI
|
* This bounded context is designed to encapsulate all aspects of chat-based AI
|
||||||
* functionalities, maintaining a clear boundary from other contexts within the AI domain.
|
* functionalities, maintaining a clear boundary from other contexts within the AI domain.
|
||||||
*/
|
*/
|
||||||
package cn.iocoder.yudao.framework.ai.chat;
|
package org.springframework.ai.chat;
|
@ -14,10 +14,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.AssistantMessage;
|
import org.springframework.ai.chat.messages.AssistantMessage;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.Message;
|
import org.springframework.ai.chat.messages.Message;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelOptions;
|
import org.springframework.ai.model.ModelOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 聊天选项代表了常见的选项,可在不同的聊天模式中移植。
|
* 聊天选项代表了常见的选项,可在不同的聊天模式中移植。
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
public class ChatOptionsBuilder {
|
public class ChatOptionsBuilder {
|
||||||
|
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.Message;
|
import org.springframework.ai.chat.messages.Message;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
public class FunctionPromptTemplate extends PromptTemplate {
|
public class FunctionPromptTemplate extends PromptTemplate {
|
||||||
|
|
@ -14,13 +14,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.ChatResponse;
|
import org.springframework.ai.chat.messages.Message;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.Message;
|
import org.springframework.ai.chat.messages.UserMessage;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.UserMessage;
|
import org.springframework.ai.model.ModelOptions;
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelOptions;
|
import org.springframework.ai.model.ModelRequest;
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelRequest;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -14,11 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.Message;
|
import org.springframework.ai.chat.messages.Message;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.UserMessage;
|
import org.springframework.ai.chat.messages.UserMessage;
|
||||||
import cn.iocoder.yudao.framework.ai.parser.OutputParser;
|
import org.springframework.ai.parser.OutputParser;
|
||||||
import org.antlr.runtime.Token;
|
import org.antlr.runtime.Token;
|
||||||
import org.antlr.runtime.TokenStream;
|
import org.antlr.runtime.TokenStream;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.Message;
|
import org.springframework.ai.chat.messages.Message;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.Message;
|
import org.springframework.ai.chat.messages.Message;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -14,10 +14,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.Message;
|
import org.springframework.ai.chat.messages.Message;
|
||||||
import cn.iocoder.yudao.framework.ai.chat.messages.SystemMessage;
|
import org.springframework.ai.chat.messages.SystemMessage;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.chat.prompt;
|
package org.springframework.ai.chat.prompt;
|
||||||
|
|
||||||
public enum TemplateFormat {
|
public enum TemplateFormat {
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
@ -14,10 +14,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelClient;
|
import org.springframework.ai.model.ModelClient;
|
||||||
|
|
||||||
public interface ImageClient extends ModelClient<ImagePrompt, ImageResponse> {
|
public interface ImageClient extends ModelClient<ImagePrompt, ImageResponse> {
|
||||||
|
|
@ -14,10 +14,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelResult;
|
import org.springframework.ai.model.ModelResult;
|
||||||
|
|
||||||
public class ImageGeneration implements ModelResult<Image> {
|
public class ImageGeneration implements ModelResult<Image> {
|
||||||
|
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ResultMetadata;
|
import org.springframework.ai.model.ResultMetadata;
|
||||||
|
|
||||||
public interface ImageGenerationMetadata extends ResultMetadata {
|
public interface ImageGenerationMetadata extends ResultMetadata {
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelOptions;
|
import org.springframework.ai.model.ModelOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ImageOptions represent the common options, portable across different image generation
|
* ImageOptions represent the common options, portable across different image generation
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
public class ImageOptionsBuilder {
|
public class ImageOptionsBuilder {
|
||||||
|
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelRequest;
|
import org.springframework.ai.model.ModelRequest;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelResponse;
|
import org.springframework.ai.model.ModelResponse;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
@ -14,10 +14,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.image;
|
package org.springframework.ai.image;
|
||||||
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ResponseMetadata;
|
import org.springframework.ai.model.ResponseMetadata;
|
||||||
|
|
||||||
public interface ImageResponseMetadata extends ResponseMetadata {
|
public interface ImageResponseMetadata extends ResponseMetadata {
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ModelClient interface provides a generic API for invoking AI models. It is designed
|
* The ModelClient interface provides a generic API for invoking AI models. It is designed
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface representing the customizable options for AI model interactions. This marker
|
* Interface representing the customizable options for AI model interactions. This marker
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表示对AI模型的请求的接口。此接口封装了 与人工智能模型交互所需的必要信息,包括指令或 输入(通用类型T)和附加模型选项。它提供了一种标准化的方式
|
* 表示对AI模型的请求的接口。此接口封装了 与人工智能模型交互所需的必要信息,包括指令或 输入(通用类型T)和附加模型选项。它提供了一种标准化的方式
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface provides methods to access the main output of the AI model and the
|
* This interface provides methods to access the main output of the AI model and the
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表示与AI模型的响应相关联的元数据的接口。此接口 旨在提供有关人工智能生成反应的附加信息 模型,包括处理细节和模型特定数据。它是一种价值
|
* 表示与AI模型的响应相关联的元数据的接口。此接口 旨在提供有关人工智能生成反应的附加信息 模型,包括处理细节和模型特定数据。它是一种价值
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface representing metadata associated with the results of an AI model. This
|
* Interface representing metadata associated with the results of an AI model. This
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
||||||
|
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model.function;
|
package org.springframework.ai.model.function;
|
||||||
|
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model.function;
|
package org.springframework.ai.model.function;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model.function;
|
package org.springframework.ai.model.function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.iocoder.yudao.framework.ai.model.function;
|
package org.springframework.ai.model.function;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonClassDescription;
|
import com.fasterxml.jackson.annotation.JsonClassDescription;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.model.function;
|
package org.springframework.ai.model.function;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.model.ModelOptionsUtils;
|
import org.springframework.ai.model.ModelOptionsUtils;
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model.function;
|
package org.springframework.ai.model.function;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model.function;
|
package org.springframework.ai.model.function;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.chat.prompt.ChatOptions;
|
import org.springframework.ai.chat.prompt.ChatOptions;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.iocoder.yudao.framework.ai.model.function;
|
package org.springframework.ai.model.function;
|
||||||
|
|
||||||
import net.jodah.typetools.TypeResolver;
|
import net.jodah.typetools.TypeResolver;
|
||||||
|
|
@ -8,4 +8,4 @@
|
|||||||
* ensuring a broad applicability across diverse AI scenarios.
|
* ensuring a broad applicability across diverse AI scenarios.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package cn.iocoder.yudao.framework.ai.model;
|
package org.springframework.ai.model;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney;
|
package org.springframework.ai.models.midjourney;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney;
|
package org.springframework.ai.models.midjourney;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.constants.MidjourneyGennerateStatusEnum;
|
import org.springframework.ai.models.midjourney.constants.MidjourneyGennerateStatusEnum;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.api;
|
package org.springframework.ai.models.midjourney.api;
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
|
import org.springframework.ai.models.midjourney.MidjourneyConfig;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.constants.MidjourneyConstants;
|
import org.springframework.ai.models.midjourney.constants.MidjourneyConstants;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
@ -1,12 +1,12 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.api;
|
package org.springframework.ai.models.midjourney.api;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
|
import org.springframework.ai.models.midjourney.MidjourneyConfig;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.api.req.AttachmentsReq;
|
import org.springframework.ai.models.midjourney.api.req.AttachmentsReq;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.api.req.DescribeReq;
|
import org.springframework.ai.models.midjourney.api.req.DescribeReq;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.api.req.ReRollReq;
|
import org.springframework.ai.models.midjourney.api.req.ReRollReq;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.api.res.UploadAttachmentsRes;
|
import org.springframework.ai.models.midjourney.api.res.UploadAttachmentsRes;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.util.MidjourneyUtil;
|
import org.springframework.ai.models.midjourney.util.MidjourneyUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.api.req;
|
package org.springframework.ai.models.midjourney.api.req;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.api.req;
|
package org.springframework.ai.models.midjourney.api.req;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.api.req;
|
package org.springframework.ai.models.midjourney.api.req;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.api.res;
|
package org.springframework.ai.models.midjourney.api.res;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.constants;
|
package org.springframework.ai.models.midjourney.constants;
|
||||||
|
|
||||||
public final class MidjourneyConstants {
|
public final class MidjourneyConstants {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.constants;
|
package org.springframework.ai.models.midjourney.constants;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.constants;
|
package org.springframework.ai.models.midjourney.constants;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.constants;
|
package org.springframework.ai.models.midjourney.constants;
|
||||||
|
|
||||||
|
|
||||||
public enum MidjourneyMessageTypeEnum {
|
public enum MidjourneyMessageTypeEnum {
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.constants;
|
package org.springframework.ai.models.midjourney.constants;
|
||||||
|
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.util;
|
package org.springframework.ai.models.midjourney.util;
|
||||||
|
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyMessage;
|
import org.springframework.ai.models.midjourney.MidjourneyMessage;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.webSocket;
|
package org.springframework.ai.models.midjourney.webSocket;
|
||||||
|
|
||||||
|
|
||||||
public interface FailureCallback {
|
public interface FailureCallback {
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.webSocket;
|
package org.springframework.ai.models.midjourney.webSocket;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyMessage;
|
import org.springframework.ai.models.midjourney.MidjourneyMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message handler
|
* message handler
|
@ -1,12 +1,12 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.webSocket;
|
package org.springframework.ai.models.midjourney.webSocket;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.hutool.core.thread.ThreadUtil;
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
|
import org.springframework.ai.models.midjourney.MidjourneyConfig;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.constants.MidjourneyNotifyCode;
|
import org.springframework.ai.models.midjourney.constants.MidjourneyNotifyCode;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.handler.MidjourneyWebSocketHandler;
|
import org.springframework.ai.models.midjourney.webSocket.handler.MidjourneyWebSocketHandler;
|
||||||
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.listener.MidjourneyMessageListener;
|
import org.springframework.ai.models.midjourney.webSocket.listener.MidjourneyMessageListener;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.tomcat.websocket.Constants;
|
import org.apache.tomcat.websocket.Constants;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.midjourney.webSocket;
|
package org.springframework.ai.models.midjourney.webSocket;
|
||||||
|
|
||||||
|
|
||||||
public interface SuccessCallback {
|
public interface SuccessCallback {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user