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

Request / fix #20

Open
jordon31 opened this issue Mar 18, 2023 · 3 comments
Open

Request / fix #20

jordon31 opened this issue Mar 18, 2023 · 3 comments

Comments

@jordon31
Copy link

jordon31 commented Mar 18, 2023

Can you add conversation history like on chatgpt?

Elimination (single chat)

Confirm deletion of all chats (Then add a SQL database to store the chats)

The chat is automatically named as on chatgpt

Add the new GPT-4 models to me I need from 32K tokens

they gave me the permission that i can use gpt-4 via API

Adding a previous text change like on chatgpt

and improve the speed.. I noticed that it goes slow when doing the LiveType I hope that fixes it

another problem I noticed that when generating a code the box to copy it is not generated immediately but at the end

I like this project

@DuckyMomo20012
Copy link
Owner

Hi Jordon, about your questions:

  • About conversation history: Yeah, I did think about this since planning steps, but this was a course project with limited times about 2 weeks, so I have to start with single-chat first, to make sure I can keep up with the deadlines. I will add this feature to the roadmap for implementation 👌.
  • Confirm deletion of all chats: This is already implemented as the Clear button, which purges all the persisted data on the local storage.
  • Upload conversation to SQL database: I decided not to add a database layer to the stack because I want this project as simple as possible.
    • I think allowing the user to export the conversation to local files is a good temporary solution now, as the user can upload it as a training convo.
  • GPT-4: As the response format is not changed, I will add gpt4 models on the next maintenance. It might require some modification since the price is changed for both prompt and completion.
  • Typing speed: The typing effect is just for "simulating" Chat GPT or removing unwanted content, the speed is configurable. I have set it to about 100ms, but I think it is quite slow too 😅.
  • Copy code problem: Hm, I don't understand your question, since the code highlighting is only rendered after the typing is finished. I have also tested it, and it seems to work fine.

Thanks for your compliment, I am glad that you like it 🥰.

@jordon31
Copy link
Author

jordon31 commented Mar 19, 2023

Hi..
Thanks for the replies

The evidence of the code is it possible to make it start from the beginning? and not in the end

I changed the "typeSpeed" to 10 ms.. sometimes it doesn't respond anymore and sometimes it takes a long time to process the response

And if you want to put the conversion history will you do via json file?

another convenient idea is this

add an "Upload" button that reads the content of the text file that pastes it directly into the chat and I send

Thanks.

@DuckyMomo20012
Copy link
Owner

I forgot to mention that the response may be slowed when the Open AI API is in high traffic. This behavior is the same as the ChatGPT.

About the response that doesn't respond anymore, the app will silently retry 3 times, with exponential backoff delay, so maybe the response from the server was discarded as it took too long. You can click the Regenerate response button to regenerate the completion. Currently, I think I will increase the retry times to catch the delayed responses.

About conversation history, I tried to implement this feature lately, and I rewrote the redux structure and stuff but it is not so good. I'm trying to "normalize" the data as below:

Example data
{
  convo: {
    ids: ['yB4NANXSYSrWge-Y9kKas', 'dWE4MXZyUerlEMpiaj0v2'],
    entities: {
      'yB4NANXSYSrWge-Y9kKas': {
        chatId: 'M31vCF6Y043IcYkeG5AsS',
        role: 'user',
        content: 'd',
        isTyping: false,
        id: 'yB4NANXSYSrWge-Y9kKas',
      },
      dWE4MXZyUerlEMpiaj0v2: {
        id: 'dWE4MXZyUerlEMpiaj0v2',
        object: 'chat.completion',
        created: 1677649420,
        model: 'gpt-3.5-turbo',
        usage: {
          prompt_tokens: 56,
          completion_tokens: 31,
          total_tokens: 87,
        },
        choices: [
          {
            message: {
              role: 'assistant',
              content: 'Foo',
            },
            finish_reason: 'stop',
            index: 0,
          },
        ],
        chatId: 'M31vCF6Y043IcYkeG5AsS',
        role: 'assistant',
        content: 'Foo',
        isTyping: false,
      },
    },
  },
  model: {
    name: 'gpt-3.5-turbo',
    price: {
      prompt: 0.0002,
      completion: 0.0002,
    },
    per: 1000,
  },
  history: {
    ids: ['M31vCF6Y043IcYkeG5AsS'],
    entities: {
      M31vCF6Y043IcYkeG5AsS: {
        id: 'M31vCF6Y043IcYkeG5AsS',
        title: 'New Chat',
        completion_tokens: 0,
        prompt_tokens: 0,
        total_tokens: 0,
      },
    },
  },
  _persist: {
    version: -1,
    rehydrated: true,
  },
}

I'm currently stuck distributing the history id to the chat toolbar from the header and the chat. I think I will move the chat toolbar to the chat later.

About your idea of reading the conversation from a file, I will add it to the roadmap 👌.

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

2 participants