mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
feat: question classify output
This commit is contained in:
@ -185,69 +185,70 @@ export const SUPPORT_OUTPUT_VARS_NODE = [
|
||||
BlockEnum.QuestionClassifier, BlockEnum.HttpRequest, BlockEnum.Tool, BlockEnum.VariableAssigner,
|
||||
]
|
||||
|
||||
const USAGE = {
|
||||
variable: 'usage',
|
||||
type: VarType.object,
|
||||
children: [
|
||||
{
|
||||
variable: 'prompt_tokens',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'prompt_unit_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'prompt_price_unit',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'prompt_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_tokens',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_unit_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_price_unit',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_unit_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'total_tokens',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'total_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'currency',
|
||||
type: VarType.string,
|
||||
},
|
||||
{
|
||||
variable: 'latency',
|
||||
type: VarType.number,
|
||||
},
|
||||
],
|
||||
}
|
||||
export const LLM_OUTPUT_STRUCT: Var[] = [
|
||||
{
|
||||
variable: 'text',
|
||||
type: VarType.string,
|
||||
},
|
||||
{
|
||||
variable: 'usage',
|
||||
type: VarType.object,
|
||||
children: [
|
||||
{
|
||||
variable: 'prompt_tokens',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'prompt_unit_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'prompt_price_unit',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'prompt_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_tokens',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_unit_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_price_unit',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_unit_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'completion_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'total_tokens',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'total_price',
|
||||
type: VarType.number,
|
||||
},
|
||||
{
|
||||
variable: 'currency',
|
||||
type: VarType.string,
|
||||
},
|
||||
{
|
||||
variable: 'latency',
|
||||
type: VarType.number,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [
|
||||
@ -255,6 +256,7 @@ export const KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT: Var[] = [
|
||||
variable: 'result',
|
||||
type: VarType.arrayObject,
|
||||
},
|
||||
USAGE,
|
||||
]
|
||||
|
||||
export const TEMPLATE_TRANSFORM_OUTPUT_STRUCT: Var[] = [
|
||||
@ -263,3 +265,35 @@ export const TEMPLATE_TRANSFORM_OUTPUT_STRUCT: Var[] = [
|
||||
type: VarType.string,
|
||||
},
|
||||
]
|
||||
|
||||
const QUESTION_CLASSIFIER_OUTPUT_STRUCT_COMMON: Var[] = [
|
||||
USAGE,
|
||||
{
|
||||
variable: 'topic',
|
||||
type: VarType.string,
|
||||
},
|
||||
]
|
||||
|
||||
export const CHAT_QUESTION_CLASSIFIER_OUTPUT_STRUCT = [
|
||||
{
|
||||
variable: 'model_mode',
|
||||
type: VarType.string,
|
||||
},
|
||||
{
|
||||
variable: 'messages',
|
||||
type: VarType.arrayObject,
|
||||
},
|
||||
...QUESTION_CLASSIFIER_OUTPUT_STRUCT_COMMON,
|
||||
]
|
||||
|
||||
export const COMPLETION_QUESTION_CLASSIFIER_OUTPUT_STRUCT = [
|
||||
{
|
||||
variable: 'model_mode',
|
||||
type: VarType.string,
|
||||
},
|
||||
{
|
||||
variable: 'text',
|
||||
type: VarType.string,
|
||||
},
|
||||
...QUESTION_CLASSIFIER_OUTPUT_STRUCT_COMMON,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user