zengwp

Results 9 comments of zengwp

If you ask ChatGPT the current time, it is always incorrect. Why

OpenAiService service = new OpenAiService("xxxx",Duration.ofSeconds(300)); CompletionRequest completionRequest = CompletionRequest.builder() .prompt("说出你的问题") .model("text-davinci-003").maxTokens(2048) .build(); System.out.println(service.createCompletion(completionRequest).getChoices().get(0).getText());

这个问题还是没解决

![image](https://user-images.githubusercontent.com/35715948/219316324-0f653761-85a3-4c07-a1e3-312754cd7190.png) 这个问题出现概率挺大的,铁子们有遇到吗, 有啥好的办法

> 你试试用stringbuilder来接受,拼起来,我理解有可能是上下文之间的符号,我自己拼没有遇到过这个问题。你在使用中返回时间大概是多少啊,我一般都是十秒左右了 截图就是返回的所有上下文了 我试了很久,不同的问题,返回的时间不同,最长的有一分多钟,比如一些文案类,构建答案之类

> 你有试过联系上下文吗,我看api目前没有好的方案 大致可以通过两种方式实现 1、在提交的prompt中携带上下文,比如:问:xxx \n\n 答:xxx \n\n 问:xxx 此项可以在官方示例中看到 2、通过[Fine-tuning](https://platform.openai.com/docs/guides/fine-tuning/fine-tuning)实现,这个我没弄

看官方示例库,连续对话是需要把历史聊天记录都插入prompt,并且使用stop分割,如下: List STOP = Arrays.asList("\nMi:", "\nAI:"); json.put("prompt","MI:在吗\nAI:在的\nMI介绍下自己\AI:");