openai-java icon indicating copy to clipboard operation
openai-java copied to clipboard

建议给completion增加context

Open zhong2312 opened this issue 2 years ago • 8 comments

通过https://api.openai.com/v1/conversations获取conversationId,然后每次发起对话时把conversationId传给completion。这样就能实现连续语境对话。

zhong2312 avatar Feb 15 '23 03:02 zhong2312

"Obtain the conversationId through https://api.openai.com/v1/conversations, and then pass the conversationId to completion every time a conversation is initiated. This enables continuous contextual dialogue."

Clever!

cryptoapebot avatar Feb 15 '23 15:02 cryptoapebot

不好意思,我搞错了。https://api.openai.com/v1/conversations 是chatGPT的接口。openai目前没开放这个接口

zhong2312 avatar Feb 16 '23 06:02 zhong2312

这个问题还是没解决

zengwp avatar Feb 16 '23 08:02 zengwp

I did find a ShareGPT Chrome plugin.
https://techcrunch.com/2022/12/08/sharegpt-lets-you-easily-share-your-chatgpt-conversations/

It lets you create a link to any conversation. It does appear to use the conversations endpoint and what I assume is the conversation ID.

<meta itemProp="image" content="https://sharegpt.com/api/conversations/oPt72P3/og"/><meta property="og:logo" content="https://sharegpt.com/logo.png"/>

That might help in deconstructing a way to do it.

cryptoapebot avatar Feb 16 '23 14:02 cryptoapebot

I did find a ShareGPT Chrome plugin. https://techcrunch.com/2022/12/08/sharegpt-lets-you-easily-share-your-chatgpt-conversations/

It lets you create a link to any conversation. It does appear to use the conversations endpoint and what I assume is the conversation ID.

<meta itemProp="image" content="https://sharegpt.com/api/conversations/oPt72P3/og"/><meta property="og:logo" content="https://sharegpt.com/logo.png"/>

That might help in deconstructing a way to do it.

Thank you for your help, but I checked the official api which doesn't seem to explain how to pass the conversationId

chaofanx avatar Feb 16 '23 15:02 chaofanx

通过prompt将之前对话的所有信息全部提交即可实现会话功能

mrjiangyan avatar Feb 27 '23 05:02 mrjiangyan

通过prompt将之前对话的所有信息全部提交即可实现会话功能

这样避免不了4000多个token限制的问题吧

stoneHah avatar Mar 10 '23 01:03 stoneHah