mirror of
https://github.com/langgenius/dify.git
synced 2026-05-10 14:14:17 +08:00
fix: llm generation variable
This commit is contained in:
parent
b0a059250a
commit
e85b0c49d8
@ -46,7 +46,7 @@ export const useWorkflowTemplate = () => {
|
||||
id: 'answer',
|
||||
data: {
|
||||
...answerDefault.defaultValue,
|
||||
answer: `{{#${llmNode.id}.text#}}`,
|
||||
answer: `{{#${llmNode.id}.generation#}}`,
|
||||
type: answerDefault.metaData.type,
|
||||
title: t(`blocks.${answerDefault.metaData.type}`, { ns: 'workflow' }),
|
||||
},
|
||||
|
||||
@ -144,6 +144,24 @@ export const AGENT_OUTPUT_STRUCT: Var[] = [
|
||||
]
|
||||
|
||||
export const LLM_OUTPUT_STRUCT: Var[] = [
|
||||
{
|
||||
variable: 'generation',
|
||||
type: VarType.object,
|
||||
children: [
|
||||
{
|
||||
variable: 'content',
|
||||
type: VarType.string,
|
||||
},
|
||||
{
|
||||
variable: 'reasoning_content',
|
||||
type: VarType.arrayString,
|
||||
},
|
||||
{
|
||||
variable: 'tool_calls',
|
||||
type: VarType.arrayObject,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
variable: 'text',
|
||||
type: VarType.string,
|
||||
@ -161,10 +179,6 @@ export const LLM_OUTPUT_STRUCT: Var[] = [
|
||||
variable: 'usage',
|
||||
type: VarType.object,
|
||||
},
|
||||
{
|
||||
variable: 'generation',
|
||||
type: VarType.object,
|
||||
},
|
||||
]
|
||||
|
||||
export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [
|
||||
|
||||
@ -320,6 +320,28 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
||||
)}
|
||||
>
|
||||
<>
|
||||
<VarItem
|
||||
name="generation"
|
||||
type="object"
|
||||
description={t(`${i18nPrefix}.outputVars.generation`, { ns: 'workflow' })}
|
||||
subItems={[
|
||||
{
|
||||
name: 'content',
|
||||
type: 'string',
|
||||
description: '',
|
||||
},
|
||||
{
|
||||
name: 'reasoning_content',
|
||||
type: 'array[string]',
|
||||
description: '',
|
||||
},
|
||||
{
|
||||
name: 'tool_calls',
|
||||
type: 'array[object]',
|
||||
description: '',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<VarItem
|
||||
name="text"
|
||||
type="string"
|
||||
@ -335,11 +357,6 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
||||
type="object"
|
||||
description={t(`${i18nPrefix}.outputVars.usage`, { ns: 'workflow' })}
|
||||
/>
|
||||
<VarItem
|
||||
name="generation"
|
||||
type="object"
|
||||
description={t(`${i18nPrefix}.outputVars.generation`, { ns: 'workflow' })}
|
||||
/>
|
||||
{inputs.structured_output_enabled && (
|
||||
<>
|
||||
<Split className="mt-3" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user