File size: 1,952 Bytes
f0743f4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | import { memo } from 'react';
import { EModelEndpoint } from 'librechat-data-provider';
import { useLocalize } from '~/hooks';
function HelpText({ endpoint }: { endpoint: string }) {
const localize = useLocalize();
const textMap = {
[EModelEndpoint.google]: (
<>
<small className="mt-4 break-all text-text-secondary">
{localize('com_endpoint_config_google_service_key')}
{': '}
{localize('com_endpoint_config_key_google_need_to')}{' '}
<a
target="_blank"
href="https://console.cloud.google.com/vertex-ai"
rel="noreferrer"
className="text-blue-700 underline dark:text-blue-400"
>
{localize('com_endpoint_config_key_google_vertex_ai')}
</a>{' '}
{localize('com_endpoint_config_key_google_vertex_api')}{' '}
<a
target="_blank"
href="https://console.cloud.google.com/projectselector/iam-admin/serviceaccounts/create?walkthrough_id=iam--create-service-account#step_index=1"
rel="noreferrer"
className="text-blue-700 underline dark:text-blue-400"
>
{localize('com_endpoint_config_key_google_service_account')}
</a>
{'. '}
{localize('com_endpoint_config_key_google_vertex_api_role')}
</small>
<small className="break-all text-text-secondary">
{localize('com_endpoint_config_google_api_key')}
{': '}
{localize('com_endpoint_config_google_api_info')}{' '}
<a
target="_blank"
href="https://makersuite.google.com/app/apikey"
rel="noreferrer"
className="text-blue-700 underline dark:text-blue-400"
>
{localize('com_endpoint_config_click_here')}
</a>{' '}
</small>
</>
),
};
return textMap[endpoint] || null;
}
export default memo(HelpText);
|