chatgpt-java
chatgpt-java copied to clipboard
ChatGPT Java SDK支持流式输出、Gpt插件、联网。支持OpenAI官方所有接口。ChatGPT的Java客户端。OpenAI GPT-3.5-Turb GPT-4 Api Client for Java
Caused by: java.io.IOException: unexpected end of stream on unknown java.io.EOFException: \n not found: limit=0 content=…
报错
Exception in thread "main" java.lang.ExceptionInInitializerError at com.ChatGPT.main(ChatGPT.java:16) Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j at org.apache.logging.slf4j.Log4jLoggerFactory.validateContext(Log4jLoggerFactory.java:49) at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:39) at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:30) at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:53) at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:30) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)...
引入okHttp 3.8.1版本中的HttpUrl.get方法参数为get(URL url),但是在Retrofit中调用HttpUrl.get(String url),会报NoSuchMethodError: okhttp3.HttpUrl.get(Ljava/lang/String;)Lokhttp3/HttpUrl; 手动引入okHttp3.12.0之后,不再报错 但是使用流展示的实例时,又会遇到新的版本冲突问题,具体原因没有找到,貌似是因为okHttp-see这个包的版本有问题
sse方式支持同一KEY,多个人同时提问吗?
请求超时问题
为什么用了梯子能通过浏览器访问chatgpt接口,然而使用hutools发送请求超时(访问国内的网站能够响应得到数据)  
`try { val client = buildClient() val eventSourceListener = ChatEventSourceListener(chat, Model.CHATGPT_3_5_TURBO) val message = Message.builder().role(Message.Role.USER).content(text).build() val chatCompletion = ChatCompletion.builder().messages(listOf(message)).build() client!!.streamChatCompletion(chatCompletion, eventSourceListener) val countDownLatch = CountDownLatch(1) try { countDownLatch.await() } catch...
 