【优化】AI:调整 ai starter 的包封装

This commit is contained in:
YunaiV 2024-05-12 19:43:41 +08:00
parent eb8cd3d736
commit 56caa3d598
154 changed files with 366 additions and 359 deletions

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.ai.config;
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
import cn.iocoder.yudao.framework.ai.chat.ChatClient;
import cn.iocoder.yudao.framework.ai.chat.StreamingChatClient;
import cn.iocoder.yudao.framework.ai.chatqianwen.QianWenChatClient;
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatClient;
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatClient;
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
import org.springframework.ai.chat.ChatClient;
import org.springframework.ai.chat.StreamingChatClient;
import org.springframework.ai.models.tongyi.QianWenChatClient;
import org.springframework.ai.models.xinghuo.XingHuoChatClient;
import org.springframework.ai.models.yiyan.YiYanChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

View File

@ -1,6 +1,6 @@
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.AiImageDallDrawingRespVO;
import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageListRespVO;

View File

@ -1,6 +1,6 @@
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.module.ai.dal.dataobject.model.AiChatModelDO;
import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO;

View File

@ -1,6 +1,6 @@
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.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;

View File

@ -1,6 +1,6 @@
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.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;

View File

@ -1,7 +1,10 @@
package cn.iocoder.yudao.module.ai.dal.vo;
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.ai.models.xinghuo.XingHuoChatModel;
import org.springframework.ai.models.yiyan.YiYanChatModel;
/**
* modal config
@ -16,13 +19,13 @@ public class AiChatModalConfigVO {
/**
* 模型平台 (冗余方便类型转换)
* 参考{@link cn.iocoder.yudao.framework.ai.AiPlatformEnum}
* 参考{@link AiPlatformEnum}
*/
private String platform;
/**
* 模型类型(冗余方便类型转换)
* {@link cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatModel}
* {@link cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatModel}
* {@link YiYanChatModel}
* {@link XingHuoChatModel}
*/
private String type;
}

View File

@ -1,6 +1,6 @@
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.experimental.Accessors;

View File

@ -1,12 +1,12 @@
package cn.iocoder.yudao.module.ai.service.impl;
import cn.hutool.core.exceptions.ExceptionUtil;
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
import cn.iocoder.yudao.framework.ai.chat.ChatClient;
import cn.iocoder.yudao.framework.ai.chat.ChatResponse;
import cn.iocoder.yudao.framework.ai.chat.StreamingChatClient;
import cn.iocoder.yudao.framework.ai.chat.messages.MessageType;
import cn.iocoder.yudao.framework.ai.chat.prompt.Prompt;
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
import org.springframework.ai.chat.ChatClient;
import org.springframework.ai.chat.ChatResponse;
import org.springframework.ai.chat.StreamingChatClient;
import org.springframework.ai.chat.messages.MessageType;
import org.springframework.ai.chat.prompt.Prompt;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.ai.ErrorCodeConstants;

View File

@ -2,18 +2,18 @@ package cn.iocoder.yudao.module.ai.service.impl;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.ai.exception.AiException;
import cn.iocoder.yudao.framework.ai.image.ImageGeneration;
import cn.iocoder.yudao.framework.ai.image.ImagePrompt;
import cn.iocoder.yudao.framework.ai.image.ImageResponse;
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageClient;
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageOptions;
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageModelEnum;
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageStyleEnum;
import cn.iocoder.yudao.framework.ai.midjourney.api.MidjourneyInteractionsApi;
import cn.iocoder.yudao.framework.ai.midjourney.api.req.ReRollReq;
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.MidjourneyWebSocketStarter;
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.WssNotify;
import cn.iocoder.yudao.framework.ai.core.exception.AiException;
import org.springframework.ai.image.ImageGeneration;
import org.springframework.ai.image.ImagePrompt;
import org.springframework.ai.image.ImageResponse;
import org.springframework.ai.models.openai.OpenAiImageClient;
import org.springframework.ai.models.openai.OpenAiImageOptions;
import org.springframework.ai.models.openai.enums.OpenAiImageModelEnum;
import org.springframework.ai.models.openai.enums.OpenAiImageStyleEnum;
import org.springframework.ai.models.midjourney.api.MidjourneyInteractionsApi;
import org.springframework.ai.models.midjourney.api.req.ReRollReq;
import org.springframework.ai.models.midjourney.webSocket.MidjourneyWebSocketStarter;
import org.springframework.ai.models.midjourney.webSocket.WssNotify;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;

