|
12 | 12 | import time |
13 | 13 | from functools import reduce |
14 | 14 | from imghdr import what |
15 | | -from typing import List, Dict |
| 15 | +from typing import Dict, List |
16 | 16 |
|
17 | | -from django.db.models import QuerySet |
18 | | -from django.utils.translation import gettext as _ |
19 | | -from langchain_core.messages import BaseMessage, AIMessage, HumanMessage, SystemMessage |
20 | | - |
21 | | -from application.flow.common import WorkflowMode |
22 | | -from application.flow.i_step_node import NodeResult, INode |
23 | | -from application.flow.step_node.ai_chat_step_node.i_chat_node import IChatNode |
24 | | -from application.flow.tools import Reasoning, mcp_response_generator, get_tools |
25 | | -from application.models import Application, ApplicationApiKey, ApplicationAccessToken |
26 | 17 | from common.exception.app_exception import AppApiException |
| 18 | +from common.utils.logger import maxkb_logger |
27 | 19 | from common.utils.rsa_util import rsa_long_decrypt |
28 | 20 | from common.utils.shared_resource_auth import filter_authorized_ids |
29 | 21 | from common.utils.tool_code import ToolExecutor |
30 | | -from common.utils.logger import maxkb_logger |
| 22 | +from django.db.models import QuerySet |
| 23 | +from django.utils.translation import gettext as _ |
| 24 | +from knowledge.models import File |
| 25 | +from langchain_core.messages import AIMessage, BaseMessage, HumanMessage, SystemMessage |
31 | 26 | from models_provider.models import Model |
32 | 27 | from models_provider.tools import get_model_credential, get_model_instance_by_model_workspace_id |
33 | 28 | from tools.models import Tool, ToolType |
34 | 29 |
|
| 30 | +from application.flow.common import WorkflowMode |
| 31 | +from application.flow.i_step_node import INode, NodeResult |
| 32 | +from application.flow.step_node.ai_chat_step_node.i_chat_node import IChatNode |
| 33 | +from application.flow.tools import Reasoning, get_tools, mcp_response_generator |
| 34 | +from application.models import Application, ApplicationAccessToken, ApplicationApiKey |
| 35 | + |
35 | 36 |
|
36 | 37 | def _write_context(node_variable: Dict, workflow_variable: Dict, node: INode, workflow, answer: str, |
37 | 38 | reasoning_content: str): |
|
0 commit comments