c-ttpfx / chatgpt-java-wx Goto Github PK
View Code? Open in Web Editor NEWchatgpt微信聊天小程序。java编写服务器,实现chatgpt接口的调用,微信小程序用于聊天。二者基于webSocket进行通信
License: GNU General Public License v3.0
chatgpt微信聊天小程序。java编写服务器,实现chatgpt接口的调用,微信小程序用于聊天。二者基于webSocket进行通信
License: GNU General Public License v3.0
太不好看了,我又不会写。
大佬好,我最近也开发了一个公众号调用chatgpt的接口,目前最大的问题就是网络速度太慢,跨外网调接口的延时太高了,目前有几个解决方案,不知道大佬怎么想。
我是将代码部署到国内的阿里云上,然后在服务器上去跨域开代理,这样其实网络不算快。
刚看了你的代码是将代码部署到香港的服务器上,请问一下这样速度会快一点吗,还有一个问题就是如果是香港的服务器,国内是ping得通的吗(而且香港好像也没有chatgpt的访问权限好像)。
我就在想,我将代码部署到国外服务器好,还是国内服务器好。国外服务器可能调chatgpt接口很快,但是用户去ping国外服务器请求服务器的接口好像又是请求不到的还是?
不知道大佬有没有遇到相同的问题,可以探讨一下
请问可以出一份完整的配置教程嘛,感谢
在调用gpt的接口过程中,openai偶尔返回这样的报错
"error": {
"message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)",
"type": "invalid_request_error",
"param": null,
"code": null
}
并且不能稳定复现,如果再次进行同样的对话,就不会出现了
我本地想先测试一下server端的代码,本地是没问题可以翻墙的,但是为什么一直显示failed,我后来加了代理也不行,为什么啊?
2023-08-14 10:45:54.079 INFO 80416 --- [p-nio-80-exec-6] com.ttpfx.server.ChatWebSocketServer : 1--open
1--1
Exception in thread "httpclient-dispatch-3" java.lang.NoSuchMethodError: javax.net.ssl.SSLParameters.setApplicationProtocols([Ljava/lang/String;)V
at org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy.applyParameters(DefaultClientTlsStrategy.java:108)
at org.apache.hc.client5.http.ssl.AbstractClientTlsStrategy.lambda$upgrade$0(AbstractClientTlsStrategy.java:138)
at org.apache.hc.core5.reactor.ssl.SSLIOSession.initialize(SSLIOSession.java:293)
at org.apache.hc.core5.reactor.ssl.SSLIOSession.beginHandshake(SSLIOSession.java:268)
at org.apache.hc.core5.reactor.InternalDataChannel.startTls(InternalDataChannel.java:258)
at org.apache.hc.client5.http.impl.nio.DefaultManagedAsyncClientConnection.startTls(DefaultManagedAsyncClientConnection.java:158)
at org.apache.hc.client5.http.ssl.AbstractClientTlsStrategy.upgrade(AbstractClientTlsStrategy.java:111)
at org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy.upgrade(DefaultClientTlsStrategy.java:48)
at org.apache.hc.client5.http.impl.nio.DefaultAsyncClientConnectionOperator.upgrade(DefaultAsyncClientConnectionOperator.java:179)
at org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager.upgrade(PoolingAsyncClientConnectionManager.java:505)
at org.apache.hc.client5.http.impl.async.InternalHttpAsyncExecRuntime.upgradeTls(InternalHttpAsyncExecRuntime.java:249)
at org.apache.hc.client5.http.impl.async.AsyncConnectExec.proceedToNextHop(AsyncConnectExec.java:323)
at org.apache.hc.client5.http.impl.async.AsyncConnectExec.access$000(AsyncConnectExec.java:82)
at org.apache.hc.client5.http.impl.async.AsyncConnectExec$4.completed(AsyncConnectExec.java:298)
at org.apache.hc.client5.http.impl.async.AsyncConnectExec$6.completed(AsyncConnectExec.java:423)
at org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec$1.consumeResponse(HttpAsyncMainClientExec.java:224)
at org.apache.hc.core5.http.impl.nio.ClientHttp1StreamHandler.consumeHeader(ClientHttp1StreamHandler.java:243)
at org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexer.consumeHeader(ClientHttp1StreamDuplexer.java:348)
at org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexer.consumeHeader(ClientHttp1StreamDuplexer.java:80)
Hi, 我看了挺多项目的,这个项目是少有的比较完整的项目,包括前端和后端,很有价值~ 因为不懂 java 所以想请教两个问题:
(1)chatGPT 官网的回复是逐个字进行回复的,这个是否支持?
(2)是否支持特殊格式显示,例如 java/python等 代码高亮,类似 csdn 那种?
转换异常,{
"error": {
"message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)",
"type": "invalid_request_error",
"param": null,
"code": null
}
} 不能被转换为json
楼主请问哪段代码是保持上下文的啊?
请输入问题(q退出):你好
failed
javax.net.ssl.SSLHandshakeException: TLS handshake failed
at org.apache.hc.core5.reactor.ssl.SSLIOSession.updateEventMask(SSLIOSession.java:454)
at org.apache.hc.core5.reactor.ssl.SSLIOSession.setEvent(SSLIOSession.java:802)
at org.apache.hc.core5.reactor.InternalDataChannel.setEvent(InternalDataChannel.java:359)
at org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.requestShutdown(AbstractHttp1StreamDuplexer.java:424)
at org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onInput(AbstractHttp1StreamDuplexer.java:348)
at org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.inputReady(AbstractHttp1IOEventHandler.java:64)
at org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.inputReady(ClientHttp1IOEventHandler.java:41)
at org.apache.hc.core5.reactor.ssl.SSLIOSession.decryptData(SSLIOSession.java:624)
at org.apache.hc.core5.reactor.ssl.SSLIOSession.access$200(SSLIOSession.java:74)
at org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:202)
at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:142)
at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178)
at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:86)
at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
at java.base/java.lang.Thread.run(Thread.java:829)
想部署一个中文模型,比如中文羊驼或glm,然后放在本地或服务器上,接入微信小程序,应该如何做到?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.