View File

@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.ai.service.midjourneyHandler;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyMessage;
import cn.iocoder.yudao.framework.ai.midjourney.constants.MidjourneyGennerateStatusEnum;
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.MidjourneyMessageHandler;
import org.springframework.ai.models.midjourney.MidjourneyMessage;
import org.springframework.ai.models.midjourney.constants.MidjourneyGennerateStatusEnum;
import org.springframework.ai.models.midjourney.webSocket.MidjourneyMessageHandler;
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.convert.AiImageConvert;

View File

@ -1,6 +1,6 @@
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.pojo.PageResult;
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.Set;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;

View File

@ -10,6 +10,7 @@
</parent>
<artifactId>yudao-spring-boot-starter-ai</artifactId>
<!-- TODO 芋艿:这里需要进一步减少 -->
<properties>
<maven.compiler.source>21</maven.compiler.source>
@ -17,6 +18,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- TODO fan这里包要进一步减少 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>

View File

@ -1,25 +1,25 @@
package cn.iocoder.yudao.framework.ai.config;
import cn.hutool.core.io.IoUtil;
import cn.iocoder.yudao.framework.ai.chatqianwen.QianWenChatClient;
import cn.iocoder.yudao.framework.ai.chatqianwen.QianWenChatModal;
import cn.iocoder.yudao.framework.ai.chatqianwen.QianWenOptions;
import cn.iocoder.yudao.framework.ai.chatqianwen.api.QianWenApi;
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatClient;
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoOptions;
import cn.iocoder.yudao.framework.ai.chatxinghuo.api.XingHuoApi;
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatClient;
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanOptions;
import cn.iocoder.yudao.framework.ai.chatyiyan.api.YiYanApi;
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageApi;
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageClient;
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageOptions;
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyMessage;
import cn.iocoder.yudao.framework.ai.midjourney.api.MidjourneyInteractionsApi;
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.MidjourneyMessageHandler;
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.MidjourneyWebSocketStarter;
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.listener.MidjourneyMessageListener;
import org.springframework.ai.models.tongyi.QianWenChatClient;
import org.springframework.ai.models.tongyi.QianWenChatModal;
import org.springframework.ai.models.tongyi.QianWenOptions;
import org.springframework.ai.models.tongyi.api.QianWenApi;
import org.springframework.ai.models.xinghuo.XingHuoChatClient;
import org.springframework.ai.models.xinghuo.XingHuoOptions;
import org.springframework.ai.models.xinghuo.api.XingHuoApi;
import org.springframework.ai.models.yiyan.YiYanChatClient;
import org.springframework.ai.models.yiyan.YiYanOptions;
import org.springframework.ai.models.yiyan.api.YiYanApi;
import org.springframework.ai.models.openai.OpenAiImageApi;
import org.springframework.ai.models.openai.OpenAiImageClient;
import org.springframework.ai.models.openai.OpenAiImageOptions;
import org.springframework.ai.models.midjourney.MidjourneyConfig;
import org.springframework.ai.models.midjourney.MidjourneyMessage;
import org.springframework.ai.models.midjourney.api.MidjourneyInteractionsApi;
import org.springframework.ai.models.midjourney.webSocket.MidjourneyMessageHandler;
import org.springframework.ai.models.midjourney.webSocket.MidjourneyWebSocketStarter;
import org.springframework.ai.models.midjourney.webSocket.listener.MidjourneyMessageListener;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.boot.autoconfigure.AutoConfiguration;

View File

