Commit Graph

94 Commits

Author SHA1 Message Date
Enrico Ros 89f5802e8d Large improvement to (model-dependent) token utilization
And update README.md
2023-04-03 04:03:12 -07:00
Enrico Ros 23a3185696 Load PDFs on drag/drop, min-worker, dynamic import
Cleaned up the code a bit (thx gpt4), with:
 - dynamic module load: JS is chunked up and deferred to PDF loading,
   which improves all the sessions where PDFs are not loaded
 - unified path for drag/drop and 'load file' (shall call it "magic drop"
   so PDFs are text'ified upon drag/dop as well
 - fixed "not being able to load the same doc twice" (thx gpt4)
 - using minified worker, as it's loaded dynamically, we save ~50% bandwidth
2023-04-03 02:57:02 -07:00
Enrico Ros 0377512464 Move files around, for cleanup 2023-04-03 01:49:02 -07:00
Enrico Ros 7574fea434 Resolved merge conflict. 2023-04-02 23:58:32 -07:00
fredliubojin 421e06e617 Using pdfjs-dist to parse and load pdf contents. 2023-04-02 23:37:23 -07:00
Enrico Ros ee0efdea1f Markdown rendering. Closes #46. See #11.
Will be soon turned on by default, when the CSS and rendering is
of higher quality (right now making it default will make
non-Markdown chats look quite different).

Thanks. Great stuff Nils (@nilshulth)
2023-04-02 23:36:34 -07:00
Enrico Ros 429d3d69d5 Cleanup settings while adding a toggle for Markdown (on by default) 2023-04-02 23:07:26 -07:00
Enrico Ros dc64da7d18 Restore min height. Not a part of the merge, and broken on mobile. 2023-04-02 23:06:25 -07:00
Nils Hulth 1b6ee6aede Fixed error with double click prop 2023-04-02 22:33:21 +02:00
Nils Hulth df595eb36b Merge to main smaller input window 2023-04-02 22:23:27 +02:00
Nils Hulth 2a7a2950a7 Added support for Markdown formatting in the chatmessages 2023-04-02 21:54:05 +02:00
Nils Hulth e8a661399e Made the default height of the input box 2 instead of 5 to use less space, especially on mobile 2023-04-02 21:31:57 +02:00
Enrico Ros 9a7169a80c Cleanup 2023-04-02 04:34:26 -07:00
Enrico Ros c307a1cd76 Cleanup fonts. Closes #44. Thx Typpo. 2023-04-02 01:15:49 -07:00
Enrico Ros ebddffa14b Fix Mic on mobile/desktop 2023-04-01 18:38:52 -07:00
Enrico Ros e2eac30155 Cleanup token estimation
Move the function to a separate file for better encapsulation
2023-04-01 18:21:57 -07:00
Enrico Ros d6215d021e Composer: show estimated tokens
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.
2023-04-01 18:03:44 -07:00
Enrico Ros eef67f3b68 Show the new features! 2023-04-01 05:38:13 -07:00
Enrico Ros 1e6880df6a Merge remote-tracking branch 'origin/main' 2023-04-01 04:39:11 -07:00
Enrico Ros 064de8dc1e Export chats. Closes #25
Chats are exported to paste.gg, are unlisted by default, and expire
in 30 days by default. The user is also provided with the deletion
key which will be only shown at the time of creation, and it's needed
to take down the paste.

Rendering looks quite great, including code and turns.
2023-04-01 04:38:53 -07:00
Jon Willis 2a74924ba7 Use Textarea to gather Custom system message instead of alert modal. 2023-03-31 09:38:25 -07:00
Enrico Ros a20e596773 Ready for 4/1 2023-03-31 04:19:22 -07:00
Enrico Ros c07aee01e0 State Optimizations and Cleanup 2023-03-31 03:35:05 -07:00
Enrico Ros e3014a2622 Update readme 2023-03-30 20:26:17 -07:00
Enrico Ros b0e2d59a53 Style cleanups 2023-03-30 20:01:19 -07:00
Enrico Ros 7154db7f72 Configurable API Host
Closes #32. Enable Users / Deployments to change the host where
OpenAI API calls are directed to. This enables project like
[Helicone](https://www.helicone.ai/) (Observability of LLM ops)
for tracking prompt/responses quality in real-time.

Configuration:
- User: App > Settings > Advanced > API host (e.g. "oai.hconeai.com")
- Deployment: set the 'API_API_HOST=...' environment variable

User takes precedence over deployment over api.openai.com. Realtime
switching in chat apps works well.

Note: the Helicone team is fixing dashboard reporting for 'streaming'
over the /v1/chat/completions endpoint.
2023-03-30 20:00:40 -07:00
Harlan Lewis d15e8955e9 disable ligatures inside code blocks
don't render `!=`, `==`, etc as ligatured glyphs
2023-03-30 14:12:23 -07:00
Enrico Ros f678a0d463 Remove Sandpack (code execution)
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)
2023-03-30 05:54:14 -07:00
Enrico Ros 2efa6de1f0 Tone colors down 2023-03-30 04:18:59 -07:00
Enrico Ros 9bacd6eb4f Typing indication 2023-03-30 04:13:27 -07:00
Enrico Ros 6ef04bf22f Rename DMessage fields
Note: some older chats will lost the name of the model
but they'll regain it fast. And now the system purpose
that originated the message is captured, as well as
the typing indication
2023-03-30 04:07:39 -07:00
Enrico Ros a1d6552ed7 Adjust colors 2023-03-30 02:37:53 -07:00
Enrico Ros b8212f7162 Disable showing system messages by default 2023-03-30 01:58:58 -07:00
Enrico Ros cfe32aa0a7 Central default for ChatModelId 2023-03-30 01:46:18 -07:00
Enrico Ros 3bcbf029b8 Cleanups
Thanks Harlan @harlanlewis
Input=password: inspired by https://github.com/enricoros/nextjs-chatgpt-app/commit/bc76a753ec4425986e4a1922ca0330ceaa668d22
Usage: https://github.com/enricoros/nextjs-chatgpt-app/commit/aefb2a4a850449f934176e170e7baa58915aa484
2023-03-30 01:39:48 -07:00
Enrico Ros 3532f4f9b6 Copy icons - closes #30
Icons show up when hovering. Tooltips galore.
2023-03-30 00:31:46 -07:00
Enrico Ros baedf00cfd Improve swapping purposes, and rendering 2023-03-29 22:49:08 -07:00
Enrico Ros 2eb4893727 Swappable Purpose, and cleanups 2023-03-29 18:07:31 -07:00
Enrico Ros 82da8e55e3 Double-click to Edit 2023-03-29 17:25:56 -07:00
Enrico Ros 9920e6008e Clarity 2023-03-29 16:36:31 -07:00
Enrico Ros 2288186b8f Advanced Settings 2023-03-29 16:32:53 -07:00
Enrico Ros 2a11d1854f Cleanup Chat, ChatMessage (vs Message), ChatMessageList (vs Conversation) 2023-03-29 15:26:37 -07:00
Enrico Ros e256f1e2ec Purpose Selector 2023-03-29 14:28:15 -07:00
Enrico Ros 60d3300a8d Clear button 2023-03-29 13:16:01 -07:00
Enrico Ros b03ed4f17a Allow Free Scrolling 2023-03-29 05:08:30 -07:00
Enrico Ros 2405f0ddd1 Application Bar: Hamburger Menu
Will be the home of the chat switcher, now disabled. Good for
experimentation of UX and data structures.
2023-03-29 04:35:06 -07:00
Enrico Ros 69ffebef0b Confirmation for clearing the chat 2023-03-29 03:46:24 -07:00
Enrico Ros d63505a3a7 Anchor fix. 2023-03-29 03:16:15 -07:00
Enrico Ros b24204974a Application menu (3 dots, top-right)
Also cleanup other Menus
2023-03-29 03:15:56 -07:00
Enrico Ros 43a13fffe2 Fix again the V-layout of the Area 2023-03-29 03:14:29 -07:00