Expose agent node usage (#24355)
This commit is contained in:
parent
da9af7b547
commit
0a2111f33d
24 changed files with 42 additions and 1 deletions
|
|
@ -467,6 +467,13 @@ export const SUPPORT_OUTPUT_VARS_NODE = [
|
|||
BlockEnum.Agent,
|
||||
]
|
||||
|
||||
export const AGENT_OUTPUT_STRUCT: Var[] = [
|
||||
{
|
||||
variable: 'usage',
|
||||
type: VarType.object,
|
||||
},
|
||||
]
|
||||
|
||||
export const LLM_OUTPUT_STRUCT: Var[] = [
|
||||
{
|
||||
variable: 'text',
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import type { VariableAssignerNodeType } from '@/app/components/workflow/nodes/v
|
|||
import type { Field as StructField } from '@/app/components/workflow/nodes/llm/types'
|
||||
|
||||
import {
|
||||
AGENT_OUTPUT_STRUCT,
|
||||
HTTP_REQUEST_OUTPUT_STRUCT,
|
||||
KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT,
|
||||
LLM_OUTPUT_STRUCT,
|
||||
|
|
@ -498,6 +499,7 @@ const formatItem = (
|
|||
res.vars = [
|
||||
...outputs,
|
||||
...TOOL_OUTPUT_STRUCT,
|
||||
...AGENT_OUTPUT_STRUCT,
|
||||
]
|
||||
break
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,6 +100,11 @@ const AgentPanel: FC<NodePanelProps<AgentNodeType>> = (props) => {
|
|||
type='String'
|
||||
description={t(`${i18nPrefix}.outputVars.text`)}
|
||||
/>
|
||||
<VarItem
|
||||
name='usage'
|
||||
type='object'
|
||||
description={t(`${i18nPrefix}.outputVars.usage`)}
|
||||
/>
|
||||
<VarItem
|
||||
name='files'
|
||||
type='Array[File]'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue