Commit Graph

61 Commits

Author SHA1 Message Date
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
Enrico Ros 6b96046d40 Cleanups in preparation for Editability & Multi-chats 2023-03-26 04:44:53 -07:00
Enrico Ros 5008f111a7 Merged #22. Stop button in the UI
The UI side works well, including aborting the network
request to the api, and showing status and issues.
The API function (api/chat.ts) doesn't seem to work yet,
as the try/catch blocks are not triggered (both on the
'handler', and in the 'OpenAIStream').
In the meantime, having the Stop button on the UI is still
a net gain, despite tokens still running/being used from
the API call.
2023-03-26 04:25:23 -07:00
Enrico Ros f16e744ef9 Smaller moves 2023-03-24 19:06:36 -07:00
Enrico Ros 4ef48f0923 Lints 2023-03-24 18:22:13 -07:00
Enrico Ros 2ea2de601a Cleanups 2023-03-24 03:31:43 -07:00
Enrico Ros ecdcdef749 Error message for Context size 2023-03-24 03:10:51 -07:00
Enrico Ros 89b77b2408 Move all State and Defaults in the store 2023-03-24 02:45:32 -07:00
Enrico Ros 798e9e878f Migrate the API Key into the state store 2023-03-24 02:15:45 -07:00
Enrico Ros 65b8aab53e Markdown: syntax highlight in code blocks
Implements part of #11, where the markdown is in code blocks of this type:
```SomeName.md
# ...
```
2023-03-24 00:39:33 -07:00
Enrico Ros f2bb334778 Markdown: syntax highlight in code blocks
Implements part of #11, where the markdown is in code blocks of this type:
```markdown
# ...
```
2023-03-24 00:26:45 -07:00
Enrico Ros 2dafafdcf4 Improve running code. Can render basic HTML.
Fixes #19. Now it's showing the HTML in the Sandpack box.
2023-03-23 23:33:52 -07:00
Enrico Ros c15b48d1b4 Fix #24: when OPENAI_API_KEY is defined, do not prompt the user
With this simple change, if the key is defined _at build time_,
the user will not be prompted to enter a key, and it will be
marked as 'not required' in the Settings dialog.

Note that this verifies a build-time key (next build), not that
the same key is set at runtime (next start).

The behavior of the UI is just altered slightly, but enough to
show that the key is not required when set on the server.
2023-03-23 22:45:47 -07:00
Fred Liu 0ca13e67e6 Stop Generation button initial implementation. 2023-03-23 00:44:17 -07:00
Enrico Ros 4babee363a Migrated the history state 2023-03-22 01:20:17 -07:00
Enrico Ros 3e6bbd8fe8 Persisted State Store - enables better UX
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.
2023-03-22 00:29:51 -07:00
Enrico Ros 49bc3192ec Explain model/system errors to the users
Closes #18 and closes #16. Interesting find: the "code":"model_not_found" shows
that the model is just not authorized for this API key. If the model is really
non-existing and can't be found, the error code will be "null", and the message
will be "The model 'XYZ' does not exist".
2023-03-21 22:52:57 -07:00
Enrico Ros 5425ed3ca4 Update README.md 2023-03-20 21:27:01 -07:00
Enrico Ros 5cfcd7931e React hook for Speech Recognition
Adapt speech recognition to begin as 'false' and dynamically update state.
UX: the button can now be dynamic (no hydration issues). Differentiated
mobile vs desktop look.

I need to use the 'useCallback' function to pass the onResult callback,
otherwise the code loops (as the callback function will get recreated
every time, and it's circular).
2023-03-20 21:04:26 -07:00
Marc Khoury 1a052b3b64 Basic Voice Input 2023-03-20 20:59:40 -04:00