chatgpt stream
v1.0.0
OpenAi最簡潔的Java流式返回接入方式,方便接入業務系統,沒有第三方依賴,只需要使用Spring Boot即可!輕鬆構建你的帶有聊天記憶、畫圖功能的chatgpt,支持代碼塊高亮、markdown語法!
GitHub倉庫:https://github.com/NiuXiangQian/chatgpt-stream
採用sse技術,感興趣的可以先了解一下
非專業前端,樣式略醜



original-simplicity分支裡 openai :
key-list :
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # 你的key列表 默认是轮询使用
- xxxxx申請地址:https://platform.openai.com/
HttpClient httpClient = HttpClient . create ()
. secure ( sslContextSpec -> sslContextSpec . sslContext ( finalSslContext ))
. tcpConfiguration ( tcpClient -> tcpClient . proxy ( proxy ->
proxy . type ( ProxyProvider . Proxy . HTTP ). host ( "127.0.0.1" ). port ( 7890 ))); env : test啟動springboot 然後訪問http://127.0.0.1:8080/
只需要稍微擴展如下接口,即可接入自己的業務系統將消息入庫、記錄....
public interface CompletedCallBack {
/**
* 成功完成回调用
*/
void completed ( Message questions , String sessionId , String response );
/**
* 失败回调
*/
void fail ( Message questions , String sessionId , String response );
}有問題可以提交issue,有想法也可以提交pr,歡迎大家
如果對你有幫助還請幫忙給個star,謝謝!