mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-03 19:15:30 +08:00
### What problem does this PR solve? Feat: Hide part of the message field in webhook mode #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Co-authored-by: balibabu <assassin_cike@163.com>
This commit is contained in:
@ -2120,8 +2120,8 @@ Important structured information may include: names, dates, locations, events, k
|
|||||||
queryParameters: 'Query parameters',
|
queryParameters: 'Query parameters',
|
||||||
headerParameters: 'Header parameters',
|
headerParameters: 'Header parameters',
|
||||||
requestBodyParameters: 'Request body parameters',
|
requestBodyParameters: 'Request body parameters',
|
||||||
streaming: 'Accepted response',
|
immediately: 'Accepted response',
|
||||||
immediately: 'Final response',
|
streaming: 'Final response',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
llmTools: {
|
llmTools: {
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
IAttachment,
|
IAttachment,
|
||||||
IEventList,
|
IEventList,
|
||||||
IInputEvent,
|
|
||||||
IMessageEndData,
|
IMessageEndData,
|
||||||
IMessageEndEvent,
|
IMessageEndEvent,
|
||||||
IMessageEvent,
|
IMessageEvent,
|
||||||
@ -93,7 +92,7 @@ export function findMessageFromList(eventList: IEventList) {
|
|||||||
export function findInputFromList(eventList: IEventList) {
|
export function findInputFromList(eventList: IEventList) {
|
||||||
const inputEvent = eventList.find(
|
const inputEvent = eventList.find(
|
||||||
(x) => x.event === MessageEventType.UserInputs,
|
(x) => x.event === MessageEventType.UserInputs,
|
||||||
) as IInputEvent;
|
);
|
||||||
|
|
||||||
if (!inputEvent) {
|
if (!inputEvent) {
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import { FormContainer } from '@/components/form-container';
|
|
||||||
import { BlockButton, Button } from '@/components/ui/button';
|
import { BlockButton, Button } from '@/components/ui/button';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
@ -67,7 +66,6 @@ function MessageForm({ node }: INextOperatorForm) {
|
|||||||
{showWebhookResponseStatus && (
|
{showWebhookResponseStatus && (
|
||||||
<WebHookResponseStatusFormField name="status"></WebHookResponseStatusFormField>
|
<WebHookResponseStatusFormField name="status"></WebHookResponseStatusFormField>
|
||||||
)}
|
)}
|
||||||
<FormContainer>
|
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel tooltip={t('flow.msgTip')}>{t('flow.msg')}</FormLabel>
|
<FormLabel tooltip={t('flow.msgTip')}>{t('flow.msg')}</FormLabel>
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
@ -108,8 +106,8 @@ function MessageForm({ node }: INextOperatorForm) {
|
|||||||
</div>
|
</div>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</FormContainer>
|
{!showWebhookResponseStatus && (
|
||||||
<FormContainer>
|
<>
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel tooltip={t('flow.downloadFileTypeTip')}>
|
<FormLabel tooltip={t('flow.downloadFileTypeTip')}>
|
||||||
{t('flow.downloadFileType')}
|
{t('flow.downloadFileType')}
|
||||||
@ -159,7 +157,8 @@ function MessageForm({ node }: INextOperatorForm) {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</FormContainer>
|
</>
|
||||||
|
)}
|
||||||
</FormWrapper>
|
</FormWrapper>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export function useShowWebhookResponseStatus(form: UseFormReturn<any>) {
|
|||||||
const showWebhookResponseStatus = useMemo(() => {
|
const showWebhookResponseStatus = useMemo(() => {
|
||||||
const formData: BeginFormSchemaType = getNode(BeginId)?.data.form;
|
const formData: BeginFormSchemaType = getNode(BeginId)?.data.form;
|
||||||
return (
|
return (
|
||||||
formData.mode === AgentDialogueMode.Webhook &&
|
formData?.mode === AgentDialogueMode.Webhook &&
|
||||||
formData.execution_mode === WebhookExecutionMode.Streaming
|
formData.execution_mode === WebhookExecutionMode.Streaming
|
||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Reference in New Issue
Block a user