master
lige2333 10 hours ago
parent 3c85f51768
commit 5701fb6c43

@ -1,113 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.5</version> <version>3.3.5</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>cn.lige2333</groupId> <groupId>cn.lige2333</groupId>
<artifactId>ligeai</artifactId> <artifactId>ligeai</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>ligeai</name> <name>ligeai</name>
<description>ligeai</description> <description>ligeai</description>
<url/> <url/>
<licenses> <licenses>
<license/> <license/>
</licenses> </licenses>
<developers> <developers>
<developer/> <developer/>
</developers> </developers>
<scm> <scm>
<connection/> <connection/>
<developerConnection/> <developerConnection/>
<tag/> <tag/>
<url/> <url/>
</scm> </scm>
<properties> <properties>
<java.version>17</java.version> <java.version>17</java.version>
<spring-ai.version>1.0.0-M3</spring-ai.version> <spring-ai.version>1.0.0-M3</spring-ai.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId> <artifactId>spring-boot-starter-webflux</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mybatis.spring.boot</groupId> <groupId>com.alibaba</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>fastjson</artifactId>
<version>3.0.3</version> <version>1.2.58</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.ai</groupId> <groupId>cn.hutool</groupId>
<artifactId>spring-ai-openai-spring-boot-starter</artifactId> <artifactId>hutool-all</artifactId>
</dependency> <version>5.8.21</version>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.projectreactor</groupId> <groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId> <artifactId>reactor-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> </dependencies>
<groupId>org.mybatis.spring.boot</groupId> <dependencyManagement>
<artifactId>mybatis-spring-boot-starter-test</artifactId> <dependencies>
<version>3.0.3</version> <dependency>
<scope>test</scope> <groupId>org.springframework.ai</groupId>
</dependency> <artifactId>spring-ai-bom</artifactId>
</dependencies> <version>${spring-ai.version}</version>
<dependencyManagement> <type>pom</type>
<dependencies> <scope>import</scope>
<dependency> </dependency>
<groupId>org.springframework.ai</groupId> </dependencies>
<artifactId>spring-ai-bom</artifactId> </dependencyManagement>
<version>${spring-ai.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration> <configuration>
<excludes> <excludes>
<exclude> <exclude>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
</exclude> </exclude>
</excludes> </excludes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>
<repository> <repository>
<id>spring-milestones</id> <id>spring-milestones</id>
<name>Spring Milestones</name> <name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url> <url>https://repo.spring.io/milestone</url>
<snapshots> <snapshots>
<enabled>false</enabled> <enabled>false</enabled>
</snapshots> </snapshots>
</repository> </repository>
</repositories> </repositories>
</project> </project>

@ -6,8 +6,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication @SpringBootApplication
public class LigeaiApplication { public class LigeaiApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(LigeaiApplication.class, args); SpringApplication.run(LigeaiApplication.class, args);
} }
} }

