mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Chore/API for AgentflowV2 (#4696)
* Enhancement: Introduce prepended chat history handling in Agent and LLM nodes. - Added support for `prependedChatHistory` in both `Agent` and `LLM` classes to allow for initial message context. - Implemented validation for history schema in execution flow to ensure proper format. - Refactored utility functions to include JSON sanitization and validation methods for improved data handling. * update prediction swagger
This commit is contained in:
@@ -48,21 +48,30 @@ const OverrideConfigTable = ({ columns, onToggle, rows, sx }) => {
|
||||
return <SwitchInput onChange={(enabled) => handleChange(enabled, row)} value={row.enabled} />
|
||||
} else if (key === 'type' && row.schema) {
|
||||
// If there's schema information, add a tooltip
|
||||
const schemaContent =
|
||||
'[<br>' +
|
||||
row.schema
|
||||
.map(
|
||||
(item) =>
|
||||
` ${JSON.stringify(
|
||||
{
|
||||
[item.name]: item.type
|
||||
},
|
||||
null,
|
||||
2
|
||||
)}`
|
||||
)
|
||||
.join(',<br>') +
|
||||
'<br>]'
|
||||
let schemaContent
|
||||
if (Array.isArray(row.schema)) {
|
||||
// Handle array format: [{ name: "field", type: "string" }, ...]
|
||||
schemaContent =
|
||||
'[<br>' +
|
||||
row.schema
|
||||
.map(
|
||||
(item) =>
|
||||
` ${JSON.stringify(
|
||||
{
|
||||
[item.name]: item.type
|
||||
},
|
||||
null,
|
||||
2
|
||||
)}`
|
||||
)
|
||||
.join(',<br>') +
|
||||
'<br>]'
|
||||
} else if (typeof row.schema === 'object' && row.schema !== null) {
|
||||
// Handle object format: { "field": "string", "field2": "number", ... }
|
||||
schemaContent = JSON.stringify(row.schema, null, 2).replace(/\n/g, '<br>').replace(/ /g, ' ')
|
||||
} else {
|
||||
schemaContent = 'No schema available'
|
||||
}
|
||||
|
||||
return (
|
||||
<Stack direction='row' alignItems='center' spacing={1}>
|
||||
|
||||
@@ -11,21 +11,30 @@ export const TableViewOnly = ({ columns, rows, sx }) => {
|
||||
return row[key] ? <Chip label='Enabled' color='primary' /> : <Chip label='Disabled' />
|
||||
} else if (key === 'type' && row.schema) {
|
||||
// If there's schema information, add a tooltip
|
||||
const schemaContent =
|
||||
'[<br>' +
|
||||
row.schema
|
||||
.map(
|
||||
(item) =>
|
||||
` ${JSON.stringify(
|
||||
{
|
||||
[item.name]: item.type
|
||||
},
|
||||
null,
|
||||
2
|
||||
)}`
|
||||
)
|
||||
.join(',<br>') +
|
||||
'<br>]'
|
||||
let schemaContent
|
||||
if (Array.isArray(row.schema)) {
|
||||
// Handle array format: [{ name: "field", type: "string" }, ...]
|
||||
schemaContent =
|
||||
'[<br>' +
|
||||
row.schema
|
||||
.map(
|
||||
(item) =>
|
||||
` ${JSON.stringify(
|
||||
{
|
||||
[item.name]: item.type
|
||||
},
|
||||
null,
|
||||
2
|
||||
)}`
|
||||
)
|
||||
.join(',<br>') +
|
||||
'<br>]'
|
||||
} else if (typeof row.schema === 'object' && row.schema !== null) {
|
||||
// Handle object format: { "field": "string", "field2": "number", ... }
|
||||
schemaContent = JSON.stringify(row.schema, null, 2).replace(/\n/g, '<br>').replace(/ /g, ' ')
|
||||
} else {
|
||||
schemaContent = 'No schema available'
|
||||
}
|
||||
|
||||
return (
|
||||
<Stack direction='row' alignItems='center' spacing={1}>
|
||||
|
||||
Reference in New Issue
Block a user