1 Star 0 Fork 43

叶诺 / lucy-chat

forked from Lboot / lucy-chat 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Lucy v1.0.0

不断迭代的技术解决方案


lucy-chat

简介

lucy-chat是基于springboot框架接入ChatGPT的轻量级解决方案,目前已实现功能如下:

  • 聊天接口接入
  • 聊天记录
  • 聊天上下文支持
  • 编辑接口接入
  • 绘图接口接入
  • 内部集成聊天html
  • Latex数学公式解析
  • 代码段格式解析
  • 自定义鉴权拓展
  • 持久化存储拓展
  • 支持pom引入
  • ...

安装

lucy-chat提供了两种形式进行服务接入

1. Jar引入

准备

在引入任何 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

2. 独立服务

  1. 从开源地址下载项目
git clone https://gitee.com/lboot/lucy-chat.git
  1. 修改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>
  1. 修改相关配置文件, 参考上文的配置文件相关内容,项目中提供的 key为私人 key,随时会被替换。
  2. 打包项目并部署

使用

完成后可以参阅表格访问[服务地址]/路径

功能 路径
API文档 /doc.html
聊天窗口 /chat/web
指定聊天窗口 /chat/{chatId}

文档

更多功能介绍和功能拓展请参阅

更多文档

技术支持

kindear@foxmail.com

MIT License Copyright (c) 2023 Kindear Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

轻量级Springboot接入ChatGPT方案,支持多种引入方式,提供网页对话功能,支持代码块和数学公式解析 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/yu1188/lucy-chat.git
git@gitee.com:yu1188/lucy-chat.git
yu1188
lucy-chat
lucy-chat
master

搜索帮助