feat: Support Cloudflare AI

This commit is contained in:
Martial BE
2024-04-16 18:08:56 +08:00
parent 5606a104f6
commit 344555418e
14 changed files with 606 additions and 50 deletions

View File

@@ -139,6 +139,13 @@ export const CHANNEL_OPTIONS = {
color: 'orange',
url: ''
},
35: {
key: 35,
text: 'Cloudflare AI',
value: 35,
color: 'orange',
url: ''
},
24: {
key: 24,
text: 'Azure Speech',

View File

@@ -351,27 +351,29 @@ const EditModal = ({ open, channelId, onCancel, onOk, groupOptions }) => {
)}
</FormControl>
<FormControl fullWidth error={Boolean(touched.base_url && errors.base_url)} sx={{ ...theme.typography.otherInput }}>
<InputLabel htmlFor="channel-base_url-label">{inputLabel.base_url}</InputLabel>
<OutlinedInput
id="channel-base_url-label"
label={inputLabel.base_url}
type="text"
value={values.base_url}
name="base_url"
onBlur={handleBlur}
onChange={handleChange}
inputProps={{}}
aria-describedby="helper-text-channel-base_url-label"
/>
{touched.base_url && errors.base_url ? (
<FormHelperText error id="helper-tex-channel-base_url-label">
{errors.base_url}
</FormHelperText>
) : (
<FormHelperText id="helper-tex-channel-base_url-label"> {inputPrompt.base_url} </FormHelperText>
)}
</FormControl>
{inputPrompt.base_url && (
<FormControl fullWidth error={Boolean(touched.base_url && errors.base_url)} sx={{ ...theme.typography.otherInput }}>
<InputLabel htmlFor="channel-base_url-label">{inputLabel.base_url}</InputLabel>
<OutlinedInput
id="channel-base_url-label"
label={inputLabel.base_url}
type="text"
value={values.base_url}
name="base_url"
onBlur={handleBlur}
onChange={handleChange}
inputProps={{}}
aria-describedby="helper-text-channel-base_url-label"
/>
{touched.base_url && errors.base_url ? (
<FormHelperText error id="helper-tex-channel-base_url-label">
{errors.base_url}
</FormHelperText>
) : (
<FormHelperText id="helper-tex-channel-base_url-label"> {inputPrompt.base_url} </FormHelperText>
)}
</FormControl>
)}
{inputPrompt.other && (
<FormControl fullWidth error={Boolean(touched.other && errors.other)} sx={{ ...theme.typography.otherInput }}>

View File

@@ -262,6 +262,27 @@ const typeConfig = {
model_mapping: ''
},
modelGroup: 'Midjourney'
},
35: {
input: {
models: [
'@cf/stabilityai/stable-diffusion-xl-base-1.0',
'@cf/lykon/dreamshaper-8-lcm',
'@cf/bytedance/stable-diffusion-xl-lightning',
'@cf/qwen/qwen1.5-7b-chat-awq',
'@cf/qwen/qwen1.5-14b-chat-awq',
'@hf/google/gemma-7b-it',
'@hf/thebloke/deepseek-coder-6.7b-base-awq',
'@hf/thebloke/llama-2-13b-chat-awq',
'@cf/openai/whisper'
],
test_model: '@hf/google/gemma-7b-it'
},
prompt: {
key: '按照如下格式输入CLOUDFLARE_ACCOUNT_ID|CLOUDFLARE_API_TOKEN',
base_url: ''
},
modelGroup: 'Cloudflare AI'
}
};