Giter VIP home page Giter VIP logo

Comments (5)

steven-tey avatar steven-tey commented on July 20, 2024 4

Great idea! I actually had this as part of v1:

CleanShot.2023-03-21.at.16.36.49.mp4

Tiptap doesn't support this natively so I had to build a custom Placeholder component: https://github.com/steven-tey/novel/blob/44878691b9acf237476675c5c6ac8aa9105c8c3b/lib/tiptap/placeholder.ts

There were 2 main issues though:

  1. I couldn't figure out how to position the placeholder ghost text properly so I had to use a duplicate ghost text that was hidden by the overlying text – which won't work with bolded text & inline code
  2. This has to be super fast for it to be useful – as you can see in the demo, it's a bit slow. It has to be fast enough that you won't need to stream the responses in (it'll just show up)

So I ended up scraping it πŸ˜…

If anyone can figure out a stellar implementation for this based on the work I've done before, I'm all ears πŸ˜„

from novel.

AeroXi avatar AeroXi commented on July 20, 2024 2

Great idea! I actually had this as part of v1:

CleanShot.2023-03-21.at.16.36.49.mp4

Tiptap doesn't support this natively so I had to build a custom Placeholder component: https://github.com/steven-tey/novel/blob/44878691b9acf237476675c5c6ac8aa9105c8c3b/lib/tiptap/placeholder.ts

There were 2 main issues though:

  1. I couldn't figure out how to position the placeholder ghost text properly so I had to use a duplicate ghost text that was hidden by the overlying text – which won't work with bolded text & inline code
  2. This has to be super fast for it to be useful – as you can see in the demo, it's a bit slow. It has to be fast enough that you won't need to stream the responses in (it'll just show up)

So I ended up scraping it πŸ˜…

If anyone can figure out a stellar implementation for this based on the work I've done before, I'm all ears πŸ˜„

I really love this feature!
According to https://stackoverflow.com/a/9325686 the google search box may use similar implementation.
And I tried in Gmail, I believe they determine the ghost text style by the last user input character, like this:
ζˆͺ屏2023-07-09 20 39 31
Also, ChatGPT API are getting faster, I think it would be a good idea to add this feature first. Here's a video for Azure openai gpt-3.5-turbo, really fast:
https://twitter.com/gaodengming/status/1674972718704521216?s=20

from novel.

shkreios avatar shkreios commented on July 20, 2024 1

@steven-tey Thank you for the fast response

This has to be super fast for it to be useful – as you can see in the demo, it's a bit slow. It has to be fast enough that you won't need to stream the responses in (it'll just show up)

Have you already tried using gpt-3.5-turbo via the azure openai service. From what I have understood of the many chats on the openai forum, is that many are experiencing much slower responses from the openai api than chatgpt(plus) using the same model.

The current answer to these threads are that the openai api is using a shared engine ref and chatgpt is using an isolated one/separate env. The reason I am bringing up azure openai is that many posts mention that they are seeing 2x maybe faster response times for the same model and since the pricing, as far as i can tell, is the same, it's perhaps worth giving it a try.

from novel.

steven-tey avatar steven-tey commented on July 20, 2024 1

Gonna have to try Azure OpenAI soon! Any of y'all wanna whip up a PR for this? πŸ‘€

from novel.

emil14 avatar emil14 commented on July 20, 2024

Would be awesome to have API for this so I can use my own backend for that!

from novel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.