Note: this feature uses @dqbd/tiktoken which in turns uses WebAssembly
to perform re-tokenization for every single character typed (there's
no reusing/smart caching of blocks). This may be super heavy while being
super useful - we'll see what people say.
Note the usage of Async webAssembly is enabled in the 'webpack' config
within next.config.js.
The package makes the App slower to load, and I am not
aware of people using the Code
Execution feature
If someone still wants it, we can quickly revert
this commit and add it back (or you can use an older
official/preview build on Vercel)
Basic implementation using Zustand to store values. For now just the
ChatModel and the SystemPurpose that are currently active. This enables
app-wide synchronization and automated persistence. Meaning we can now
have settings (and in future conversations) which are persisted and
synchronized.
API keys have not been migrated yet, because we need to import them from
the existing localStorage key, for a smooth transition.
Warning: this adds 203kb of JS to the app, more than 4x'ing
the size of the app. Will remove if not worth it. Uses Sandpack
from Codesandbox.io, which stands up full execution environments
for the code.