Fetch the repository succeeded.
This action will force synchronization from Lboot/lucy-chat, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
Lucy v1.0.0
不断迭代的技术解决方案
lucy-chat
lucy-chat
是基于springboot
框架接入ChatGPT
的轻量级解决方案,目前已实现功能如下:
html
Latex
数学公式解析pom
引入lucy-chat
提供了两种形式进行服务接入
准备
在引入任何 Lucy
系列依赖之前,需要完成jitpack
镜像仓库的配置。
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://www.jitpack.io</url>
</repository>
</repositories>
引入
根据版本号引入 (与发行版对应 例 1.0.0)
<dependency>
<groupId>com.gitee.lboot</groupId>
<artifactId>lucy-chat</artifactId>
<version>${version}</version>
</dependency>
启动类
启用 knife4j
文档,需要在启动类上配置 @EnableKnife4j
@EnableKnife4j
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(LucyAdminApplication.class, args);
}
}
配置文件
使用 lucy-chat
需要配置如下文件信息
spring.application.name=lucy-chat
# 运行端口
server.port=8080
# swagger 匹配
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
# chat-gpt api-key
# 申请地址 https://platform.openai.com/account/api-keys
openai.chat.key=
# chat-gpt proxy host
# 配置代理地址 请参阅 https://www.v2ex.com/t/921689
openai.chat.host=
# 连接池最大连接数
forest.max-connections=1000
# 连接超时时间,单位为毫秒
forest.connect-timeout=30000
# 数据读取超时时间,单位为毫秒
forest.read-timeout=30000
git clone https://gitee.com/lboot/lucy-chat.git
POM
文件中打包方式,即恢复 <build>
相关注释掉的内容<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
key
为私人 key
,随时会被替换。完成后可以参阅表格访问[服务地址]/路径
功能 | 路径 |
---|---|
API文档 |
/doc.html |
聊天窗口 | /chat/web |
指定聊天窗口 | /chat/{chatId} |
更多功能介绍和功能拓展请参阅
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。