@ -1,12 +1,11 @@
package cn.iocoder.yudao.framework.ai.config;
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatModel;
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoOptions;
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatModel;
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
import org.springframework.ai.models.xinghuo.XingHuoChatModel;
import org.springframework.ai.models.xinghuo.XingHuoOptions;
import org.springframework.ai.models.yiyan.YiYanChatModel;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.LinkedHashMap;
import java.util.Map;

View File

@ -1,10 +1,10 @@
package cn.iocoder.yudao.framework.ai.config;
import cn.iocoder.yudao.framework.ai.AiPlatformEnum;
import cn.iocoder.yudao.framework.ai.chatxinghuo.XingHuoChatModel;
import cn.iocoder.yudao.framework.ai.chatyiyan.YiYanChatModel;
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageModelEnum;
import cn.iocoder.yudao.framework.ai.imageopenai.enums.OpenAiImageStyleEnum;
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
import org.springframework.ai.models.xinghuo.XingHuoChatModel;
import org.springframework.ai.models.yiyan.YiYanChatModel;
import org.springframework.ai.models.openai.enums.OpenAiImageModelEnum;
import org.springframework.ai.models.openai.enums.OpenAiImageStyleEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -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 lombok.AllArgsConstructor;

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.framework.ai.exception;
package cn.iocoder.yudao.framework.ai.core.exception;
// TODO @fan这个有办法干掉么
/**
* ai 异常
*

View File

@ -0,0 +1,4 @@
/**
* 芋道 AI Starter整体参考 spring-ai 拓展
*/
package cn.iocoder.yudao.framework.ai.core;

View File

@ -1,15 +0,0 @@
/**
* author: fansili
* time: 2024/3/12 20:29
*
* TODO @fansili包的想法需要重点看看
*
* 1. org.springframework.ai包括 chatimagemodelparserutil 部分
*
* 2. yudao.framework.models
* \qianwen 通义千问
* \yiyan 文心一言
* \xinghuo 星火
* \midjourney
*/
package cn.iocoder.yudao.framework.ai;

View File

