feat: configure embedding servers and transcript agents

This commit is contained in:
yiling
2026-12-04 18:54:29 +08:00
parent 72a7f68c92
commit 553269012c
57 changed files with 1686 additions and 271 deletions
@@ -53,7 +53,7 @@ interface AgentFormDialogProps {
const agentFormSchema = z.object({
name: z.string().min(1, m.name_is_required()),
type: z.enum(['chat', 'autofill', 'embedding']),
type: z.enum(['chat', 'autofill', 'embedding', 'transcription']),
permission: z.enum(['owner', 'editor', 'reviewer']),
avatar: z.string().optional(),
providerId: z.string().optional(),
@@ -387,9 +387,12 @@ export function AgentFormDialog({
if (!res.ok) throw new Error('Failed to create agent')
return await res.json()
},
onSuccess: () => {
onSuccess: (_agent, values) => {
onClose()
queryClient.invalidateQueries({ queryKey: ['agents', teamId] })
if (values.type === 'transcription') {
void queryClient.invalidateQueries({ queryKey: ['signup-info'] })
}
toast.success(m.agent_created_successfully())
},
onError: (error) => {
@@ -406,9 +409,12 @@ export function AgentFormDialog({
if (!res.ok) throw new Error('Failed to update agent')
return await res.json()
},
onSuccess: () => {
onSuccess: (_agent, { values }) => {
onClose()
queryClient.invalidateQueries({ queryKey: ['agents', teamId] })
if (values.type === 'transcription') {
void queryClient.invalidateQueries({ queryKey: ['signup-info'] })
}
toast.success(m.agent_updated_successfully())
},
onError: (error) => {
@@ -502,6 +508,9 @@ export function AgentFormDialog({
<SelectItem value="chat">{m.agent_type_chat()}</SelectItem>
<SelectItem value="autofill">{m.agent_type_autofill()}</SelectItem>
<SelectItem value="embedding">{m.agent_type_embedding()}</SelectItem>
<SelectItem value="transcription">
{m.agent_type_transcription()}
</SelectItem>
</SelectContent>
</Select>
</Field>