forked from mckaywrigley/chatbot-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8150e7
commit e1f286e
Showing
19 changed files
with
1,695 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# Chatbot UI | ||
DEFAULT_MODEL=gpt-3.5-turbo | ||
DEFAULT_SYSTEM_PROMPT=You are ChatGPT, a large language model trained by OpenAI. Follow the user's instructions carefully. Respond using markdown. | ||
OPENAI_API_KEY=YOUR_KEY | ||
OPENAI_API_KEY=YOUR_KEY | ||
|
||
GOOGLE_API_KEY=YOUR_API_KEY | ||
GOOGLE_CSE_ID=YOUR_ENGINE_ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { Plugin, PluginList } from '@/types/plugin'; | ||
import { useTranslation } from 'next-i18next'; | ||
import { FC, useEffect, useRef } from 'react'; | ||
|
||
interface Props { | ||
plugin: Plugin | null; | ||
onPluginChange: (plugin: Plugin) => void; | ||
} | ||
|
||
export const PluginSelect: FC<Props> = ({ plugin, onPluginChange }) => { | ||
const { t } = useTranslation('chat'); | ||
|
||
const selectRef = useRef<HTMLSelectElement>(null); | ||
|
||
useEffect(() => { | ||
if (selectRef.current) { | ||
selectRef.current.focus(); | ||
} | ||
}, []); | ||
|
||
return ( | ||
<div className="flex flex-col"> | ||
<div className="w-full rounded-lg border border-neutral-200 bg-transparent pr-2 text-neutral-900 dark:border-neutral-600 dark:text-white"> | ||
<select | ||
ref={selectRef} | ||
className="w-full cursor-pointer bg-transparent p-2" | ||
placeholder={t('Select a plugin') || ''} | ||
value={plugin?.id || ''} | ||
onChange={(e) => { | ||
onPluginChange( | ||
PluginList.find( | ||
(plugin) => plugin.id === e.target.value, | ||
) as Plugin, | ||
); | ||
}} | ||
> | ||
<option | ||
key="none" | ||
value="" | ||
className="dark:bg-[#343541] dark:text-white" | ||
> | ||
Select Plugin | ||
</option> | ||
|
||
{PluginList.map((plugin) => ( | ||
<option | ||
key={plugin.id} | ||
value={plugin.id} | ||
className="dark:bg-[#343541] dark:text-white" | ||
> | ||
{plugin.name} | ||
</option> | ||
))} | ||
</select> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.