Commit Graph

80 Commits

Author SHA1 Message Date
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
Enrico Ros 0e49514f03 Fix parsing of C++ code blocks 2023-03-29 03:12:10 -07:00
Enrico Ros 4af44fbff2 Broader NoSSR: too much is customized from localStorage
Also fix the layout of the APP. More stable now.
2023-03-29 02:24:06 -07:00
Enrico Ros 385ea77f93 Update Model/Purpose from the title bar
Remove it from Settings too
2023-03-29 01:51:25 -07:00
Enrico Ros 24a0213397 Move systemPurposeId/chatModelId per-chat 2023-03-28 23:32:23 -07:00
Enrico Ros df512f57b1 ChatStore: persisted multi-conversation store 2023-03-28 05:20:18 -07:00
Enrico Ros 9fd9db5d7a Pedantic 2023-03-27 22:26:42 -07:00
Enrico Ros d532fb6da2 Comments 2023-03-27 03:40:05 -07:00
Enrico Ros e71f08f629 Extract the Conversation (message list) ChatArea
In the future, more actions will be performed on the
state, so the ownership of message and messaging
actions can be brought back to the conversation, from
the (currently) ChatArea
2023-03-27 03:24:26 -07:00
Enrico Ros 9c126086b4 Index to ChatArea 2023-03-27 02:36:40 -07:00
Enrico Ros 3a69ca0b5c Improve Composer Encapsulation 2023-03-27 02:25:30 -07:00
Enrico Ros 25f4d7ed04 Extract ApplicationBar 2023-03-27 01:51:35 -07:00
Enrico Ros 90b267a93b Config cleanup 2023-03-27 01:07:51 -07:00
Enrico Ros ed7333a2c8 Rename SettingsModal 2023-03-26 23:01:12 -07:00
Enrico Ros 5c6e1e9c8d Moving forward we'll use /lib 2023-03-26 22:58:59 -07:00