mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
feat: configure embedding servers and transcript agents
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user