Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 128 additions & 12 deletions prompto-lab-app/pom.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,136 @@
<?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"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.github.timemachinelab</groupId>
<artifactId>PromptoLab</artifactId>
<version>0.0.1-SNAPSHOT</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version>
<relativePath/>
</parent>

<artifactId>prompto-lab-app</artifactId>

<groupId>io.github.timemachinelab</groupId>
<artifactId>Promptolab</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Promptolab</name>
<description>提示词工程</description>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-55</artifactId>
<version>2.16.3</version>
</dependency>
<!-- langchain4j core dependencies (compatible with Spring Boot 2.7.x) -->
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId>
<version>0.29.1</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId>
<version>0.29.1</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>

<dependency>
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
<version>0.9.10</version>
</dependency>

<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
<version>5.8.25</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>

<!-- sa-token-->
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.35.0.RC</version>
</dependency>

<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-redis-jackson</artifactId>
<version>1.35.0.RC</version>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>

<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.57</version>
</dependency>

</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
17 changes: 0 additions & 17 deletions prompto-lab-app/src/main/java/io/github/timemachinelab/Main.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.timemachinelab;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class PromptolabApplication {
public static void main(String[] args) {
SpringApplication.run(PromptolabApplication.class, args);
}
}
51 changes: 51 additions & 0 deletions prompto-lab-app/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
server:
port: 8080

spring:
application:
name: poet-agent
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://117.72.211.46:5432/promptolab}
username: ${SPRING_DATASOURCE_USERNAME:root}
password: ${SPRING_DATASOURCE_PASSWORD:tmlis666}
driver-class-name: ${SPRING_DATASOURCE_DRIVER_CLASS_NAME:org.postgresql.Driver}
hikari:
# 连接最大生命周期(毫秒),设置为比数据库超时时间短
max-lifetime: 900000 # 15分钟(从30分钟减少到15分钟)
# 连接空闲超时时间
idle-timeout: 300000 # 5分钟(从10分钟减少到5分钟)
# 连接验证超时时间
validation-timeout: 3000 # 3秒(从5秒减少到3秒)
# 连接测试查询
connection-test-query: SELECT 1
# 连接池最小空闲连接数
minimum-idle: 2 # 从5减少到2
# 连接池最大连接数
maximum-pool-size: 10 # 从20减少到10
# 获取连接超时时间
connection-timeout: 20000 # 20秒(从30秒减少到20秒)
# 是否自动提交
auto-commit: true
# 新增:连接泄漏检测时间(毫秒)
leak-detection-threshold: 60000 # 60秒
# 新增:是否在获取连接时验证连接
connection-init-sql: SELECT 1
# 新增:连接池名称,便于监控
pool-name: HikariCP-PoetAgent
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
format_sql: true
open-in-view: false
ai:
# 持久化配置
persistence:
data-dir: ${AI_PERSISTENCE_DATA_DIR:classpath:ai-config}
backup-dir: ${AI_PERSISTENCE_BACKUP_DIR:./data/ai-config/backups}
auto-backup: ${AI_PERSISTENCE_AUTO_BACKUP:true}
backup-retention-days: ${AI_PERSISTENCE_BACKUP_RETENTION_DAYS:30}

Loading