rikhuijzer / ata

Ask the Terminal Anything (ATA): ChatGPT in the terminal
MIT License
274 stars 17 forks source link

Support chat (with a chat history, that is, a conversation) #24

Open rikhuijzer opened 1 year ago

rikhuijzer commented 1 year ago

This should be very much doable. To implement it, add an extra handler for CTRL + L and make that clear the message history. The handler was already added in https://github.com/rikhuijzer/ata/pull/23.

rikhuijzer commented 1 year ago

I'm gonna not do this for now. Contrary to chat.openai.com, it's very easy to request the previous query again and make changes to it. That's more productive than a conversation, in my opinion/experience.

ctrlcctrlv commented 1 year ago

i will do it, i came here to say much the same. i disagree with @rikhuijzer , this program is called ask the terminal anything and per se implies a conversation ;-)

marioseixas commented 1 year ago

i will do it, i came here to say much the same. i disagree with @rikhuijzer , this program is called ask the terminal anything and per se implies a conversation ;-)

awesome, i'm gonna use it

ctrlcctrlv commented 1 year ago

as i see it having looked at my fork again which is quite diverged so i made it a hardfork ( a8688c4 ), it probably makes the most sense to completely gut src/prompt.rs, removing @rikhuijzer's custom OpenAI API client and using async_openai (64bit/async-openai).

it could be hacked in w/o doing this but the current code is already extremely hacked and none of us know what API revisions OpenAI will make in future. continuing to use custom client is an undue maintenance burden long-term i think

ctrlcctrlv commented 10 months ago

Hello friends

I have not forgotten this

It was a massive commit, but ata² now uses async_openai! :partying_face:

https://github.com/ctrlcctrlv/ata2/commit/9f4135390ff88b72b4faf638271ecf8d2a3a63e2

This will allow very easy support of chat.

We are already using the chat API in ata², just without the ability to send multiple messages.

However, in preparation, I also totally overhauled his use of GNU readline. Multiline messages are now possible, terminated with ^D.

image

ata² also has prompt history.

ctrlcctrlv commented 10 months ago

@rikhuijzer my code may be too diverged to backport, but I hadn't really touched src/prompt.rs before this so it may not be so hard, you're welcome to as always :)

marioseixas commented 10 months ago

incredible job @ctrlcctrlv

ctrlcctrlv commented 9 months ago

I have this working now but the way I implemented it is a bit of a mess.

See ctrlcctrlv#1.

image