import { type FC, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Button, Space, App // Slider, Input, // Form, // Checkbox } from 'antd'; import copy from 'copy-to-clipboard' import Card from './components/Card'; // import qpsRestrictions from '@/assets/images/application/qpsRestrictions.svg' // import dailyAdjustmentDosage from '@/assets/images/application/dailyAdjustmentDosage.svg' // import tokenCap from '@/assets/images/application/tokenCap.svg' // const limitList = [ // { key: 'qpsRestrictions', value: '10', icon: qpsRestrictions, unit: ' times/second' }, // { key: 'dailyAdjustmentDosage', value: '1000', icon: dailyAdjustmentDosage, unit: ' times/day' }, // { key: 'tokenCap', value: '10', icon: tokenCap, unit: 'M Tokens/day' }, // ] // const sdkList = ['pythonSDK', 'nodejsSDK', 'goSDK', 'curlExample'] const Api: FC<{apiKeyList?: string[]}> = ({apiKeyList = []}) => { const { t } = useTranslation(); const [activeMethods, setActiveMethod] = useState(['GET']); const { message } = App.useApp() // const [form] = Form.useForm(); const copyContent = window.location.origin + '/v1/chat' const handleCopy = (content: string) => { copy(content) message.success(t('common.copySuccess')) } return (
{/*
*/}
{['GET', 'POST', 'PUT', 'DELETE'].map((method) => ( ))}
{copyContent}
+ {t('application.addApiKey')} // } >
{t('application.apiKeyTitle')}

{t('application.apiKeyDesc')}

{apiKeyList.map((item, index) => (
{item} {/*
handleDelete(index)} >
*/}
))}
{/*
{t('application.requestExample')}
curl -X POST https://api.example.com/v1/agent/execute \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d
{t('application.responseExample')}
curl -X POST https://api.example.com/v1/agent/execute \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d
{limitList.map(item => (
{t(`application.${item.key}`)}
{item.value}{item.unit}
))}
{sdkList.map(item => (
{t(`application.${item}`)}
))}
{t('application.WebhookReturnsTimeout')} ({t('application.WebhookReturnsTimeoutDesc')})} > {t('application.whitelistIP')} ({t('application.whitelistIPDesc')})} > {t('application.publicAPIDocumentation')} */}
{/*
*/}
); } export default Api;