{"id":49325539,"url":"https://github.com/NiuXiangQian/chatgpt-stream","last_synced_at":"2026-05-29T21:00:54.658Z","repository":{"id":148758354,"uuid":"617745066","full_name":"NiuXiangQian/chatgpt-stream","owner":"NiuXiangQian","description":"OpenAi最简洁的Java流式返回接入方式，方便接入业务系统，没有第三方依赖，只需要使用Spring Boot即可！轻松构建你的带有聊天记忆、画图功能的chatgpt，支持代码块高亮、markdown语法！","archived":false,"fork":false,"pushed_at":"2025-07-16T10:55:29.000Z","size":3385,"stargazers_count":273,"open_issues_count":5,"forks_count":75,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-17T14:49:35.164Z","etag":null,"topics":["chat-application","chatbot","chatgpt","openai","openai-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NiuXiangQian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-23T02:36:17.000Z","updated_at":"2025-07-16T10:55:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1249d93-b967-4f7e-961f-5baf8d347156","html_url":"https://github.com/NiuXiangQian/chatgpt-stream","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/NiuXiangQian/chatgpt-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiuXiangQian%2Fchatgpt-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiuXiangQian%2Fchatgpt-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiuXiangQian%2Fchatgpt-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiuXiangQian%2Fchatgpt-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NiuXiangQian","download_url":"https://codeload.github.com/NiuXiangQian/chatgpt-stream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiuXiangQian%2Fchatgpt-stream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat-application","chatbot","chatgpt","openai","openai-api"],"created_at":"2026-04-26T20:00:31.588Z","updated_at":"2026-05-29T21:00:54.653Z","avatar_url":"https://github.com/NiuXiangQian.png","language":"Java","funding_links":[],"categories":["人工智能"],"sub_categories":["LLM客户端"],"readme":"![Github issues](https://img.shields.io/github/issues/NiuXiangQian/chatgpt-stream)\n![Github stars](https://img.shields.io/github/stars/NiuXiangQian/chatgpt-stream)\n![GitHub forks](https://img.shields.io/github/forks/NiuXiangQian/chatgpt-stream)\n![GitHub license](https://img.shields.io/github/license/NiuXiangQian/chatgpt-stream)\n\n## 🔥你的chatgpt🔥\n\nOpenAi最简洁的Java流式返回接入方式，方便接入业务系统，没有第三方依赖，只需要使用Spring Boot即可！轻松构建你的带有聊天记忆、画图功能的chatgpt，支持代码块高亮、markdown语法！\n- 模型：gpt-3.5-turbo / gpt-4\n\nGitHub仓库：[https://github.com/NiuXiangQian/chatgpt-stream](https://github.com/NiuXiangQian/chatgpt-stream)\n\n## 特点\n\n* 无第三方依赖\n* 流式返回\n* 有聊天记忆\n* 画图\n\n采用sse技术，感兴趣的可以先了解一下\n\n### 👀效果\n非专业前端，样式略丑\n* 最新效果\n![截图1](docs/demo3.png)\n* 最初版本\n![截图2](docs/demo2.gif)\n![截图3](docs/demo1.png)\n\n### 时间轴\n- 2023-06-16 健壮性优化，规范化数据返回，优化sse接口业务上的异常处理。\n             增加html中sse的post请求方式，参考：[index_post.html](src%2Fmain%2Fresources%2Fstatic%2Findex_post.html)\n- 2023-04-02 更换为vue渲染更加便捷，加入代码块高亮、表格markdown语法支持\n- 2023-04-01 优化样式、修复聊天记忆bug\n- 2023-03-29 使用netty提高并发能力\n- 2023-03-23-下午 增加了聊天记忆、画图功能\n- 2023-03-23 上午 第一版最简易版本demo，此版本代码在`original-simplicity`分支里\n### 重要配置\n\n```yaml\nopenai:\n  key-list:\n    - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 你的key列表 默认是轮询使用\n    - xxxxx\n```\n申请地址：https://platform.openai.com/\n\n### 关于中国大陆访问不通问题\n\n* 使用vpn代理\n    - 此功能已经实现 请查看 OpenAiWebClient.java 配置好代理ip和端口即可\n    ```java\n  \n  HttpClient httpClient = HttpClient.create()\n            .secure(sslContextSpec -\u003e sslContextSpec.sslContext(finalSslContext))\n            .tcpConfiguration(tcpClient -\u003e tcpClient.proxy(proxy -\u003e\n                proxy.type(ProxyProvider.Proxy.HTTP).host(\"127.0.0.1\").port(7890)));\n  \n    ```\n* 部署到海外\n    - 取消如下配置即可\n  ```yaml\n    env: test\n    ```\n\n### 启动\n\n启动springboot 然后访问 http://127.0.0.1:8080/\n\n### 便于接入自己的业务系统\n\n只需要稍微扩展如下接口，即可接入自己的业务系统将消息入库、记录....\n```java\npublic interface CompletedCallBack {\n\n    /**\n     * 成功完成回调用\n     */\n    void completed(Message questions, String sessionId, String response);\n\n    /**\n     * 失败回调\n     */\n    void fail(Message questions, String sessionId, String response);\n}\n```\n\n### 后续功能\n\n- [X] 流式返回\n- [X] 聊天记忆\n- [X] 图片接入\n- [ ] ....\n\n### 交流方式\n\n有问题可以提交issue，有想法也可以提交pr，欢迎大家\n\n如果对你有帮助还请帮忙给个star，谢谢！\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNiuXiangQian%2Fchatgpt-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNiuXiangQian%2Fchatgpt-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNiuXiangQian%2Fchatgpt-stream/lists"}