Comments (5)
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:
- 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
- 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.
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:
- 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
- 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:
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.
@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.
Gonna have to try Azure OpenAI soon! Any of y'all wanna whip up a PR for this? π
from novel.
Would be awesome to have API for this so I can use my own backend for that!
from novel.
Related Issues (20)
- feat: high-light syntax on a code-block
- feat:
- feat: Overwrite the `simpleExtensions` especially the markdown config HOT 3
- bug: cannot remove a selected link in the bubble menu
- bug: yarn novel can't find novel/extensions module HOT 1
- Need help running the example.
- feat: table support
- TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))bug: HOT 5
- feat: Can drag custom react components
- Can't access to the editor instance to change content programmatically HOT 2
- β TS Errors need to be fixed on null of editor for lastest version of Novel HOT 2
- πbug: editable={false} doesn't prevent editing content HOT 1
- feat: Possibility to await a slash command and display a loading spinner?
- feat: Easy way to reference the editor outside the EditorContent HOT 2
- Error after typing any character after '/' HOT 4
- feat: Support for custom Open AI API URL HOT 1
- bug: codeblock-lowlight doesn't render in html output HOT 1
- Cannot find module 'novel/extensions' or its corresponding type declarations. HOT 2
- Cannot set text color when the text is bold HOT 1
- Cannot import Editor from novel bug: HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from novel.