ekkinox/yai

Piping ( | ) to yai

Opened this issue · 5 comments

fire17 commented

Hi there, I really like your project :)
It is the one i use most often along side ai-shell which i also like

Wanted to request a feature to allow data piping in and out of the ai
please draw inspiration from openai_pipe 👈
there are really good examples showcased in the main Readme

also, please add context from previous session (i can imagine a hotkeys to save context, load from file, and reset)
its really annoying to exit, enter, and it just forgets the last thing we talked about

Thanks a lot and all the best!

Hello 👋

Thanks for the feedback.

Piping is already supported, see second CLI example from the doc: https://ekkinox.github.io/yai/examples/#cli-mode

For the previous context feature request, it's something I need to think about: sending to open ai the incremental previous contexts could lead very quickly to reach max tokens limit, and generate additional open ai api usage costs for the user.

Maybe we could make it configurable with a sensible limit by default (in YAI config file)

fire17 commented

Thanks I tried piping but it didn't work, I'll see that I have the latest release and try again

I don't worry about the context getting to big because most times the sessions are pretty short, I can get in and out of yai 10 times, each time it's usually no more a command line or a short paragraph, so all together it's like a page...

I would allow to set the rolling window size. For example I would set it to minimum 3 sessions back , and even some more up to a max of tokens.

Would be nice if there was a counter of tokens.
Also, do you log the chat? How do I find previous things I asked yai and it's responses?
Until you enable the rolling window, I can also pipe with logs to tail and from tail to yai... :)
It's not a seamless solution but it could work..
Maybe even a well designed alias to use yai with tail of logs yo yo

Piping is available since 0.2.0

Ok for your suggestion, flagged as feature request

fire17 commented

Thanks :)

Also, do you log the chat? How do I find previous things I asked yai and it's responses? Until you enable the rolling window, I can also pipe with logs to tail and from tail to yai... :) It's not a seamless solution but it could work.. Maybe even a well designed alias to use yai with tail of logs yo yo

@ekkinox thoughts?