Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support context of conversation between User and Assistant #43

Open
Xanonymous-GitHub opened this issue Mar 14, 2023 · 1 comment
Open

Comments

@Xanonymous-GitHub
Copy link
Contributor

Xanonymous-GitHub commented Mar 14, 2023

See https://platform.openai.com/docs/guides/chat for more details.

In this proposal we should think about how to reduce the cost of conversation. Currently openAI doesn't provide any session related mechanism for storing the conversation state. Hence we have to send all the conversation history to openAI in EACH chat completion request.

There may be some workarounds for solving this problem.
Firstly, establish an AI middle wall (Optimizer) between the real Answer generation and user client.

[Client] <<====>> [Optimizer] <<====>> OpenAI
                     ^^^^

In this optimizer, we shrink ALL previous chat conversion sent by the User and Assistant role into one sentence, which makes us only need to send two msgs to OpenAI each time.

              /------<-------<--------<-----<----|
             /                                   |
[Previous Context] ----o---> [OpenAI] -->---->---|
[  Next Chat Msg ] ---/

Secondly, in the optimizer, we not only do things above but also ask AI for helping us organize msg content. Some approaches like removing unnecessary words to let AI smartly fill them; Avoid spaces and use CamelCase rule to express period positions.

@Xanonymous-GitHub Xanonymous-GitHub changed the title Support context of conversation between User and Assistance Support context of conversation between User and Assistant Mar 14, 2023
@Xanonymous-GitHub
Copy link
Contributor Author

Xanonymous-GitHub commented Mar 14, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant