max-niederman / ttyper

Terminal-based typing test.
MIT License
1.05k stars 76 forks source link

Update deps #84

Closed fnordpig closed 1 year ago

fnordpig commented 1 year ago

Hi! I'm looking to (at least in a fork) integrate GPT3.5 and DALL-E to generate sentences with a theme and character set and display ascii art pictures to help my daughter (who loves minecraft) get more into the experience. I'd like to rev up the versions and thought it would be useful to submit back.

fnordpig commented 1 year ago

I updated to use ratatui as tui was abandoned and forked into an org owned by the community and renamed.

max-niederman commented 1 year ago

Thanks for the help with updating dependencies. I think it's probably out of scope of ttyper to add support for generative AI, although I'm considering adding some kind of quote sourcing in v2 (#83). You can probably get that working pretty easily by just writing a shell script which wraps ttyper and passes the sentences in a file or through stdin.

For ASCII art though, I'm not sure that enough people would want it for it to be worth the added complexity. How exactly do you envision the feature would work?

fnordpig commented 1 year ago

Hi, thanks for the merge! Yeah that's ok, I am doing it for my daughter first and foremost. She is 9 so typing in stories about minecraft is more fun than a series of words or quotes. I'm pushing my changes into the generative_ai branch on my fork, fwiw. Again, the pictures are more for my daughter to make it more interesting. Essentially the workflow today is:

The images fit in by taking the story sentence and submitting to DALL-E for image generation. The image is then rendered in the white space of the typing screen. The image is to liven up the experience and provide a visual queue prompted by the text being typed. I've not done all the image stuff yet.

Again, this isn't necessarily for merging to main. I just needed to refresh the dependencies and bump the rust version to get it working. It's kind of neat though, tbh. I grafted it in sort of violently and it's not in any shape for a merge yet.

Here's the load screen (as prompt generation can take 20 seconds or so (I plan to mask it behind the typing task after the first prompt): image

Here's a few successive typing tasks: image

image

image

Here's the associated ascii DALL-E for the last typing task: image

fnordpig commented 1 year ago

Here are the diff: https://github.com/max-niederman/ttyper/compare/main...fnordpig:ttyper:generative_ai But note that I made no meaningful attempt to integrate smoothly, so I basically short circuit the existing Opt entirely and go off the hard coded stuff for now. If it serves any purpose I'll work to make it play nicer with the rest of the code, but at this point my goal is to teach my daughter typing :-)

fnordpig commented 1 year ago

Here's with DALL-E images rendered inline: image

max-niederman commented 1 year ago

That's great! I'm happy you're able to adapt ttyper for teaching your daughter.