Feat: add data type invoke (#5126)

### What problem does this PR solve?
```
Invoke agent
To be able to interact dynamically with the API, there is a customizable Data Type JSON or FormData, the default is JSON 
```

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
so95
2025-02-27 15:15:33 +07:00
committed by GitHub
parent 7a6e70d6b3
commit 11de7599e5
5 changed files with 39 additions and 13 deletions

View File

@ -528,6 +528,7 @@ This auto-tag feature enhances retrieval by adding another layer of domain-speci
'Allows sentence rewriting with the specified language or defaults to the latest question if not selected.',
avatarHidden: 'Hide avatar',
locale: 'Locale',
selectLanguage: 'Select a language',
reasoning: 'Reasoning',
reasoningTip:
'It will trigger reasoning process like Deepseek-R1/OpenAI o1. Integrates an agentic search process into the reasoning workflow, allowing models itself to dynamically retrieve external knowledge whenever they encounter uncertain information.',
@ -845,7 +846,7 @@ This auto-tag feature enhances retrieval by adding another layer of domain-speci
bingDescription:
'A component that searches from https://www.bing.com/, allowing you to specify the number of search results using TopN. It supplements the existing knowledge bases. Please note that this requires an API key from microsoft.com.',
apiKey: 'API KEY',
country: 'Country&Region',
country: 'Country & Region',
language: 'Language',
googleScholar: 'Google Scholar',
googleScholarDescription:
@ -1187,6 +1188,7 @@ This delimiter is used to split the input text into several text pieces echo of
addCategory: 'Add category',
categoryName: 'Category name',
nextStep: 'Next step',
datatype: 'MINE type of the HTTP request',
insertVariableTip: `Enter / Insert variables`,
},
footer: {

View File

@ -606,6 +606,7 @@ export const initialInvokeValues = {
}`,
proxy: 'http://',
clean_html: false,
datatype: 'json',
};
export const initialTemplateValues = {

View File

@ -69,6 +69,15 @@ const InvokeForm = ({ onValuesChange, form, node }: IOperatorForm) => {
>
<Switch />
</Form.Item>
<Form.Item name={'datatype'} label={t('flow.datatype')}>
<Select
options={[
{ value: 'json', label: 'application/json' },
{ value: 'formdata', label: 'multipart/form-data' },
]}
allowClear={true}
></Select>
</Form.Item>
<DynamicVariablesForm node={node}></DynamicVariablesForm>
</Form>
</>