openai-java
openai-java copied to clipboard
能否支持上下文关联?
似乎没法进行一段连续的对话,能否支持上下文关联?

How did you implement this?
使用这个库开放了个接口,用react做前端,实现聊天?
In the example above, what call did you make to the API and using what parameters?
.model("text-davinci-003") .topP(1.0) .n(1) .temperature(0.0) .maxTokens(800)
看官方示例库,连续对话是需要把历史聊天记录都插入prompt,并且使用stop分割,如下: List<String> STOP = Arrays.asList("\nMi:", "\nAI:"); json.put("prompt","MI:在吗\nAI:在的\nMI介绍下自己\AI:");
prompt中输入之前会话的所有内容即可实现该功能
计算费用是根据输出token计算的还是输入token计算的啊
采用的是输出token。可以考虑用新的chatgpt-api以及模型参数了,价格更低
加起来都算上,惊不惊喜意不意外
用session 来保持连续对话
用session 来保持连续对话
咋用?求指點,感謝大佬
用session 来保持连续对话
咋用?求指點,感謝大佬
我还没试过这是百度给的。我的api好像用不了
用session 来保持连续对话
咋用?求指點,感謝大佬
我还没试过这是百度给的。我的api好像用不了
有百度的連接嗎?我看官方API文檔沒有提到與session相關的 輸入
用session 来保持连续对话
咋用?求指點,感謝大佬
我还没试过这是百度给的。我的api好像用不了
有百度的連接嗎?我看官方API文檔沒有提到與session相關的 輸入
刚才找了下没找到..不过网上还是有session id这个玩意 但是调用的方法跟现在的不一样了。我不知道能不能用 你可以问问 gpt 他会有带session的方法
这是gpt给我的,我之前也确实查到过,但到目前我的sdk还没解决好,用不了,没试过这个你可以试试
嗯嗯 可以試試 但是奇怪的是 官方API文檔并沒有提及 這個屬性
https://platform.openai.com/docs/api-reference/
我試試吧 還是覺得奇怪
这是gpt给我的,我之前也确实查到过,但到目前我的sdk还没解决好,用不了,没试过这个你可以试试
嗯嗯 可以試試 但是奇怪的是 官方API文檔并沒有提及 這個屬性 https://platform.openai.com/docs/api-reference/
我試試吧 還是覺得奇怪 根本不行!!!!!
![]()
I didn't follow everything, but two notes.
- Chat uses the chat completions endpoint, not the completions one.
https://api.openai.com/v1/chat/completions
- The chat completions API from OpenAI currently does not support the session_id. There is an ID that is returned, but the above endpoint does not supporting using id or session_id as a parameter.
https://platform.openai.com/docs/guides/chat/introduction
这是gpt给我的,我之前也确实查到过,但到目前我的sdk还没解决好,用不了,没试过这个你可以试试