@ -14,12 +14,12 @@
* 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 cn.iocoder.yudao.framework.ai.chat.prompt.Prompt;
import cn.iocoder.yudao.framework.ai.model.ModelClient;
import org.springframework.ai.chat.messages.UserMessage;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.ai.model.ModelClient;
@FunctionalInterface
public interface ChatClient extends ModelClient<Prompt, ChatResponse> {

View File

@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* 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 cn.iocoder.yudao.framework.ai.model.ModelResponse;
import org.springframework.ai.chat.metadata.ChatResponseMetadata;
import org.springframework.ai.model.ModelResponse;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

View File

@ -14,11 +14,11 @@
* 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 cn.iocoder.yudao.framework.ai.chat.metadata.ChatGenerationMetadata;
import cn.iocoder.yudao.framework.ai.model.ModelResult;
import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.chat.metadata.ChatGenerationMetadata;
import org.springframework.ai.model.ModelResult;
import org.springframework.lang.Nullable;
import java.util.Map;

View File

@ -14,10 +14,10 @@
* 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 cn.iocoder.yudao.framework.ai.model.StreamingModelClient;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.ai.model.StreamingModelClient;
import reactor.core.publisher.Flux;
@FunctionalInterface

View File

@ -14,7 +14,7 @@
* 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.util.Assert;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.messages;
package org.springframework.ai.chat.messages;
import java.util.Map;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.messages;
package org.springframework.ai.chat.messages;
import java.util.Map;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.messages;
package org.springframework.ai.chat.messages;
import java.util.Map;

View File

@ -14,7 +14,7 @@
* 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.MimeType;

View File

@ -14,7 +14,7 @@
* 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.Map;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.messages;
package org.springframework.ai.chat.messages;
public enum MessageType {

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.messages;
package org.springframework.ai.chat.messages;
import org.springframework.core.io.Resource;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.messages;
package org.springframework.ai.chat.messages;
import org.springframework.core.io.Resource;

View File

@ -14,9 +14,9 @@
* 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;
/**

View File

@ -14,10 +14,10 @@
* 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

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.metadata;
package org.springframework.ai.chat.metadata;
import java.time.Duration;

View File

@ -14,7 +14,7 @@
* 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

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.metadata;
package org.springframework.ai.chat.metadata;
import org.springframework.util.Assert;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.metadata;
package org.springframework.ai.chat.metadata;
import java.time.Duration;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.metadata;
package org.springframework.ai.chat.metadata;
/**
* 抽象数据类型ADT封装关于人工智能提供商API使用的元数据根据AI请求

View File

@ -11,4 +11,4 @@
* 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.
*/
package cn.iocoder.yudao.framework.ai.chat;
package org.springframework.ai.chat;

View File

@ -14,10 +14,10 @@
* 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 cn.iocoder.yudao.framework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.chat.messages.Message;
import org.springframework.core.io.Resource;
import java.util.Map;

View File

@ -14,9 +14,9 @@
* 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;
/**
* 聊天选项代表了常见的选项可在不同的聊天模式中移植

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.prompt;
package org.springframework.ai.chat.prompt;
public class ChatOptionsBuilder {

View File

@ -14,9 +14,9 @@
* 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.List;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.prompt;
package org.springframework.ai.chat.prompt;
public class FunctionPromptTemplate extends PromptTemplate {

View File

@ -14,13 +14,12 @@
* 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 cn.iocoder.yudao.framework.ai.chat.messages.Message;
import cn.iocoder.yudao.framework.ai.chat.messages.UserMessage;
import cn.iocoder.yudao.framework.ai.model.ModelOptions;
import cn.iocoder.yudao.framework.ai.model.ModelRequest;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.UserMessage;
import org.springframework.ai.model.ModelOptions;
import org.springframework.ai.model.ModelRequest;
import java.util.Collections;
import java.util.List;

View File

@ -14,11 +14,11 @@
* 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 cn.iocoder.yudao.framework.ai.chat.messages.UserMessage;
import cn.iocoder.yudao.framework.ai.parser.OutputParser;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.UserMessage;
import org.springframework.ai.parser.OutputParser;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;
import org.springframework.core.io.Resource;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.prompt;
package org.springframework.ai.chat.prompt;
import java.util.Map;

View File

@ -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.Map;

View File

@ -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;

View File

@ -14,10 +14,10 @@
* 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 cn.iocoder.yudao.framework.ai.chat.messages.SystemMessage;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.SystemMessage;
import org.springframework.core.io.Resource;
import java.util.Map;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.chat.prompt;
package org.springframework.ai.chat.prompt;
public enum TemplateFormat {

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.image;
package org.springframework.ai.image;
import java.util.Objects;

View File

@ -14,10 +14,10 @@
* 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> {

View File

@ -14,10 +14,10 @@
* 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> {

View File

@ -14,9 +14,9 @@
* 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 {

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.image;
package org.springframework.ai.image;
import java.util.Objects;

View File

@ -14,9 +14,9 @@
* 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

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.image;
package org.springframework.ai.image;
public class ImageOptionsBuilder {

View File

@ -14,9 +14,9 @@
* 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.List;

View File

@ -14,9 +14,9 @@
* 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.Objects;

View File

@ -14,10 +14,10 @@
* 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 {

View File

@ -14,7 +14,7 @@
* 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

View File

@ -14,7 +14,7 @@
* 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

View File

@ -14,7 +14,7 @@
* 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.core.JsonProcessingException;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.model;
package org.springframework.ai.model;
/**
* 表示对AI模型的请求的接口此接口封装了 与人工智能模型交互所需的必要信息包括指令或 输入通用类型T和附加模型选项它提供了一种标准化的方式

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.model;
package org.springframework.ai.model;
import java.util.List;

View File

@ -14,7 +14,7 @@
* 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

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.model;
package org.springframework.ai.model;
/**
* 表示与AI模型的响应相关联的元数据的接口此接口 旨在提供有关人工智能生成反应的附加信息 模型包括处理细节和模型特定数据它是一种价值

View File

@ -14,7 +14,7 @@
* 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

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.model;
package org.springframework.ai.model;
import reactor.core.publisher.Flux;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.model.function;
package org.springframework.ai.model.function;
import org.springframework.util.CollectionUtils;

View File

@ -14,7 +14,7 @@
* 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.databind.ObjectMapper;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.model.function;
package org.springframework.ai.model.function;
/**
*

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* 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 org.springframework.beans.BeansException;

View File

@ -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.ObjectMapper;
import org.springframework.util.Assert;

View File

@ -14,7 +14,7 @@
* 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.Set;

View File

@ -14,9 +14,9 @@
* 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 java.util.ArrayList;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package cn.iocoder.yudao.framework.ai.model.function;
package org.springframework.ai.model.function;
import net.jodah.typetools.TypeResolver;

View File

@ -8,4 +8,4 @@
* ensuring a broad applicability across diverse AI scenarios.
*
*/
package cn.iocoder.yudao.framework.ai.model;
package org.springframework.ai.model;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.framework.ai.midjourney;
package org.springframework.ai.models.midjourney;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -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.experimental.Accessors;

View File

@ -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.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
import cn.iocoder.yudao.framework.ai.midjourney.constants.MidjourneyConstants;
import org.springframework.ai.models.midjourney.MidjourneyConfig;
import org.springframework.ai.models.midjourney.constants.MidjourneyConstants;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders;

View File

@ -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.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
import cn.iocoder.yudao.framework.ai.midjourney.api.req.AttachmentsReq;
import cn.iocoder.yudao.framework.ai.midjourney.api.req.DescribeReq;
import cn.iocoder.yudao.framework.ai.midjourney.api.req.ReRollReq;
import cn.iocoder.yudao.framework.ai.midjourney.api.res.UploadAttachmentsRes;
import cn.iocoder.yudao.framework.ai.midjourney.util.MidjourneyUtil;
import org.springframework.ai.models.midjourney.MidjourneyConfig;
import org.springframework.ai.models.midjourney.api.req.AttachmentsReq;
import org.springframework.ai.models.midjourney.api.req.DescribeReq;
import org.springframework.ai.models.midjourney.api.req.ReRollReq;
import org.springframework.ai.models.midjourney.api.res.UploadAttachmentsRes;
import org.springframework.ai.models.midjourney.util.MidjourneyUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.google.common.collect.Lists;

View File

@ -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.experimental.Accessors;

View File

@ -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.experimental.Accessors;

View File

@ -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.experimental.Accessors;

View File

@ -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.experimental.Accessors;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.framework.ai.midjourney.constants;
package org.springframework.ai.models.midjourney.constants;
public final class MidjourneyConstants {

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.framework.ai.midjourney.constants;
package org.springframework.ai.models.midjourney.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.framework.ai.midjourney.constants;
package org.springframework.ai.models.midjourney.constants;
public enum MidjourneyMessageTypeEnum {

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.framework.ai.midjourney.constants;
package org.springframework.ai.models.midjourney.constants;
import lombok.experimental.UtilityClass;

View File

@ -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.iocoder.yudao.framework.ai.midjourney.MidjourneyMessage;
import org.springframework.ai.models.midjourney.MidjourneyMessage;
import java.util.Map;
import java.util.regex.Matcher;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.framework.ai.midjourney.webSocket;
package org.springframework.ai.models.midjourney.webSocket;
public interface FailureCallback {

View File

@ -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

View File

@ -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.thread.ThreadUtil;
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
import cn.iocoder.yudao.framework.ai.midjourney.constants.MidjourneyNotifyCode;
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.handler.MidjourneyWebSocketHandler;
import cn.iocoder.yudao.framework.ai.midjourney.webSocket.listener.MidjourneyMessageListener;
import org.springframework.ai.models.midjourney.MidjourneyConfig;
import org.springframework.ai.models.midjourney.constants.MidjourneyNotifyCode;
import org.springframework.ai.models.midjourney.webSocket.handler.MidjourneyWebSocketHandler;
import org.springframework.ai.models.midjourney.webSocket.listener.MidjourneyMessageListener;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.websocket.Constants;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.framework.ai.midjourney.webSocket;
package org.springframework.ai.models.midjourney.webSocket;
public interface SuccessCallback {

Some files were not shown because too many files have changed in this diff Show More