Download client/src/components/Input/SetKeyDialog/CustomEndpoint.tsx from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/client/src/components/Input/SetKeyDialog/CustomEndpoint.tsx
- Command line
-
hf download hf://spaces/Zhitomir/chat/client/src/components/Input/SetKeyDialog/CustomEndpoint.tsx
-
curl -L -o CustomEndpoint.tsx https://huggingface.co/spaces/Zhitomir/chat/resolve/main/client/src/components/Input/SetKeyDialog/CustomEndpoint.tsx
1.1 kB
| import { EModelEndpoint } from 'librechat-data-provider'; | |
| import { useFormContext, Controller } from 'react-hook-form'; | |
| import InputWithLabel from './InputWithLabel'; | |
| const CustomEndpoint = ({ | |
| endpoint, | |
| userProvideURL, | |
| }: { | |
| endpoint: EModelEndpoint | string; | |
| userProvideURL?: boolean | null; | |
| }) => { | |
| const { control } = useFormContext(); | |
| return ( | |
| <form className="flex-wrap"> | |
| <Controller | |
| name="apiKey" | |
| control={control} | |
| render={({ field }) => ( | |
| <InputWithLabel | |
| id="apiKey" | |
| {...field} | |
| label={`${endpoint} API Key`} | |
| labelClassName="mb-1" | |
| inputClassName="mb-2" | |
| /> | |
| )} | |
| /> | |
| {userProvideURL && ( | |
| <Controller | |
| name="baseURL" | |
| control={control} | |
| render={({ field }) => ( | |
| <InputWithLabel | |
| id="baseURL" | |
| {...field} | |
| label={`${endpoint} API URL`} | |
| labelClassName="mb-1" | |
| /> | |
| )} | |
| /> | |
| )} | |
| </form> | |
| ); | |
| }; | |
| export default CustomEndpoint; | |