diff --git a/spring-cloud-alibaba-dependencies/pom.xml b/spring-cloud-alibaba-dependencies/pom.xml
index 32772456a..a3112be59 100644
--- a/spring-cloud-alibaba-dependencies/pom.xml
+++ b/spring-cloud-alibaba-dependencies/pom.xml
@@ -25,10 +25,6 @@
5.3.1
-
- 1.0.0-M1
- 2.15.1
-
4.23.01.11.4
@@ -50,19 +46,6 @@
${nacos.client.version}
-
-
- com.alibaba
- dashscope-sdk-java
- ${dashscope-sdk-java.version}
-
-
-
- org.springframework.ai
- spring-ai-core
- ${spring.ai.version}
-
-
com.alibaba.csp
@@ -235,11 +218,6 @@
${revision}
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-ai
- ${revision}
- com.alibaba.cloudspring-alibaba-nacos-config
@@ -288,14 +266,6 @@
${revision}
-
-
- org.springframework.ai
- spring-ai-test
- ${spring.ai.version}
- test
-
-
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/pom.xml b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/pom.xml
deleted file mode 100644
index 5a3198ac9..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/pom.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
- spring-cloud-alibaba-examples
- com.alibaba.cloud
- ${revision}
- ../../pom.xml
-
- 4.0.0
-
- spring-cloud-ai-chat-msg-context-example
- Spring Cloud Starter Alibaba AI Chat Message Context Holder Example
- Example for Chat Message Context Holder By Spring Cloud Alibaba AI
- jar
-
-
-
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-ai
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- ${maven-deploy-plugin.version}
-
- true
-
-
-
-
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- false
-
-
-
-
-
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/ChatMsgApplication.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/ChatMsgApplication.java
deleted file mode 100644
index c727befca..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/ChatMsgApplication.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-/**
- * @author yuluo
- * @author yuluo
- */
-
-@SpringBootApplication
-public class ChatMsgApplication {
-
- public static void main(String[] args) {
-
- SpringApplication.run(ChatMsgApplication.class, args);
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/MessageContextHolder.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/MessageContextHolder.java
deleted file mode 100644
index 347037a6b..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/MessageContextHolder.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.context;
-
-import java.util.List;
-
-import org.springframework.ai.chat.messages.Message;
-
-/**
- * @author yuluo
- * @author yuluo
- */
-
-public interface MessageContextHolder {
-
- /**
- * Th default session id key.
- * Can use session_id request_id &etc.
- */
- String SCA_SESSION_ID = "SCA_SESSION_ID";
-
- void addMsg(String sessionId, Message msg);
-
- void removeMsg(String sessionId);
-
- List getMsg(String sessionId);
-
- default String getSCASessionId() {
-
- return SCA_SESSION_ID;
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/defaults/MemoryMessageContextHolder.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/defaults/MemoryMessageContextHolder.java
deleted file mode 100644
index f67226620..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/defaults/MemoryMessageContextHolder.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.context.defaults;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringJoiner;
-
-import com.alibaba.cloud.ai.example.tongyi.context.MessageContextHolder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.ai.chat.messages.Message;
-import org.springframework.stereotype.Component;
-
-/**
- * @author yuluo
- * @author yuluo
- */
-
-@Component
-public class MemoryMessageContextHolder implements MessageContextHolder {
-
- private static final Logger log = LoggerFactory.getLogger(MemoryMessageContextHolder.class);
-
- private final Map> msgContextHolderMap = new HashMap<>();
-
- @Override
- public void addMsg(String sessionId, Message msg) {
-
- msgContextHolderMap.computeIfAbsent(sessionId, k -> new ArrayList<>());
- log.info("addMsg: sessionId={}, msg={}", sessionId, msg);
- }
-
- @Override
- public void removeMsg(String sessionId) {
-
- msgContextHolderMap.remove(sessionId);
- }
-
- @Override
- public List getMsg(String sessionId) {
-
- return new ArrayList<>(msgContextHolderMap.getOrDefault(sessionId, new ArrayList<>()));
- }
-
- @Override
- public String toString() {
-
- StringBuilder sb = new StringBuilder();
- sb.append("MessageContextHolderImpl{");
- StringJoiner joiner = new StringJoiner(", ", "{", "}");
- for (Map.Entry> entry : msgContextHolderMap.entrySet()) {
- joiner.add(entry.getKey() + "=" + entry.getValue().toString());
- }
- sb.append("msgContextHolderMap=").append(joiner);
- sb.append('}');
- return sb.toString();
- }
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/defaults/RedisMessageContextHolder.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/defaults/RedisMessageContextHolder.java
deleted file mode 100644
index 9aaf2409b..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/context/defaults/RedisMessageContextHolder.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.context.defaults;
-
-import java.util.List;
-
-import com.alibaba.cloud.ai.example.tongyi.context.MessageContextHolder;
-
-import org.springframework.ai.chat.messages.Message;
-
-/**
- * @author yuluo
- * @author yuluo
- */
-
-//@Component
-public class RedisMessageContextHolder implements MessageContextHolder {
-
- @Override
- public void addMsg(String sessionId, Message msg) {
-
- System.out.println("RedisMessageContextHolder addMsg");
- }
-
- @Override
- public void removeMsg(String sessionId) {
-
- System.out.println("RedisMessageContextHolder removeMsg");
- }
-
- @Override
- public List getMsg(String sessionId) {
-
- System.out.println("RedisMessageContextHolder getMsg");
- return null;
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/controller/ChatMsgController.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/controller/ChatMsgController.java
deleted file mode 100644
index 3f0244204..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/controller/ChatMsgController.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.controller;
-
-import com.alibaba.cloud.ai.example.tongyi.service.ChatMsgService;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author yuluo
- * @author yuluo
- */
-
-@RestController
-@RequestMapping("/chat")
-public class ChatMsgController {
-
- @Autowired
- private ChatMsgService msgService;
-
- @GetMapping("/msg")
- public String completion(@RequestParam String message) {
-
- return msgService.completion(message);
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/ChatMsgService.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/ChatMsgService.java
deleted file mode 100644
index 7453cf56b..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/ChatMsgService.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service;
-
-import com.alibaba.cloud.ai.example.tongyi.context.MessageContextHolder;
-
-import org.springframework.ai.chat.messages.UserMessage;
-import org.springframework.ai.chat.model.ChatModel;
-import org.springframework.ai.chat.model.ChatResponse;
-import org.springframework.ai.chat.prompt.Prompt;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * @author yuluo
- * @author yuluo
- */
-
-@Service
-public class ChatMsgService {
-
- private final ChatModel chatModel;
-
- private final MessageContextHolder messageContextHolder;
-
- @Autowired
- public ChatMsgService(ChatModel chatModel, MessageContextHolder messageContextHolder) {
- this.chatModel = chatModel;
- this.messageContextHolder = messageContextHolder;
- }
-
- public String completion(String message) {
-
- // create chat prompt
- Prompt prompt = new Prompt(new UserMessage(message));
-
- // collect user message
- messageContextHolder.addMsg(
- messageContextHolder.getSCASessionId(),
- prompt.getInstructions().get(0)
- );
-
- ChatResponse resp = chatModel.call(prompt);
-
- // collect model response
- messageContextHolder.addMsg(
- messageContextHolder.getSCASessionId(),
- resp.getResult().getOutput()
- );
-
- return resp.getResult().getOutput().getContent();
-
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/resources/application.yml b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/resources/application.yml
deleted file mode 100644
index ae8fa1f42..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-chat-msg-context-example/src/main/resources/application.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright 2023-2024 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-server:
- port: 8084
-
-spring:
- application:
- name: tongyi-example
-
-# please setting api-key. suggestion by environment variable.
-# Note: api-key is invalid, please apply for a new one.
-# export SPRING_CLOUD_AI_TONGYI_API_KEY=sk-a3d73b1709bf4a178c28ed7c8b3b5a345
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/README-en.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/README-en.md
deleted file mode 100644
index fdce8e8ca..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/README-en.md
+++ /dev/null
@@ -1,118 +0,0 @@
-# Spring Cloud Alibaba AI Example
-
-## Project description
-
-The Spring Cloud Alibaba AI module is based on [Spring AI 0.8.1](https://docs.spring.io/spring-ai/reference/0.8-SNAPSHOT/index.html) the project API to complete the access of the general series of large models. This project demonstrates how to use `spring-cloud-starter-alibaba-ai` the Spring Cloud microservice application to integrate with the generic family model.
-
-[model service dashscope](https://help.aliyun.com/zh/dashscope/) It is a big model application service launched by Alibaba. Based on the concept of "Model-as-a-Service" (MaaS), Lingji Model Service provides a variety of model services including model reasoning and model fine-tuning training through standardized APIs around AI models in various fields.
-
-- Current completion of spring-ai chat api and image api.
-
-## Application access
-
-### Access `spring-cloud-starter-alibaba-ai`
-
-1. Add the following dependencies to the project POM. XML:
-
- ```xml
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-ai
-
- ```
-
-2. Add the following configuration to the application. Yml configuration file:
-
- > Note: It is recommended to set the api-key as an environment variable to avoid api-key leakage.
- >
- > ```shell
- > export SPRING_CLOUD_AI_TONGYI_API_KEY=sk-a3d73b1709bf4a178c28ed7c8b3b5a45
- > ```
-
- ```yml
- spring:
- cloud:
- ai:
- tongyi:
- # apikey is invalid.
- api-key: sk-a3d73b1709bf4a178c28ed7c8b3b5a45
- ```
-
-3. Add the following code:
-
- ```yml
- controller:
-
- @Autowired
- @Qualifier("tongYiSimpleServiceImpl")
- private TongYiService tongYiSimpleService;
-
- @GetMapping("/example")
- public String completion(
- @RequestParam(value = "message", defaultValue = "Tell me a joke")
- String message
- ) {
-
- return tongYiSimpleService.completion(message);
- }
-
- service:
-
- private final ChatClient chatClient;
-
-
- @Autowired
- public TongYiSimpleServiceImpl(ChatClient chatClient, StreamingChatClient streamingChatClient) {
-
- this.chatClient = chatClient;
- this.streamingChatClient = streamingChatClient;
- }
-
- @Override
- public String completion(String message) {
-
- Prompt prompt = new Prompt(new UserMessage(message));
-
- return chatClient.call(prompt).getResult().getOutput().getContent();
- }
- ```
-
- At this point, the simplest model access is complete! It is slightly different from the code in this example, but the code in the example does not need to be modified. The corresponding function can be accomplished without modification.
-
-4. Start the application
-
- This Example project supports the following two startup methods:
-
- 1. IDE direct startup: find the main class `TongYiApplication` and execute the main method to start the application.
- 2. Start after packaging and compiling: First `mvn clean package`, compile and package the project, and then enter the `target` folder to `java -jar spring-cloud-ai-example.jar` start the application.
-
-## Validate
-
-Browser address bar input: `http://localhost:8080/ai/example`
-
-The following response is returned:
-
-
-```json
-{
- "Tell me a joke": "Sure, here's a classic one for you:\n\nWhy was the math book sad?\n\nBecause it had too many problems.\n\nI hope that made you smile! If you're looking for more, just let me know."
-}
-```
-
-## Simple front pages
-
-cd `resources/static`,open index.html file by local browser, input your question. then you get ai-models output(make api-keys effective):
-
-![ai-example](./images/sca-ai-example-front.gif)
-
-## Configuration item description
-
-More configuration refer:
-
-https://help.aliyun.com/zh/dashscope/developer-reference/api-details
-
-## More examples:
-
-This example consists of 6 samples, implemented by different serviceimpl, you can refer to the readme file in each serviceimpl, use @RestController as the entry point in the controller, you can use the browser or curl tool to request the interface. You can use a browser or curl tool to request the interface.
-
-> The example is already functional and does not require any code changes. Just replace the apikey in the corresponding example, the apikey provided in the project is invalid.
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/README.md
deleted file mode 100644
index 3d45d78d6..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/README.md
+++ /dev/null
@@ -1,117 +0,0 @@
-# Spring Cloud Alibaba AI Example
-
-## 项目说明
-
-Spring Cloud Alibaba AI 模块基于 [Spring AI 0.8.1](https://docs.spring.io/spring-ai/reference/0.8-SNAPSHOT/index.html) 项目 API 完成通义系列大模型的接入。本项目演示如何使用 `spring-cloud-starter-alibaba-ai` 完成 Spring Cloud 微服务应用与通义系列模型的整合。
-
-[模型服务灵积](https://help.aliyun.com/zh/dashscope/) 是阿里巴巴推出的一个大模型应用服务。灵积模型服务建立在“模型即服务”(Model-as-a-Service,MaaS)的理念基础之上,围绕AI各领域模型,通过标准化的API提供包括模型推理、模型微调训练在内的多种模型服务。
-
-- 目前只完成 spring-ai chat completion api 和 image api 的接入。
-
-## 应用接入
-
-### 接入 `spring-cloud-starter-alibaba-ai`
-
-1. 在项目 pom.xml 中加入以下依赖:
-
- ```xml
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-ai
-
- ```
-
-2. 在 application.yml 配置文件中加入以下配置:
-
- > Note: 推荐使用环境变量的方式设置 api-key,避免 api-key 泄露。
- >
- > ```shell
- > export SPRING_CLOUD_AI_TONGYI_API_KEY=sk-a3d73b1709bf4a178c28ed7c8b3b5a45
- > ```
-
- ```yaml
- spring:
- cloud:
- ai:
- tongyi:
- # apiKey is invalid.
- api-key: sk-a3d73b1709bf4a178c28ed7c8b3b5a45
- ```
-
-3. 添加如下代码:
-
- ```java
- controller:
-
- @Autowired
- @Qualifier("tongYiSimpleServiceImpl")
- private TongYiService tongYiSimpleService;
-
- @GetMapping("/example")
- public String completion(
- @RequestParam(value = "message", defaultValue = "Tell me a joke")
- String message
- ) {
-
- return tongYiSimpleService.completion(message);
- }
-
- service:
-
- private final ChatClient chatClient;
-
-
- @Autowired
- public TongYiSimpleServiceImpl(ChatClient chatClient, StreamingChatClient streamingChatClient) {
-
- this.chatClient = chatClient;
- this.streamingChatClient = streamingChatClient;
- }
-
- @Override
- public String completion(String message) {
-
- Prompt prompt = new Prompt(new UserMessage(message));
-
- return chatClient.call(prompt).getResult().getOutput().getContent();
- }
- ```
-
- 至此,便完成了最简单的模型接入!和本 example 中的代码略有不同,但 example 中的代码无需修改。可完成对应功能。
-
-4. 启动应用
-
- 本 Example 项目支持如下两种启动方式:
-
- 1. IDE 直接启动:找到主类 `TongYiApplication`,执行 main 方法启动应用。
- 2. 打包编译后启动:首先执行 `mvn clean package` 将工程编译打包,进入 `target` 文件夹执行 `java -jar spring-cloud-ai-example.jar` 启动应用。
-
-## 验证
-
-浏览器地址栏输入:`http://localhost:8080/ai/example`
-
-返回如下响应:
-
-```json
-{
- "Tell me a joke": "Sure, here's a classic one for you:\n\nWhy was the math book sad?\n\nBecause it had too many problems.\n\nI hope that made you smile! If you're looking for more, just let me know."
-}
-```
-
-## 简易前端验证
-
-进入 `resources/static` 目录下,使用浏览器打开 index.html 文件,输入问题,即可获得输出响应(确保 api-key 有效):
-
-![ai-example](./images/sca-ai-example-front.gif)
-
-## 配置项说明
-
-更多配置项参考:
-
-https://help.aliyun.com/zh/dashscope/developer-reference/api-details
-
-## 更多 example 示例:
-
-本 example 由 6 个示例组成,由不同的 serviceimpl 实现,您可以参考每个 serviceimpl 中的 readme 文件,在 controller 中使用 @RestController 作为入口点,您可以使用浏览器或者 curl 工具对接口进行请求。完成对应功能接入的练习。
-
-> example 已完成功能,无需修改代码。只在对应的 example 中替换 apikey 即可,项目中提供的 apikey 无效。
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/images/sca-ai-example-front.gif b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/images/sca-ai-example-front.gif
deleted file mode 100644
index bc84dd593..000000000
Binary files a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/images/sca-ai-example-front.gif and /dev/null differ
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/pom.xml b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/pom.xml
deleted file mode 100644
index a490f5b3c..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/pom.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
- spring-cloud-alibaba-examples
- com.alibaba.cloud
- ${revision}
- ../../pom.xml
-
- 4.0.0
-
- spring-cloud-ai-example
- Spring Cloud Starter Alibaba AI Example
- Example demonstrating how to use Spring Cloud Alibaba AI
- jar
-
-
-
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-ai
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- ${maven-deploy-plugin.version}
-
- true
-
-
-
-
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- false
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/TongYiApplication.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/TongYiApplication.java
deleted file mode 100644
index 44f134c9e..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/TongYiApplication.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-/**
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-@SpringBootApplication
-public class TongYiApplication {
-
- public static void main(String[] args) {
-
- SpringApplication.run(TongYiApplication.class);
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/controller/TongYiController.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/controller/TongYiController.java
deleted file mode 100644
index 6430549fc..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/controller/TongYiController.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.alibaba.cloud.ai.example.tongyi.models.ActorsFilms;
-import com.alibaba.cloud.ai.example.tongyi.models.Completion;
-import com.alibaba.cloud.ai.example.tongyi.service.TongYiService;
-import com.alibaba.dashscope.audio.asr.transcription.TranscriptionParam;
-
-import org.springframework.ai.chat.messages.AssistantMessage;
-import org.springframework.ai.image.ImageResponse;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.core.io.Resource;
-import org.springframework.web.bind.annotation.CrossOrigin;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * TongYi models Spring Cloud Alibaba Controller.
- *
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-@RestController
-@RequestMapping("/ai")
-@CrossOrigin
-public class TongYiController {
-
- @Autowired
- @Qualifier("tongYiSimpleServiceImpl")
- private TongYiService tongYiSimpleService;
-
- @GetMapping("/example")
- public String completion(
- @RequestParam(value = "message", defaultValue = "Tell me a joke")
- String message
- ) {
-
- return tongYiSimpleService.completion(message);
- }
-
- @GetMapping("/stream")
- public Map streamCompletion(
- @RequestParam(value = "message", defaultValue = "请告诉我西红柿炖牛腩怎么做?")
- String message
- ) {
-
- return tongYiSimpleService.streamCompletion(message);
- }
-
- @Autowired
- @Qualifier("tongYiOutputParseServiceImpl")
- private TongYiService tongYiOutputService;
-
- @GetMapping("/output")
- public ActorsFilms generate(
- @RequestParam(value = "actor", defaultValue = "Jeff Bridges") String actor
- ) {
-
- return tongYiOutputService.genOutputParse(actor);
- }
-
- @Autowired
- @Qualifier("tongYiPromptTemplateServiceImpl")
- private TongYiService tongYiPromptTemplateService;
-
- @GetMapping("/prompt-tmpl")
- public AssistantMessage completion(@RequestParam(value = "adjective", defaultValue = "funny") String adjective,
- @RequestParam(value = "topic", defaultValue = "cows") String topic) {
-
- return tongYiPromptTemplateService.genPromptTemplates(adjective, topic);
- }
-
- @Autowired
- @Qualifier("tongYiRolesServiceImpl")
- private TongYiService tongYiRolesService;
-
- @GetMapping("/roles")
- public AssistantMessage generate(
- @RequestParam(value = "message", defaultValue = "Tell me about three famous pirates from the Golden Age of Piracy and why they did. Write at least a sentence for each pirate.") String message,
- @RequestParam(value = "name", defaultValue = "bot") String name,
- @RequestParam(value = "voice", defaultValue = "pirate") String voice) {
-
- return tongYiRolesService.genRole(message, name, voice);
- }
-
- @Autowired
- @Qualifier("tongYiStuffServiceImpl")
- private TongYiService tongYiStuffService;
-
- @GetMapping("/stuff")
- public Completion completion(@RequestParam(value = "message",
- defaultValue = "Which athletes won the mixed doubles gold medal in curling at the 2022 Winter Olympics?") String message,
- @RequestParam(value = "stuffit", defaultValue = "false") boolean stuffit) {
-
- return tongYiStuffService.stuffCompletion(message, stuffit);
- }
-
- @Autowired
- @Qualifier("tongYiImagesServiceImpl")
- private TongYiService tongYiImgService;
-
- @GetMapping("/img")
- public ImageResponse genImg(@RequestParam(value = "prompt",
- defaultValue = "Painting a picture of blue water and blue sky.") String imgPrompt) {
-
- return tongYiImgService.genImg(imgPrompt);
- }
-
- @Autowired
- @Qualifier("tongYiAudioSimpleServiceImpl")
- private TongYiService tongYiAudioService;
-
- @GetMapping("/audio/speech")
- public String genAudio(@RequestParam(value = "prompt",
- defaultValue = "你好,Spring Cloud Alibaba AI 框架!") String prompt) {
-
- return tongYiAudioService.genAudio(prompt);
- }
-
- @Autowired
- @Qualifier("tongYiAudioTranscriptionServiceImpl")
- private TongYiService tongYiAudioTranscriptionService;
-
- /**
- * audio transcription. Support urls audio resource.
- * {@link Resource}
- * {@link TranscriptionParam}
- * @param url audio url.
- * @return transcription result, is String type.
- */
- @GetMapping("/audio/transcription")
- public String audioTranscription(@RequestParam(value = "audioUrls",
- defaultValue = "https://dashscope.oss-cn-beijing.aliyuncs.com/samples/audio/paraformer/realtime_asr_example.wav") String url) {
-
- return tongYiAudioTranscriptionService.audioTranscription(url);
- }
-
- @Autowired
- @Qualifier("tongYiTextEmbeddingServiceImpl")
- private TongYiService tongYiTextEmbeddingService;
-
- @GetMapping("/textEmbedding")
- public List textEmbedding(@RequestParam(value = "text",
- defaultValue = "Spring Cloud Alibaba AI 框架!") String text) {
-
- return tongYiTextEmbeddingService.textEmbedding(text);
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/models/ActorsFilms.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/models/ActorsFilms.java
deleted file mode 100644
index 15ac124ed..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/models/ActorsFilms.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.models;
-
-import java.util.List;
-
-/**
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-public class ActorsFilms {
-
- private String actor;
-
- private List movies;
-
- public ActorsFilms() {
- }
-
- public String getActor() {
- return actor;
- }
-
- public void setActor(String actor) {
- this.actor = actor;
- }
-
- public List getMovies() {
- return movies;
- }
-
- public void setMovies(List movies) {
- this.movies = movies;
- }
-
- @Override
- public String toString() {
- return "ActorsFilms{" + "actor='" + actor + '\'' + ", movies=" + movies + '}';
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/models/Completion.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/models/Completion.java
deleted file mode 100644
index 43eedd419..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/models/Completion.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.models;
-
-/**
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-public class Completion {
-
- private final String completion;
-
- public Completion(String completion) {
- this.completion = completion;
- }
-
- public String getCompletion() {
- return completion;
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/AbstractTongYiServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/AbstractTongYiServiceImpl.java
deleted file mode 100644
index 1a685d7e5..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/AbstractTongYiServiceImpl.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service;
-
-import java.util.List;
-import java.util.Map;
-
-import com.alibaba.cloud.ai.example.tongyi.models.ActorsFilms;
-import com.alibaba.cloud.ai.example.tongyi.models.Completion;
-
-import org.springframework.ai.chat.messages.AssistantMessage;
-import org.springframework.ai.image.ImageResponse;
-
-/**
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-public abstract class AbstractTongYiServiceImpl implements TongYiService {
-
- private static final String INFO_PREFIX = "please implement ";
- private static final String INFO_SUFFIX = "() method.";
-
- @Override
- public String completion(String message) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread().getStackTrace()[2].getMethodName());
- }
-
- @Override
- public Map streamCompletion(String message) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
- @Override
- public ActorsFilms genOutputParse(String actor) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
- @Override
- public AssistantMessage genPromptTemplates(String adjective, String topic) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
- @Override
- public AssistantMessage genRole(String message, String name, String voice) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
- @Override
- public Completion stuffCompletion(String message, boolean stuffit) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
- @Override
- public ImageResponse genImg(String imgPrompt) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
- @Override
- public String genAudio(String text) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
- @Override
- public List textEmbedding(String text) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
- @Override
- public String audioTranscription(String url) {
-
- throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
- .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/TongYiService.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/TongYiService.java
deleted file mode 100644
index 3f570f5cf..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/TongYiService.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service;
-
-import java.util.List;
-import java.util.Map;
-
-import com.alibaba.cloud.ai.example.tongyi.models.ActorsFilms;
-import com.alibaba.cloud.ai.example.tongyi.models.Completion;
-
-import org.springframework.ai.chat.messages.AssistantMessage;
-import org.springframework.ai.embedding.EmbeddingResponse;
-import org.springframework.ai.image.ImageResponse;
-
-/**
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-public interface TongYiService {
-
- /**
- * Hello World example.
- *
- * @param message conversation content question.
- * @return AI answer.
- */
- String completion(String message);
-
- /**
- * Stream call.
- *
- * @param message conversation content question.
- * @return AI answer.
- */
- Map streamCompletion(String message);
-
- /**
- * Output parse object.
- *
- * @param actor actor name.
- * @return Object.
- */
- ActorsFilms genOutputParse(String actor);
-
- /**
- * Prompt template.
- *
- * @param adjective params1.
- * @param topic params2.
- * @return AI answer.
- */
- AssistantMessage genPromptTemplates(String adjective, String topic);
-
- /**
- * AI role example.
- *
- * @param message question content,
- * @param name params1.
- * @param voice params2.
- * @return AI answer.
- */
- AssistantMessage genRole(String message, String name, String voice);
-
- /**
- * Stuff and answer.
- *
- * @param message question.
- * @param stuffit is stuff.
- * @return Completion object.
- */
- Completion stuffCompletion(String message, boolean stuffit);
-
- /**
- * Gen images.
- * @param imgPrompt prompt info.
- * @return {@link ImageResponse}
- */
- ImageResponse genImg(String imgPrompt);
-
- /**
- * Gen audio.
- * @param text prompt info.
- * @return ByteBuffer object.
- */
- String genAudio(String text);
-
- /**
- * Audio Transcription.
- * @param audioUrls url of the audio file to be transcribed.
- * @return the result file Path.
- */
- String audioTranscription(String audioUrls);
-
- /**
- * TongYI LLM Text embedding.
- * @param text input text.
- * @return {@link EmbeddingResponse}
- */
- List textEmbedding(String text);
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/speech/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/speech/README.md
deleted file mode 100644
index 3adb041f5..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/speech/README.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Spring Cloud Alibaba AI Audio
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/audio`。
-`controller` 将会调用 `TongYiService` 中的 `genAudio` 方法,完成服务请求得到响应。
-
-有一个可选的 `ptompt` 参数,其默认值为“你好,Spring Cloud Alibaba AI 框架!”。 请求响应来自 Alibaba TongYi 语音合成服务。
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具对接口发起请求:
-
-```shell
-$ curl http://localhost:8080/ai/audio
-
-# Response:
-D:\open_sources\sca-ai\spring-ai\04-11-18-21-59.wav
-```
-
-返回参数为保存到当前根路径下的音频文明路径。
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/speech/TongYiAudioSimpleServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/speech/TongYiAudioSimpleServiceImpl.java
deleted file mode 100644
index cdde2cc20..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/speech/TongYiAudioSimpleServiceImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.audio.speech;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.nio.ByteBuffer;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-import com.alibaba.cloud.ai.example.tongyi.service.TongYiService;
-import com.alibaba.cloud.ai.tongyi.audio.speech.api.SpeechModel;
-import com.alibaba.dashscope.audio.tts.SpeechSynthesisAudioFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * @author yuluo
- * @author yuluo
- * @since 2023.0.1.0
- */
-
-@Service
-public class TongYiAudioSimpleServiceImpl extends AbstractTongYiServiceImpl {
-
- private static final Logger logger = LoggerFactory.getLogger(TongYiService.class);
-
- private final SpeechModel speechClient;
-
- @Autowired
- public TongYiAudioSimpleServiceImpl(SpeechModel client) {
-
- this.speechClient = client;
- }
-
- @Override
- public String genAudio(String text) {
-
- logger.info("gen audio prompt is: {}", text);
-
- var resWAV = speechClient.call(text);
-
- return save(resWAV, SpeechSynthesisAudioFormat.WAV.getValue());
- }
-
- private String save(ByteBuffer audio, String type) {
-
- String currentPath = System.getProperty("user.dir");
- LocalDateTime now = LocalDateTime.now();
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd-HH-mm-ss");
- String fileName = currentPath + File.separator + now.format(formatter) + "." + type;
- File file = new File(fileName);
-
- try (FileOutputStream fos = new FileOutputStream(file)) {
- fos.write(audio.array());
- }
- catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- return fileName;
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/transcription/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/transcription/README.md
deleted file mode 100644
index 6437811d5..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/transcription/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# Spring Cloud Alibaba AI Audio Transcription
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/audio/transcription`
-`controller` 将会调用 `TongYiService` 中的 `audioTranscription` 方法,完成服务请求得到响应。
-
-可设置`file_urls`参数,提供一个或多个需要进行语音识别的音视频文件。
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具对接口发起请求:
-
-```shell
-$ curl -X GET "http://localhost:8080/ai/audio/transcription?audioUrls=url1&audioUrls=url2"
-
-# Response:
-D:\Code\spring-cloud-alibaba\05-13-20-47-08.txt
-D:\Code\spring-cloud-alibaba\05-13-20-47-09.txt
-```
-
-返回参数为保存到当前根路径下的音频转录文本文件的路径。
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/transcription/TongYiAudioTranscriptionServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/transcription/TongYiAudioTranscriptionServiceImpl.java
deleted file mode 100644
index d2275e927..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/audio/transcription/TongYiAudioTranscriptionServiceImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.audio.transcription;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.List;
-
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-import com.alibaba.cloud.ai.example.tongyi.service.TongYiService;
-import com.alibaba.cloud.ai.tongyi.audio.transcription.TongYiAudioTranscriptionModel;
-import com.alibaba.cloud.ai.tongyi.audio.transcription.api.AudioTranscriptionPrompt;
-import com.alibaba.cloud.ai.tongyi.audio.transcription.api.AudioTranscriptionResult;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.UrlResource;
-import org.springframework.stereotype.Service;
-
-/**
- * @author xYLiu
- * @author yuluo
- * @since 2023.0.1.0
- */
-
-@Service
-public class TongYiAudioTranscriptionServiceImpl extends AbstractTongYiServiceImpl {
-
- private static final Logger logger = LoggerFactory.getLogger(TongYiService.class);
-
- private final TongYiAudioTranscriptionModel audioTranscriptionModel;
-
- @Autowired
- public TongYiAudioTranscriptionServiceImpl(final TongYiAudioTranscriptionModel transcriptionModel) {
-
- this.audioTranscriptionModel = transcriptionModel;
- }
-
- @Override
- public String audioTranscription(String audioUrls) {
-
- Resource resource;
-
- try {
- resource = new UrlResource(audioUrls);
- }
- catch (IOException e) {
- logger.error("Failed to create resource.");
- throw new RuntimeException(e);
- }
- AudioTranscriptionPrompt audioTranscriptionPrompt = new AudioTranscriptionPrompt(resource);
-
- return save(audioTranscriptionModel.call(audioTranscriptionPrompt).getResults());
- }
-
- private String save(List resultList) {
- String currentPath = System.getProperty("user.dir");
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd-HH-mm-ss");
- StringBuilder retPaths = new StringBuilder();
- for (AudioTranscriptionResult audioTranscriptionResult : resultList) {
- String tUrl = audioTranscriptionResult.getOutput();
- LocalDateTime now = LocalDateTime.now();
- String fileName = currentPath + File.separator + now.format(formatter) + ".txt";
- retPaths.append(fileName).append("\n");
- try {
- URL url = new URL(tUrl);
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setRequestMethod("GET");
- StringBuilder sb = new StringBuilder();
- int responseCode = connection.getResponseCode();
- if (responseCode == HttpURLConnection.HTTP_OK) {
- try (BufferedInputStream in = new BufferedInputStream(connection.getInputStream()); FileOutputStream fileOutputStream = new FileOutputStream(fileName)) {
- byte[] dataBuffer = new byte[1024];
- int bytesRead;
- while ((bytesRead = in.read(dataBuffer, 0, 1024)) != -1) {
- sb.append(new String(dataBuffer, 0, bytesRead));
- }
- JsonObject rootObj = JsonParser.parseString(sb.toString()).getAsJsonObject();
- JsonArray transcriptsArray = rootObj.getAsJsonArray("transcripts");
-
- for (var transcriptElement : transcriptsArray) {
- JsonObject transcriptObj = transcriptElement.getAsJsonObject();
- String text = transcriptObj.get("text").getAsString();
- fileOutputStream.write(text.getBytes());
- }
- logger.info("File downloaded successfully:{}\n", fileName);
- }
- }
- else {
- logger.error("The download failed, and the response code:{}",
- responseCode);
- }
- connection.disconnect();
- }
- catch (IOException e) {
- logger.error("An error occurred during the file download process.");
- }
- }
- return retPaths.toString();
- }
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/helloworld/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/helloworld/README.md
deleted file mode 100644
index 956421a0e..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/helloworld/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-# Spring Cloud Alibaba AI Hello World
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/example`。
-`controller` 将会调用 `TongYiService` 中的 `completion` 方法,完成服务请求得到响应。
-
-有一个可选的 `message` 参数,其默认值为“告诉我一个笑话”。 请求响应来自 Alibaba TongYi models 服务。
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具对接口发起请求:
-
-```shell
-$ curl http://localhost:8080/ai/example
-
-# Response:
-Sure, here's one for you:
-
-Why don't scientists trust atoms?
-
-Because they make up everything!
-```
-
-现在使用 message 参数:
-
-```shell
-$ curl --get --data-urlencode 'message=Tell me a joke about a cow.' http://localhost:8080/ai/example
-
-# Response:
-Here's a classic cow joke for you:
-
-Why did the farmer separate the chicken and the sheep from the cows?
-
-Because he wanted to have eggs-clusive relationships with his hens!
-```
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/helloworld/TongYiSimpleServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/helloworld/TongYiSimpleServiceImpl.java
deleted file mode 100644
index 214281b05..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/helloworld/TongYiSimpleServiceImpl.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.helloworld;
-
-import java.util.Map;
-
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import reactor.core.publisher.Flux;
-
-import org.springframework.ai.chat.messages.UserMessage;
-import org.springframework.ai.chat.model.ChatModel;
-import org.springframework.ai.chat.model.StreamingChatModel;
-import org.springframework.ai.chat.prompt.Prompt;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * The Chat simple example service implementation.
- * There is optional message parameter whose default value is "Tell me a joke".
- * pl The response to the request is from the TongYi models Service.
- *
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-@Service
-public class TongYiSimpleServiceImpl extends AbstractTongYiServiceImpl {
-
- private static final Logger logger = LoggerFactory.getLogger(TongYiSimpleServiceImpl.class);
-
- private final ChatModel chatModel;
-
- private final StreamingChatModel streamingChatModel;
-
- @Autowired
- public TongYiSimpleServiceImpl(ChatModel chatModel, StreamingChatModel streamingChatModel) {
-
- this.chatModel = chatModel;
- this.streamingChatModel = streamingChatModel;
- }
-
- @Override
- public String completion(String message) {
-
- Prompt prompt = new Prompt(new UserMessage(message));
-
- return chatModel.call(prompt).getResult().getOutput().getContent();
- }
-
- @Override
- public Map streamCompletion(String message) {
-
- StringBuilder fullContent = new StringBuilder();
-
- streamingChatModel.stream(new Prompt(message))
- .flatMap(chatResponse -> Flux.fromIterable(chatResponse.getResults()))
- .map(content -> content.getOutput().getContent())
- .doOnNext(fullContent::append)
- .last()
- .map(lastContent -> Map.of(message, fullContent.toString()))
- .block();
-
- logger.info(fullContent.toString());
-
- return Map.of(message, fullContent.toString());
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/images/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/images/README.md
deleted file mode 100644
index 5a8a07c2d..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/images/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# Spring Cloud Alibaba AI Image
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/img`。
-`controller` 将会调用 `TongYiService` 中的 `genImg` 方法,完成服务请求得到响应。
-
-有一个可选的 `prompt` 参数为生成图片的提示信息,其默认值为“Painting a picture of blue water and blue sky.”。
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具对接口发起请求:
-
-```shell
-$ curl http://localhost:8080/ai/img
-```
-
-响应结果为:(base64 数据太多,使用 `xxx` 代替)
-
-```json
-{
- "result": {
- "output": {
- "url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/42/20240408/8d820c8d/e9913e23-24e9-4de7-8977-e4ccab33a231-1.png?Expires=1712670359&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=bMEaNS0RGTpD2yXO0lTMMY5AWxM%3D",
- "b64Json": "xxxx"
- },
- "metadata": null
- },
- "metadata": {
- "created": 1712583967354,
- "taskId": "43d7e458-9f3e-4a51-9a39-17559d8f135d",
- "metrics": {
- "total": 4,
- "succeeded": 4,
- "failed": 0
- },
- "usage": {
- "imageCount": 4
- }
- },
- "results": [
- {
- "output": {
- "url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/42/20240408/8d820c8d/e9913e23-24e9-4de7-8977-e4ccab33a231-1.png?Expires=1712670359&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=bMEaNS0RGTpD2yXO0lTMMY5AWxM%3D",
- "b64Json": "xxxx"
- },
- "metadata": null
- },
- {
- "output": {
- "url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/2b/20240408/8d820c8d/0bd0b40f-4e34-46da-8706-8f2ec86274d7-1.png?Expires=1712670359&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=dl3sMGQn8p7y%2FzKOmPR%2B64prQV4%3D",
- "b64Json": "xxxx"
- },
- "metadata": null
- },
- {
- "output": {
- "url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/62/20240408/c34adf05/ffb89a14-14c5-4740-ab55-37b59a69aaef-1.png?Expires=1712670359&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=vYd667hVPQUTt8aiJDBFxN%2B08jI%3D",
- "b64Json": "xxxx"
- },
- "metadata": null
- },
- {
- "output": {
- "url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/b5/20240408/8d820c8d/594b8672-c1ce-49b6-bab0-06e3616b4e0e-1.png?Expires=1712670359&OSSAccessKeyId=LTAI5tQZd8AEcZX6KZV4G8qL&Signature=ERyoV7pmmI8sZJwSFLpzknhfFEk%3D",
- "b64Json": "xxxx"
- },
- "metadata": null
- }
- ]
-}
-```
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/images/TongYiImagesServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/images/TongYiImagesServiceImpl.java
deleted file mode 100644
index 56475ac99..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/images/TongYiImagesServiceImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.images;
-
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-
-import org.springframework.ai.image.ImageModel;
-import org.springframework.ai.image.ImagePrompt;
-import org.springframework.ai.image.ImageResponse;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * gen images example.
- *
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-@Service
-public class TongYiImagesServiceImpl extends AbstractTongYiServiceImpl {
-
- private final ImageModel imageModel;
-
- @Autowired
- public TongYiImagesServiceImpl(ImageModel imageModel) {
-
- this.imageModel = imageModel;
- }
-
- @Override
- public ImageResponse genImg(String imgPrompt) {
-
- var prompt = new ImagePrompt(imgPrompt);
- return imageModel.call(prompt);
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/output/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/output/README.md
deleted file mode 100644
index 9af498f96..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/output/README.md
+++ /dev/null
@@ -1,137 +0,0 @@
-# Spring Cloud Alibaba AI Output
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/output`。
-`controller` 将会调用 `TongYiService` 中的 `genOutputParse` 方法,完成服务请求得到响应。
-
-有一个可选的 `actor` 参数为演员的名字,其默认值为“Jeff Bridges”。
-演员姓名位于硬编码的文本中:
-
-```java
-String userMessage = """
- Generate the filmography for the actor {actor}.
- {format}
- """;
-```
-
-`format` 变量来自 `OutputParser` 中。
-
-## BeanOutputParser
-
-`BeanOutputParser` 当请求获得响应时,会将响应内容解析为一个 JavaBean 并返回给用户:
-
-```java
-var outputParser = new BeanOutputParser<>(ActorsFilms.class);
-String format = outputParser.getFormat();
-```
-
-模型响应内容会被解析为类 `ActorsFils` 的类属性:
-
-```java
-ActorsFilms actorsFilms = outputParser.parse(content);
-```
-
-> 返回的数据结构必须符合 `https://json-schema.org/draft/2020-12/schema` 规范,不然会解析失败,这里采用替换的方式先行处理:
-> ```java
-> // {@link BeanOutputParser#getFormat}
-> // simple solve.
-> String content = generation.getOutput().getContent()
-> .replace("```json", "")
-> .replace("```", "");
-> ```
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具对接口发起请求:
-
-```shell
-$ curl http://localhost:8080/ai/output
-```
-
-响应结果为:
-
-```json
-{
- "actor": "Jeff Bridges",
- "movies": [
- "Starman (1984)",
- "The Natural (1984)",
- "The Longest Week (1979)",
- "Against the Wind (1977)",
- "Fat City (1978)",
- "American Heart (1981)",
- "Iron Eagle (1986)",
- "The China Syndrome (1979)",
- "Blazing Saddles (1974)",
- "Winter Kills (1979)",
- "Theetreowners of Broadway (1973)",
- "Trinity (1990)",
- "Tokyo Story (1953) [English dub voice]",
- "The Longest Ride (2015)",
- "Another Day in the Valley (1991)",
- "Stardust Memories (1976)",
- "Jagged Edge (1985)",
- "The Adventures of Ford Fairlane (1996)",
- "The Vanishing (1988)",
- "Dances with Wolves (1990)",
- "The Mirror Has Two Faces (1996)",
- "The Door in the Floor (2004)",
- "The Way Back (2010)",
- "The Secret Life of Walter Mitty (2013)",
- "The Big Lebowski (1998)",
- "The Iron Giant (1999) [voice]",
- "The Man Who Wasn't There (2001)",
- "True Grit (2010)",
- "Crazy Heart (2009)",
- "Iron Man 2 (2010) [voice]",
- "TRON: Legacy (2010)",
- "The Giver (2014)",
- "Hell or High Water (2016)"
- ]
-}
-```
-
-现在使用 actor 参数:
-
-```shell
-$ curl --get --data-urlencode 'actor=Bill Murray' http://localhost:8080/ai/output
-
-```
-
-Response:
-
-```json
-{
- "actor": "Bill Murray",
- "movies": [
- "The<[email protected]>",
- "Caddyshack",
- "Ghostbusters",
- "Stripes",
- "Scrooged",
- "Groundhog Day",
- "What About Bob?",
- " Coneheads ",
- "Stuart Saves His Family",
- " Rushmore",
- "The Royal Tenenbaums",
- "Lost in Translation",
- "Garfield: The Movie",
- "Osmosis Jones",
- "The Life Aquatic with Steve Zissou",
- "Hot Fuzz",
- "Get Smart",
- "The Grand Budapest Hotel",
- "Trainwreck",
- "Chef",
- "Inside Out",
- "Zootopia",
- "On the Rocks",
- "Spies in Disguise"
- ]
-}
-```
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/output/TongYiOutputParseServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/output/TongYiOutputParseServiceImpl.java
deleted file mode 100644
index 230ea0feb..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/output/TongYiOutputParseServiceImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.output;
-
-import java.util.Map;
-
-import com.alibaba.cloud.ai.example.tongyi.models.ActorsFilms;
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.ai.chat.model.ChatModel;
-import org.springframework.ai.chat.model.Generation;
-import org.springframework.ai.chat.prompt.Prompt;
-import org.springframework.ai.chat.prompt.PromptTemplate;
-import org.springframework.ai.converter.BeanOutputConverter;
-import org.springframework.stereotype.Service;
-
-/**
- * The BeanOutputParser generates an TongYI JSON compliant schema for a
- * JavaBean and provides instructions to use that schema when replying to a request.
- *
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-@Service
-public class TongYiOutputParseServiceImpl extends AbstractTongYiServiceImpl {
-
- private static final Logger logger = LoggerFactory.getLogger(TongYiOutputParseServiceImpl.class);
-
- private final ChatModel chatModel;
-
- public TongYiOutputParseServiceImpl(ChatModel chatModel) {
- this.chatModel = chatModel;
- }
-
- @Override
- public ActorsFilms genOutputParse(String actor) {
-
- var outputParser = new BeanOutputConverter<>(ActorsFilms.class);
-
- String format = outputParser.getFormat();
- logger.info("format: " + format);
- String userMessage = """
- Generate the filmography for the actor {actor}.
- {format}
- """;
- PromptTemplate promptTemplate = new PromptTemplate(userMessage, Map.of("actor", actor, "format", format));
- Prompt prompt = promptTemplate.create();
- Generation generation = chatModel.call(prompt).getResult();
-
- // {@link BeanOutputParser#getFormat}
- // simple solve.
- String content = generation.getOutput().getContent()
- .replace("```json", "")
- .replace("```", "");
-
- return outputParser.parse(content);
- }
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/prompttemplate/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/prompttemplate/README.md
deleted file mode 100644
index f3e7641e6..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/prompttemplate/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# Spring Cloud Alibaba AI Prompt Template
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/prompt-tmpl`。
-`controller` 将会调用 `TongYiService` 中的 `genPromptTemplates` 方法,完成服务请求得到响应。
-
-本示例代码展示如何使用 `StringTemplate` 引擎和 `Spring AI PromptTemplate` 类。目录中 `resources\prompts` 文件为 `joke-prompt`。此文件由 Spring 加载:
-
-```java
-@Value("classpath:/prompts/joke-prompt.st")
-private Resource jokeResource;
-```
-
-文件内容为:
-
-```json
-Tell me a {adjective} joke about {topic}.
-```
-
-接受两个可选参数:
-
-1. `adjective`,其默认值为 `funny`
-2. `topic`,其默认值为 `cows`
-
-请求响应来自 Alibaba TongYi models.
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具对接口发起请求:
-
-```shell
-$ curl http://localhost:8080/ai/prompt-tmpl
-```
-
-响应结果为:
-
-```json
-{
- "messageType": "ASSISTANT",
- "properties": {},
- "content": "Why did the cow go to art school? Because she wanted to learn how to draw moo-vements!",
- "media": []
-}
-```
-
-现在使用 adjective 和 topic 参数:
-
-```shell
-$ curl --get --data-urlencode message='Tell me about 3 famous physicists' --data-urlencode name='yuluo' --data-urlencode voice='Rick Sanchez' http://localhost:8080/ai/roles
-```
-
-Response:
-
-```json
-{
- "messageType": "ASSISTANT",
- "properties": {},
- "content": "Sure, here's another one:\n\nWhy did the farmer separate the chicken and the cow?\n\nBecause he wanted to have eggs-clusive relationships with his hens!",
- "media": []
-}
-```
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/prompttemplate/TongYiPromptTemplateServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/prompttemplate/TongYiPromptTemplateServiceImpl.java
deleted file mode 100644
index 8623e2118..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/prompttemplate/TongYiPromptTemplateServiceImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.prompttemplate;
-
-import java.util.Map;
-
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-
-import org.springframework.ai.chat.messages.AssistantMessage;
-import org.springframework.ai.chat.model.ChatModel;
-import org.springframework.ai.chat.prompt.Prompt;
-import org.springframework.ai.chat.prompt.PromptTemplate;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
-import org.springframework.stereotype.Service;
-
-/**
- * The TongYiPromptTemplateServiceImpl shows how to use the StringTemplate Engine and the Spring AI PromptTemplate class.
- * In the resources\prompts directory is the file joke-prompt.
- *
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-@Service
-public class TongYiPromptTemplateServiceImpl extends AbstractTongYiServiceImpl {
-
- private final ChatModel chatModel;
-
- @Value("classpath:/prompts/joke-prompt.st")
- private Resource jokeResource;
-
- public TongYiPromptTemplateServiceImpl(ChatModel chatModel) {
- this.chatModel = chatModel;
- }
-
- @Override
- public AssistantMessage genPromptTemplates(String adjective, String topic) {
-
- PromptTemplate promptTemplate = new PromptTemplate(jokeResource);
-
- Prompt prompt = promptTemplate.create(Map.of("adjective", adjective, "topic", topic));
- return chatModel.call(prompt).getResult().getOutput();
- }
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/roles/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/roles/README.md
deleted file mode 100644
index 2778d480d..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/roles/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-# Spring Cloud Alibaba AI Roles
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/roles`。
-`controller` 将会调用 `TongYiService` 中的 `genRole` 方法,完成服务请求得到响应。
-
-接受带有三个可选参数的PromptTemplateControllerHTTP GET 请求http://localhost:8080/ai/roles
-
-`message` 用户请求消息,默认值为 `Tell me about three famous pirates from the Golden Age of Piracy and why they did. Write at least a sentence for each pirate.`;
-`name` AI助手的名字,默认值为 `Bob`;
-`voice` AI 助手回复的语音风格。默认值为 `pirate`。
-
-请求响应来自 Alibaba TongYi models 服务。
-
-## Roles
-
-对于每个角色,都会创建一条消息,该消息将作为提示的一部分发送到 AI 模型。
-
-> 用户消息是“消息”的内容。
->
-> 系统消息为 AI 模型设置响应的上下文。
-
-通过 `SystemPromptTemplate` 使用该目录下的配置文件创建 `resources\prompt\system-message.st`。
-
-该文件内容为:
-
-```json
-You are a helpful AI assistant.
-You are an AI assistant that helps people find information.
-Your name is {name}
-You should reply to the user's request with your name and also in the style of a {voice}.
-```
-
-用户消息和系统消息组合在一起创建 `Prompt`。
-
-```java
-Prompt prompt = new Prompt(List.of(userMessage, systemMessage));
-```
-
-> 注意:在 TongYi models 中 system 只出现一次且必须位于消息顶部,否则出现以下错误:
-> Role must be user or assistant and Content length must be greater than 0.
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具对接口发起请求:
-
-```shell
-$ curl http://localhost:8080/ai/roles
-```
-
-Response:
-
-```json
-{
- "messageType": "ASSISTANT",
- "properties": {},
- "content": "Ahoy matey! I be Bot, the swashbucklin' AI at yer service! Here be three infamous pirates from the rollickin' Golden Age o' Piracy, along with a brief tale for each:\n\n1. Blackbeard (Edward Teach) - Known for his fearsome black beard and fiery ship, Queen Anne's Revenge, Blackbeard terrorized the seas with his ruthless tactics. He sought treasure and power, often leaving a trail of dread behind.\n\n2. Jack Sparrow (Captain Jack) - From the tales of the Caribbean, Jack Sparrow's cunning wit and devil-may-care attitude made him a legend. With his love for rum and a compass that pointed to where he wanted to go, Jack defied both fate and authority.\n\n3. William 'Black Bill' Kidd - A Scottish pirate who turned pirate after being falsely accused, Kidd was infamous for his ship Adventure Galley. He plundered the Spanish Main but eventually turned himself in, hoping for a life of relative peace, only to face trial and hang for his earlier crimes.\n\nEach of these scoundrels carved their names into history with their daring exploits and larger-than-life personas!",
- "media": []
-}
-```
-
-现在使用 message, name, voice 参数:
-
-```shell
-$ curl --get --data-urlencode message=="Tell me about 3 famous physicists" name=="yuluo" voice=="Rick Sanchez" http://localhost:8080/ai/roles
-```
-
-Response:
-
-```json
-{
- "messageType":"ASSISTANT",
- "properties":{},
- "content":"Yo dawg, I'm Yuluo, the quantum physicist's best friend! Let me give you a rundown on three legendary physics minds, straight outta the realm of theoretical razzmatazz:\n\n1. Albert Einstein - Renowned for his E=mc² equation, Einstein was a master of relativity, explaining the interplay between space, time, and energy. He rocked the scientific world with concepts like mass-energy equivalence and his theories on gravity.\n\n2. Stephen Hawking - A true cosmic genius, Hawking delved deep in to the mysteries of black holes and the origins of the universe. Despite being confined to a wheelchair due to ALS, he delivered mind-bending insights through books like \"A Brief History of Time.\"\n\n3. Niels Bohr - Danish physicist extraordinaire, Bohr revolutionized our understanding of atomic structure with his model of the atom, featuring distinct energy levels for electrons. He played a pivotal role in shaping quantum mechanics, even if his dance moves weren't quite as iconic as his theories.\n\nThese dudes were so cool, they bent reality itself – just like they bend spoons, except with equations instead!",
- "media":[]}
-```
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/roles/TongYiRolesServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/roles/TongYiRolesServiceImpl.java
deleted file mode 100644
index a83217f2d..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/roles/TongYiRolesServiceImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.roles;
-
-import java.util.List;
-import java.util.Map;
-
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-
-import org.springframework.ai.chat.messages.AssistantMessage;
-import org.springframework.ai.chat.messages.UserMessage;
-import org.springframework.ai.chat.model.ChatModel;
-import org.springframework.ai.chat.prompt.Prompt;
-import org.springframework.ai.chat.prompt.SystemPromptTemplate;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
-import org.springframework.stereotype.Service;
-
-/**
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-@Service
-public class TongYiRolesServiceImpl extends AbstractTongYiServiceImpl {
-
- private final ChatModel chatModel;
-
- public TongYiRolesServiceImpl(ChatModel chatModel) {
- this.chatModel = chatModel;
- }
-
- @Value("classpath:/prompts/assistant-message.st")
- private Resource systemResource;
-
- @Override
- public AssistantMessage genRole(String message, String name, String voice) {
-
- /**
- TongYi model rules: Role must be user or assistant and Content length must be greater than 0.
- SystemPromptTemplate systemPromptTemplate = new SystemPromptTemplate(systemResource);
- org.springframework.ai.chat.messages.Message systemMessage = systemPromptTemplate.createMessage(Map.of("name", name, "voice", voice));
-
- In TongYi models, System role must appear at the top of the message and can only appear once.
- https://help.aliyun.com/zh/dashscope/developer-reference/api-details?spm=a2c4g.11186623.0.0.4dbcc11akAaRbs#b9ad0a10cfhpe
- */
-
- SystemPromptTemplate systemPromptTemplate = new SystemPromptTemplate(systemResource);
- org.springframework.ai.chat.messages.Message systemPromptTemplateMessage = systemPromptTemplate.createMessage(Map.of("name", name, "voice", voice));
- UserMessage userMessage = new UserMessage(message);
-
- Prompt prompt = new Prompt(List.of(systemPromptTemplateMessage, userMessage));
-
- return chatModel.call(prompt).getResult().getOutput();
- }
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/stuff/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/stuff/README.md
deleted file mode 100644
index 76227da55..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/stuff/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# Spring Cloud Alibaba AI Stuff models
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/stuff`。
-`controller` 将会调用 `TongYiService` 中的 `stuffCompletion` 方法,完成服务请求得到响应。
-
-模型训练数据仅仅到 2021 年,对之后的问题无法回答。此示例将演示如何使用一些数据完成对模型上下文的填充,使得模型能够回答更多的问题。
-将以 2022 年的冰壶比赛冠军是谁为例进行演示。
-
-```shell
-$ curl http://localhost:8080/ai/stuff
-{"completion":"As previously mentioned, my knowledge is current until 2021 and I do not have information about the 2022 Winter Olympics results. Therefore, I can't provide the winner of the mixed doubles gold medal in curling from those games."}
-```
-
-## 预处理内容
-
-### qa-prompt.st
-
-```json
-Use the following pieces of context to answer the question at the end.
-If you don't know the answer, just say that you don't know, don't try to make up an answer.
-
-{context}
-
-Question: {question}
-Helpful Answer:
-```
-
-```md
-Jack and arokg, slim won the gold medal in mixed doubles curling at the 2022 Winter Olympics.
-```
-
-以上内容将由 Spring 加载到 Resource 对象中:
-
-```java
-@Value("classpath:/docs/wikipedia-curling.md")
-private Resource docsToStuffResource;
-
-@Value("classpath:/prompts/qa-prompt.st")
-private Resource qaPromptResource;
-```
-
-一并填充到 Prompt 中,由 Alibaba TongYi models 返回响应。
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具对接口发起请求:
-
-```shell
-$ curl http://localhost:8080/ai/stuff
-
-# Response:
-{"completion":"I'm sorry, but I don't have information on the specific winners of the 2022 Winter Olympics events. My knowledge is current until 2021, and I cannot provide real-time or future sports results."}
-```
-
-现在使用 stuffit 参数:
-
-```shell
-$ curl --get --data-urlencode 'stuffit=true' http://localhost:8080/ai/stuff
-
-# Response:
-{"completion":"The athletes who won the mixed doubles gold medal in curling at the 2022 Winter Olympics, according to the provided context, were Jack and Arokg Slim."}
-```
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/stuff/TongYiStuffServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/stuff/TongYiStuffServiceImpl.java
deleted file mode 100644
index f62d02cf7..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/stuff/TongYiStuffServiceImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.stuff;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.alibaba.cloud.ai.example.tongyi.models.Completion;
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-
-import org.springframework.ai.chat.model.ChatModel;
-import org.springframework.ai.chat.model.Generation;
-import org.springframework.ai.chat.prompt.Prompt;
-import org.springframework.ai.chat.prompt.PromptTemplate;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
-import org.springframework.stereotype.Service;
-
-/**
- * Train the model using pre-found data to enhance the AI model to achieve the desired results.
- *
- * @author yuluo
- * @author yuluo
- * @since 2023.0.0.0
- */
-
-@Service
-public class TongYiStuffServiceImpl extends AbstractTongYiServiceImpl {
-
- private final ChatModel chatModel;
-
- public TongYiStuffServiceImpl(ChatModel chatModel) {
- this.chatModel = chatModel;
- }
-
- @Value("classpath:/docs/wikipedia-curling.md")
- private Resource docsToStuffResource;
-
- @Value("classpath:/prompts/qa-prompt.st")
- private Resource qaPromptResource;
-
- // TongYi model: Range of input length should be [1, 6000]
- @Override
- public Completion stuffCompletion(String message, boolean stuffit) {
-
- PromptTemplate promptTemplate = new PromptTemplate(qaPromptResource);
- Map map = new HashMap<>();
- map.put("question", message);
-
- if (stuffit) {
- map.put("context", docsToStuffResource);
- }
- else {
- map.put("context", "");
- }
-
- Prompt prompt = promptTemplate.create(map);
- Generation generation = chatModel.call(prompt).getResult();
- return new Completion(generation.getOutput().getContent());
- }
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/textembedding/README.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/textembedding/README.md
deleted file mode 100644
index 8d5da8ee3..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/textembedding/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# Spring Cloud Alibaba AI Text Embedding
-
-`TongYiController` 接受一个 HTTP GET 请求 `http://localhost:8080/ai/textEmbedding`。
-`controller` 将会调用 `TongYiService` 中的 `genAudio` 方法,完成服务请求得到响应。
-
-有一个可选的 `text` 参数,其默认值为“Spring Cloud Alibaba AI 框架!”。 请求响应来自 Alibaba TongYi Text Embedding 服务。
-
-## 构建和运行
-
-1. 修改配置文件 `application.yml` 中的 apikey 为有效的 apikey;
-2. 通过 IDE 或者 `./mvnw spring-boot:run` 运行应用程序。
-
-## 访问接口
-
-使用 curl 工具或者使用浏览器对接口发起请求:
-
-```shell
-$ curl http://localhost:8080/ai/textEmbedding
-
-# Response:
-为一组向量集合
-```
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/textembedding/TongYiTextEmbeddingServiceImpl.java b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/textembedding/TongYiTextEmbeddingServiceImpl.java
deleted file mode 100644
index 50958bbfe..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/java/com/alibaba/cloud/ai/example/tongyi/service/impl/textembedding/TongYiTextEmbeddingServiceImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2023-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.ai.example.tongyi.service.impl.textembedding;
-
-import java.util.List;
-
-import com.alibaba.cloud.ai.example.tongyi.service.AbstractTongYiServiceImpl;
-
-import org.springframework.ai.embedding.EmbeddingModel;
-import org.springframework.stereotype.Service;
-
-/**
- * @author why_ohh
- * @author why_ohh
- */
-
-@Service
-public class TongYiTextEmbeddingServiceImpl extends AbstractTongYiServiceImpl {
-
- private final EmbeddingModel embeddingModel;
-
- public TongYiTextEmbeddingServiceImpl(EmbeddingModel embeddingModel) {
-
- this.embeddingModel = embeddingModel;
- }
-
- @Override
- public List textEmbedding(String text) {
-
- return embeddingModel.embed(text);
- }
-
-}
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/application.yml b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/application.yml
deleted file mode 100644
index de666d396..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/application.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright 2023-2024 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-server:
- port: 8080
-
-spring:
- application:
- name: tongyi-example
-
-# please setting api-key. suggestion by environment variable.
-# Note: api-key is invalid, please apply for a new one.
-# export SPRING_CLOUD_ALIBABA_TONGYI_API_KEY=sk-a3d73b1709bf4a178c28ed7c8b3b5a345
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/docs/wikipedia-curling.md b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/docs/wikipedia-curling.md
deleted file mode 100644
index 619327080..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/docs/wikipedia-curling.md
+++ /dev/null
@@ -1 +0,0 @@
-Jack and arokg, slim won the gold medal in mixed doubles curling at the 2022 Winter Olympics.
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/assistant-message.st b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/assistant-message.st
deleted file mode 100644
index 31a52e86a..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/assistant-message.st
+++ /dev/null
@@ -1,4 +0,0 @@
-You are a helpful AI assistant.
-You are an AI assistant that helps people find information.
-Your name is {name}
-You should reply to the user's request with your name and also in the style of a {voice}.
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/joke-prompt.st b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/joke-prompt.st
deleted file mode 100644
index 4e6aa0898..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/joke-prompt.st
+++ /dev/null
@@ -1 +0,0 @@
-Tell me a {adjective} joke about {topic}.
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/qa-prompt.st b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/qa-prompt.st
deleted file mode 100644
index af5df383b..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/prompts/qa-prompt.st
+++ /dev/null
@@ -1,7 +0,0 @@
-Use the following pieces of context to answer the question at the end.
-If you don't know the answer, just say that you don't know, don't try to make up an answer.
-
-{context}
-
-Question: {question}
-Helpful Answer:
diff --git a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/static/index.html b/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/static/index.html
deleted file mode 100644
index 409de69c7..000000000
--- a/spring-cloud-alibaba-examples/ai-example/spring-cloud-ai-example/src/main/resources/static/index.html
+++ /dev/null
@@ -1,199 +0,0 @@
-
-
-
-
-
-
-
- SCA AI Example Front
-
-
-
-