openai-java
openai-java copied to clipboard
Spring boot project request timeout
Strangely, neither restTemplate nor okhttp3 can call the official api. Postman can make normal requests.
The demo provided by the author cannot be accessed. The dependent version is 0.11.0
same
me too
Caused by: java.net.SocketTimeoutException: connect timed out
哇找到组织了,我也是,开始我还以为是ChatMessage对象太多了导致的
有没有大佬有解决方案
可以考虑直接用境外服务器试试?
可以考虑使用外部环境服务器测试吗?
我放香港服务器上 也是500,而且顺便问一句,在开发聊天工程的时候,我按照官文的样例传输某用户的历史问题到LIST中以后,gpt还是会回复上面所有的问题,这也导致返回时间越来越长,你们也存在这个问题嘛
可以考虑使用外部环境服务器测试吗?
我放香港服务器上 也是500,而且顺便问一句,在开发聊天工程的时候,我按照官文的样例传输某用户的历史问题到LIST中以后,gpt还是会回复上面所有的问题,这也导致返回时间越来越长,你们也存在这个问题嘛
我们测试发现,官方提供的接口就算用达芬奇引擎,回答的质量是没有官方的demo好,可能阉割了很多。如果包含上下文回答都是回复的比较慢,我看其他公司的demo都是一问一答的形式。
可以考虑使用外部环境服务器测试吗?
我放香港服务器上 也是500,而且顺便问一句,在开发聊天工程的时候,我按照官文的样例传输某用户的历史问题到LIST中以后,gpt还是会回复上面所有的问题,这也导致返回时间越来越长,你们也存在这个问题嘛
我们测试发现,官方提供的接口就算用达芬奇引擎,回答的质量是没有官方的demo好,可能阉割了很多。如果包含上下文回答都是回复的比较慢,我看其他公司的demo都是一问一答的形式。
嗯,这个确实我也发现了,可以试着将温度调低回答可能更准确一些。至于联系上下文的问题,看了其他人的问题回复,应该和stop这个参数相关。
一直连接超时,有大佬解决了踢我一脚
Search the issues. Someone built a proxy override that fixes this.
Search the issues. Someone built a proxy override that fixes this.
Build a proxy forwarding in the project?
开vpn, 主方法调用前补充开启代理就行 System.setProperty("java.net.useSystemProxies", "true"); System.setProperty("https.proxyHost", "127.0.0.1"); System.setProperty("https.proxyPort", vpn的代理端口);
谢谢,我试一下
I added a section to the README on how to set up a proxy https://github.com/TheoKanning/openai-java#adding-a-proxy
Let me know if that helps!
Can you add agents based on the original OpenAiService ?
I added a section to the README on how to set up a proxy https://github.com/TheoKanning/openai-java#adding-a-proxy
Let me know if that helps!
Hello, I found the following exceptions in the visit times after joining the agent:
Caused by: java.io.IOException: unexpected end of stream on unknown Caused by: java.io.EOFException: \n not found: limit=0 content=…
Can you add agents based on the original OpenAiService ?
Directly find the OpenAiService class provided by the author, find the buildApi method to add proxy proxy information
thanks,let's me try
开vpn, 主方法调用前补充开启代理就行 System.setProperty("java.net.useSystemProxies", "true"); System.setProperty("https.proxyHost", "127.0.0.1"); System.setProperty("https.proxyPort", vpn的代理端口);
我发现加了之后,请求时会报java.lang.RuntimeException: java.io.IOException: unexpected end of stream on unknown异常
postman is ok
you can
开vpn, 主方法调用前补充开启代理就行 System.setProperty("java.net.useSystemProxies", "true"); System.setProperty("https.proxyHost", "127.0.0.1"); System.setProperty("https.proxyPort", vpn的代理端口);
我发现加了之后,请求时会报java.lang.RuntimeException: java.io.IOException: unexpected end of stream on unknown异常
我的没有问题了,
System.setProperty("http.proxyHost", "127.0.0.1"); System.setProperty("http.proxyPort", "7890"); System.setProperty("https.proxyHost", "127.0.0.1"); System.setProperty("https.proxyPort", "7890"); OpenAiService service = new OpenAiService("sk-xxxxxxxxx");
List<ChatMessage> chatMessages=new ArrayList<>();
ChatMessage chatMessage =new ChatMessage();
chatMessage.setRole("user");
chatMessage.setContent("你好");
chatMessages.add(chatMessage);
System.out.println("\nCreating completion...");
ChatCompletionRequest completionRequest = ChatCompletionRequest.builder()
.model("gpt-3.5-turbo-0301").messages(chatMessages).build();
service.createChatCompletion(completionRequest).getChoices().forEach(System.out::println);
model 分别是 ? gpt-3.5-turbo-0301除了这个,还有gpt-4?