@ -1,61 +1,18 @@
package cn.lige2333.qrdouble.common.config; package cn.lige2333.ligeai.base;
import com.unfbx.chatgpt.OpenAiClient;
import com.unfbx.chatgpt.OpenAiStreamClient;
import com.unfbx.chatgpt.interceptor.OpenAiResponseInterceptor;
import okhttp3.OkHttpClient;
import org.springframework.ai.chat.memory.ChatMemory; import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.memory.InMemoryChatMemory; import org.springframework.ai.chat.memory.InMemoryChatMemory;
import org.springframework.ai.embedding.EmbeddingModel; import org.springframework.ai.embedding.EmbeddingModel;
import org.springframework.ai.reader.TextReader;
import org.springframework.ai.transformer.splitter.TokenTextSplitter;
import org.springframework.ai.vectorstore.SimpleVectorStore; import org.springframework.ai.vectorstore.SimpleVectorStore;
import org.springframework.ai.vectorstore.VectorStore; import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
@Configuration @Configuration
public class GptConfig { public class GptConfig {
@Value("${chatgpt.token}")
private String token;
@Bean
public OkHttpClient okHttpClient() {
return new OkHttpClient
.Builder()
.connectTimeout(1000, TimeUnit.SECONDS)//自定义超时时间
.writeTimeout(3000, TimeUnit.SECONDS)//自定义超时时间
.readTimeout(3000, TimeUnit.SECONDS)//自定义超时时间
.build();
}
@Bean
public OpenAiClient openAiClient() {
return OpenAiClient.builder()
.apiKey(Arrays.asList(token))
.apiHost("http://gptapi.kurtwang.com/")
.okHttpClient(okHttpClient())
.build();
}
@Bean
public OpenAiStreamClient openAiStreamClient() {
return OpenAiStreamClient.builder()
.apiHost("http://gptapi.kurtwang.com/")
.apiKey(Arrays.asList(token))
.okHttpClient(okHttpClient())
.build();
}
@Bean @Bean
public ChatMemory chatMemory(){ public ChatMemory chatMemory(){
return new InMemoryChatMemory(); return new InMemoryChatMemory();

@ -1,2 +1,39 @@
package cn.lige2333.ligeai.chatgpt.controller;public class ChatGptController { package cn.lige2333.ligeai.chatgpt.controller;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
@RestController
@RequestMapping("/ajax")
@CrossOrigin
public class ChatGptController {
@Autowired
private OpenAiChatModel chatModel;
private final ChatClient chatClient;
public ChatGptController(ChatClient.Builder chatClientBuilder) {
this.chatClient = chatClientBuilder.build();
}
@GetMapping("/ai/generate")
public String generate(@RequestParam(value = "message", defaultValue = "Tell me a joke") String message) {
return this.chatClient.prompt()
.user(message)
.call()
.content();
}
@GetMapping(value = "/ai/generateStream",produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<String> generateStream(@RequestParam(value = "message", defaultValue = "Tell me a joke") String message) {
return this.chatClient.prompt()
.user(message)
.stream()
.content();
}
} }

@ -1,31 +1,11 @@
package cn.lige2333.qrdouble.chatgpt.service; package cn.lige2333.ligeai.chatgpt.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.lige2333.qrdouble.security.entity.SysUser;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.unfbx.chatgpt.OpenAiClient;
import com.unfbx.chatgpt.OpenAiStreamClient;
import com.unfbx.chatgpt.entity.chat.*;
import com.unfbx.chatgpt.entity.common.Choice;
import com.unfbx.chatgpt.entity.images.Image;
import com.unfbx.chatgpt.entity.images.ImageResponse;
import com.unfbx.chatgpt.entity.images.SizeEnum;
import com.unfbx.chatgpt.sse.ConsoleEventSourceListener;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
import org.jetbrains.annotations.NotNull;
import org.springframework.ai.chat.client.ChatClient; import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.AbstractChatMemoryAdvisor; import org.springframework.ai.chat.client.advisor.AbstractChatMemoryAdvisor;
import org.springframework.ai.chat.client.advisor.PromptChatMemoryAdvisor; import org.springframework.ai.chat.client.advisor.PromptChatMemoryAdvisor;
import org.springframework.ai.chat.client.advisor.QuestionAnswerAdvisor;
import org.springframework.ai.chat.memory.ChatMemory; import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.model.ChatResponse; import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.ai.openai.api.OpenAiApi;
import org.springframework.ai.vectorstore.SearchRequest;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
@ -41,12 +21,6 @@ import java.util.*;
@CrossOrigin @CrossOrigin
public class ChatGptService { public class ChatGptService {
@Autowired
private OpenAiClient openAiClient;
@Autowired
private OpenAiStreamClient openAiStreamClient;
private final ChatClient chatClient; private final ChatClient chatClient;
public ChatGptService(ChatClient.Builder chatClientBuilder, ChatMemory chatMemory) { public ChatGptService(ChatClient.Builder chatClientBuilder, ChatMemory chatMemory) {
@ -74,10 +48,7 @@ public class ChatGptService {
.build(); .build();
} }
public Flux<Map<String,String>> getChatGptResStream(String input, SysUser sysUser) throws IOException { public Flux<Map<String,String>> getChatGptResStream(String input) throws IOException {
if(Objects.isNull(sysUser)){
throw new RuntimeException("用户信息获取失败!");
}
String id = UUID.randomUUID().toString(); String id = UUID.randomUUID().toString();
Map<String, String> finishMap = new HashMap<>(); Map<String, String> finishMap = new HashMap<>();
finishMap.put("content", "[DONE]"); finishMap.put("content", "[DONE]");
@ -96,163 +67,4 @@ public class ChatGptService {
} }
public ChatCompletionResponse getCompletionRes(ChatCompletion chatCompletion) {
List<Message> messages = chatCompletion.getMessages();
ChatCompletionResponse chatCompletionResponse = new ChatCompletionResponse();
if (CollUtil.isNotEmpty(messages)) {
Message message = messages.get(messages.size() - 1);
ChatResponse currentDate = this.chatClient.prompt()
.user(message.getContent())
.system(promptSystemSpec -> promptSystemSpec.param("current_date", LocalDateTime.now().toString()))
.advisors(advisorSpec -> advisorSpec.param(AbstractChatMemoryAdvisor.CHAT_MEMORY_RETRIEVE_SIZE_KEY, 100))
.call().chatResponse();
chatCompletionResponse.setId(currentDate.getMetadata().getId());
ChatChoice choice = new ChatChoice();
choice.setIndex(0);
choice.setMessage(Message.builder().content(currentDate.getResult().getOutput().getContent()).role(Message.Role.ASSISTANT).build());
choice.setFinishReason(currentDate.getResult().getMetadata().getFinishReason());
chatCompletionResponse.setChoices(Arrays.asList(choice));
return chatCompletionResponse;
}
return chatCompletionResponse;
}
public Flux<ChatCompletionResponse> getStreamingRes(ChatCompletion chatCompletion) {
List<Message> messages = chatCompletion.getMessages();
if(CollUtil.isNotEmpty(messages)){
Message message = messages.get(messages.size() - 1);
Flux<ChatCompletionResponse> result = this.chatClient.prompt()
.user(message.getContent())
.system(promptSystemSpec -> promptSystemSpec.param("current_date", LocalDateTime.now().toString()))
.advisors(advisorSpec -> advisorSpec.param(AbstractChatMemoryAdvisor.CHAT_MEMORY_RETRIEVE_SIZE_KEY, 100))
.stream().chatResponse().map(res -> {
ChatCompletionResponse chatCompletionResponse = new ChatCompletionResponse();
chatCompletionResponse.setId(res.getMetadata().getId());
ChatChoice choice = new ChatChoice();
choice.setIndex(0);
choice.setDelta(Message.builder().content(res.getResult().getOutput().getContent()).role(Message.Role.ASSISTANT).build());
choice.setFinishReason(res.getResult().getMetadata().getFinishReason());
chatCompletionResponse.setChoices(Arrays.asList(choice));
return chatCompletionResponse;
});
return result;
}
return Flux.just(new ChatCompletionResponse());
}
public String getChatGptRes(String input, SysUser sysUser) {
List<Message> messages = getMessages(input, sysUser);
ChatCompletion chatCompletion = ChatCompletion.builder().messages(messages).model(ChatCompletion.Model.GPT_4.getName()).build();
ChatCompletionResponse chatCompletionResponse = openAiClient.chatCompletion(chatCompletion);
return chatCompletionResponse.getChoices().get(0).getMessage().getContent().replaceAll("\r|\n", "");
}
private List<Message> getMessages(String input, SysUser sysUser) {
String messageContext = (String) LocalCache.CACHE.get(sysUser.getUserName());
List<Message> messages = new ArrayList<>();
if (StrUtil.isNotBlank(messageContext)) {
messages = JSONUtil.toList(messageContext, Message.class);
if (messages.size() >= 10) {
messages = messages.subList(1, 10);
}
Message currentMessage = Message.builder().content(input).role(Message.Role.USER).build();
messages.add(currentMessage);
} else {
Message currentMessage = Message.builder().content(input).role(Message.Role.USER).build();
messages.add(currentMessage);
}
return messages;
}
public void pictureChat(String text,String imgUrl, SysUser sysUser) {
Content textContent = Content.builder().text(text).type(Content.Type.TEXT.getName()).build();
ImageUrl imageUrl = ImageUrl.builder().url(imgUrl).build();
Content imageContent = Content.builder().imageUrl(imageUrl).type(Content.Type.IMAGE_URL.getName()).build();
List<Content> contentList = new ArrayList<>();
contentList.add(textContent);
contentList.add(imageContent);
MessagePicture message = MessagePicture.builder().role(Message.Role.USER).content(contentList).build();
ChatCompletionWithPicture chatCompletion = ChatCompletionWithPicture
.builder()
.messages(Collections.singletonList(message))
.model(ChatCompletion.Model.GPT_4_VISION_PREVIEW.getName())
.build();
ChatCompletionResponse chatCompletionResponse = openAiClient.chatCompletion(chatCompletion);
chatCompletionResponse.getChoices().forEach(e -> System.out.println(e.getMessage()));
}
public SseEmitter pictureChatStream(String text,String imgUrl, SysUser sysUser) throws IOException {
Content textContent = Content.builder().text(text).type(Content.Type.TEXT.getName()).build();
ImageUrl imageUrl = ImageUrl.builder().url(imgUrl).build();
Content imageContent = Content.builder().imageUrl(imageUrl).type(Content.Type.IMAGE_URL.getName()).build();
SseEmitter sseEmitter = new SseEmitter(0l);
sseEmitter.send(SseEmitter.event().id("1").name("连接成功!!!!").data(LocalDateTime.now()).reconnectTime(3000));
sseEmitter.onCompletion(() -> {
log.info(LocalDateTime.now() + "on completion");
});
sseEmitter.onTimeout(() -> log.info(LocalDateTime.now() + ", on timeout#" + sseEmitter.getTimeout()));
sseEmitter.onError(
throwable -> {
try {
log.info(LocalDateTime.now() + ", uid#" + "765431" + ", on error#" + throwable.toString());
sseEmitter.send(SseEmitter.event().id("765431").name("发生异常!").data(throwable.getMessage()).reconnectTime(3000));
} catch (IOException e) {
e.printStackTrace();
}
}
);
OpenAISSEEventSourceListener openAIEventSourceListener = new OpenAISSEEventSourceListener(sseEmitter);
List<Content> contentList = new ArrayList<>();
contentList.add(textContent);
contentList.add(imageContent);
MessagePicture message = MessagePicture.builder().role(Message.Role.USER).content(contentList).build();
ChatCompletionWithPicture chatCompletion = ChatCompletionWithPicture
.builder()
.messages(Collections.singletonList(message))
.model(ChatCompletion.Model.GPT_4_VISION_PREVIEW.getName())
.build();
openAiStreamClient.streamChatCompletion(chatCompletion, openAIEventSourceListener);
return sseEmitter;
}
public String generateImage(String content) {
Image image = Image.builder()
.responseFormat(com.unfbx.chatgpt.entity.images.ResponseFormat.URL.getName())
.model(Image.Model.DALL_E_3.getName())
.prompt(content)
.n(1)
.quality(Image.Quality.HD.getName())
.size(SizeEnum.size_1024_1792.getName())
.style(Image.Style.NATURAL.getName())
.build();
ImageResponse imageResponse = openAiClient.genImages(image);
return imageResponse.getData().get(0).getUrl();
}
public SseEmitter getStreaming(ChatCompletion chatCompletion) {
Flux<ChatCompletionResponse> streamingRes = getStreamingRes(chatCompletion);
SseEmitter sseEmitter = new SseEmitter(0l);
Flux.from(streamingRes)
.doOnNext(sseEvent -> {
try {
sseEmitter.send(SseEmitter.event()
.id(sseEvent.getId())
.data(sseEvent)
.reconnectTime(3000));
} catch (IOException e) {
throw new RuntimeException(e);
}
})
.doOnError(error -> {
log.error("连接断开: {}", error.getMessage());
})
.doOnComplete(() -> {
log.info("完成");
}).subscribe();
return sseEmitter;
}
} }

@ -1,13 +1,6 @@
package cn.lige2333.qrdouble.chatgpt.functions; package cn.lige2333.ligeai.chatgpt.service;
import cn.hutool.http.Header;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.lige2333.qrdouble.parking.entity.CardDto;
import cn.lige2333.qrdouble.parking.service.CardService;
import cn.lige2333.qrdouble.stock.entity.Stock;
import cn.lige2333.qrdouble.stock.enums.StockMarket;
import cn.lige2333.qrdouble.stock.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Description; import org.springframework.context.annotation.Description;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -16,82 +9,14 @@ import java.util.function.Function;
@Component @Component
public class GptFunctions { public class GptFunctions {
@Autowired
private StockService stockService;
@Autowired
private CardService cardService;
public record StockSearchRequest(Integer marketCode,String stockCode){}
public record CardInfoRequest(String userId){}
public record JenkinsBuildRequest(String projectName){} public record JenkinsBuildRequest(String projectName){}
public record StockInfo(String stockCode, String stockName, StockMarket stockMarket,Double currentPrice,Double lastClosePrice,String priceRate){}
@Bean
@Description("查找股票信息")
public Function<StockSearchRequest, StockInfo> findStock(){
return stockSearchRequest -> {
Stock stockByCode = stockService.getStockByCode(stockSearchRequest.marketCode(), stockSearchRequest.stockCode());
return new StockInfo(stockByCode.getStockCode(),stockByCode.getStockName(),StockMarket.getEnumByCode(stockByCode.getStockMarket()),stockByCode.getCurrentPrice(),stockByCode.getLastClosePrice(),stockByCode.getPriceRate());
};
}
@Bean
@Description("查找打卡信息")
public Function<CardInfoRequest, CardDto> getCardInfo(){
return cardInfoRequest -> {
try {
return cardService.getCardInfo(cardInfoRequest.userId());
}catch (Exception e){
return new CardDto();
}
};
}
@Bean
@Description("上班打卡")
public Function<CardInfoRequest, String> cardOn(){
return cardInfoRequest -> {
try {
String res = cardService.doCardOn(cardInfoRequest.userId());
if("1".equals(res)){
return "成功";
} else {
return "失败";
}
}catch (Exception e){
return "失败";
}
};
}
@Bean
@Description("下班打卡")
public Function<CardInfoRequest, String> cardOff(){
return cardInfoRequest -> {
try {
String res = cardService.doCardOff(cardInfoRequest.userId());
if("1".equals(res)){
return "成功";
} else {
return "失败";
}
}catch (Exception e){
return "失败";
}
};
}
@Bean @Bean
@Description("Jenkins构建") @Description("Jenkins构建")
public Function<JenkinsBuildRequest, String> jenkinsBuild(){ public Function<JenkinsBuildRequest, String> jenkinsBuild(){
return jenkinsBuildRequest -> { return jenkinsBuildRequest -> {
try { try {
String url = "http://panel.lige2333.cn/buildByToken/build?token=lige2333&job="+jenkinsBuildRequest.projectName(); String url = "http://jenkins.url"+jenkinsBuildRequest.projectName();
String body = HttpRequest.get(url) String body = HttpRequest.get(url)
.timeout(10000) .timeout(10000)
.execute().body(); .execute().body();

@ -1 +1,4 @@
spring.application.name=ligeai spring.application.name=ligeai
server.port=8100
spring.ai.openai.api-key=123
spring.ai.openai.base-url=123

@ -6,8 +6,8 @@ import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest @SpringBootTest
class LigeaiApplicationTests { class LigeaiApplicationTests {
@Test @Test
void contextLoads() { void contextLoads() {
} }
} }

Loading…
Cancel
Save