本文使用Dify v1.4.0版本,主要对LLMNode
类的方法,以及方法执行流程进行了总结。

一.LLMNode类的方法总结
|
|
|
|
---|---|---|---|
__init__ |
|
|
|
_run |
|
|
|
_invoke_llm |
|
|
|
_handle_invoke_result |
|
|
|
_image_file_to_markdown |
|
|
|
_transform_chat_messages |
|
|
|
_fetch_jinja_inputs |
|
|
|
_fetch_inputs |
|
|
|
_fetch_files |
|
|
|
_fetch_context |
|
|
|
_convert_to_original_retriever_resource |
|
|
|
_fetch_model_config |
|
|
|
_fetch_memory |
|
|
|
_fetch_prompt_messages |
|
|
|
_parse_structured_output |
|
|
|
deduct_llm_quota |
|
|
|
_extract_variable_selector_to_variable_mapping |
|
|
|
get_default_config |
|
|
|
_handle_list_messages |
|
|
|
_handle_blocking_result |
|
|
|
_save_multimodal_image_output |
|
|
|
_handle_native_json_schema |
|
|
|
_handle_prompt_based_schema |
|
|
|
_set_response_format |
|
|
|
_prepare_schema_for_model |
|
|
|
_fetch_model_schema |
|
|
|
_fetch_structured_output_schema |
|
|
|
_check_model_structured_output_support |
|
|
|
_save_multimodal_output_and_convert_result_to_markdown |
|
|
|
二.LLMNode类的方法的执行流程
|
|
---|---|
__init__ |
|
_run |
|
_invoke_llm |
|
_handle_invoke_result |
|
_image_file_to_markdown |
|
_transform_chat_messages |
|
_fetch_jinja_inputs |
|
_fetch_inputs |
|
_fetch_files |
|
_fetch_context |
|
_convert_to_original_retriever_resource |
|
_fetch_model_config |
|
_fetch_memory |
|
_fetch_prompt_messages |
|
_parse_structured_output |
|
_handle_blocking_result |
|
_save_multimodal_image_output |
|
_handle_native_json_schema |
|
_handle_prompt_based_schema |
|
_set_response_format |
|
_prepare_schema_for_model |
|
_fetch_model_schema |
|
_fetch_structured_output_schema |
|
_check_model_structured_output_support |
|
_save_multimodal_output_and_convert_result_to_markdown |
|
_handle_list_messages |
|
deduct_llm_quota |
|
_extract_variable_selector_to_variable_mapping |
|
get_default_config |
|
参考文献
[1] Dify工作流中的LLM节点总结:https://z0yrmerhgi8.feishu.cn/wiki/BZiowAjCXi4ahPkwmtocqzn8nqO
[2] LLMNode类:https://github.com/langgenius/dify/blob/1.4.0/api/core/workflow/nodes/llm/node.py
知识星球服务内容:Dify源码剖析及答疑,Dify对话系统源码,NLP电子书籍报告下载,公众号所有付费资料。加微信buxingtianxia21进NLP工程化资料群。
(文:NLP工程化)