From df7c363ccbafdeaf2940dc7a4a55458a8af8e153 Mon Sep 17 00:00:00 2001 From: Danny Aziz Date: Sun, 26 Mar 2023 16:48:34 -0400 Subject: [PATCH] Add some additional text for API Key (#210) * feat: API Key Link * feat: key input placeholder --- components/Chat/Chat.tsx | 52 ++++++++++++++++++++++++++------------ components/Sidebar/Key.tsx | 1 + 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/components/Chat/Chat.tsx b/components/Chat/Chat.tsx index 1d42332..0541b8c 100644 --- a/components/Chat/Chat.tsx +++ b/components/Chat/Chat.tsx @@ -20,7 +20,7 @@ import { ChatMessage } from './ChatMessage'; import { ErrorMessageDiv } from './ErrorMessageDiv'; import { ModelSelect } from './ModelSelect'; import { SystemPrompt } from './SystemPrompt'; -import { IconSettings } from "@tabler/icons-react"; +import { IconSettings } from '@tabler/icons-react'; interface Props { conversation: Conversation; @@ -117,6 +117,17 @@ export const Chat: FC = ({ 'Please set your OpenAI API key in the bottom left of the sidebar.', )} +
+ {t("If you don't have an OpenAI API key, you can get one here: ")} + + openai.com + +
) : modelError ? ( @@ -131,7 +142,7 @@ export const Chat: FC = ({ {models.length > 0 && ( -
+
= ({ ) : ( <> -
- {t('Model')}: {conversation.model.name} - -
- {showSettings && ( -
-
- onUpdateConversation(conversation, { key: "model", value: model })} - /> -
+
+ {t('Model')}: {conversation.model.name} +
- )} + {showSettings && ( +
+
+ + onUpdateConversation(conversation, { + key: 'model', + value: model, + }) + } + /> +
+
+ )} {conversation.messages.map((message, index) => ( = ({ apiKey, onApiKeyChange }) => { value={newKey} onChange={(e) => setNewKey(e.target.value)} onKeyDown={handleEnterDown} + placeholder={t('API Key') || 'API Key'} />