chore: standardize output of `LLMNode` based nodes to return `usage` and `finish_reason` in `output` instead of `process_data`

pull/21766/head
Davide Delbianco 11 months ago
parent 826bf25abf
commit efc8888372
No known key found for this signature in database
GPG Key ID: 3C00412F2A31305E

@ -140,12 +140,10 @@ class QuestionClassifierNode(LLMNode):
"prompts": PromptMessageUtil.prompt_messages_to_prompt_for_saving( "prompts": PromptMessageUtil.prompt_messages_to_prompt_for_saving(
model_mode=model_config.mode, prompt_messages=prompt_messages model_mode=model_config.mode, prompt_messages=prompt_messages
), ),
"usage": jsonable_encoder(usage),
"finish_reason": finish_reason,
"model_provider": model_config.provider, "model_provider": model_config.provider,
"model_name": model_config.model, "model_name": model_config.model,
} }
outputs = {"class_name": category_name, "class_id": category_id} outputs = {"class_name": category_name, "class_id": category_id, "usage": jsonable_encoder(usage), "finish_reason": finish_reason}
return NodeRunResult( return NodeRunResult(
status=WorkflowNodeExecutionStatus.SUCCEEDED, status=WorkflowNodeExecutionStatus.SUCCEEDED,

Loading…
Cancel
Save