|
9 | 9 | from nexent.core.agents.agent_model import AgentRunInfo, ModelConfig, AgentConfig, ToolConfig |
10 | 10 | from nexent.memory.memory_service import search_memory_in_levels |
11 | 11 |
|
| 12 | +from services.file_management_service import get_llm_model |
12 | 13 | from services.vectordatabase_service import ( |
13 | 14 | ElasticSearchService, |
14 | 15 | get_vector_db_core, |
|
25 | 26 | from utils.model_name_utils import add_repo_to_name |
26 | 27 | from utils.prompt_template_utils import get_agent_prompt_template |
27 | 28 | from utils.config_utils import tenant_config_manager, get_model_name_from_config |
28 | | -from consts.const import LOCAL_MCP_SERVER, MODEL_CONFIG_MAPPING, LANGUAGE |
| 29 | +from consts.const import LOCAL_MCP_SERVER, MODEL_CONFIG_MAPPING, LANGUAGE, DATA_PROCESS_SERVICE |
29 | 30 |
|
30 | 31 | logger = logging.getLogger("create_agent_info") |
31 | 32 | logger.setLevel(logging.DEBUG) |
@@ -243,6 +244,12 @@ async def create_tool_config_list(agent_id, tenant_id, user_id): |
243 | 244 | "vlm_model": get_vlm_model(tenant_id=tenant_id), |
244 | 245 | "storage_client": minio_client, |
245 | 246 | } |
| 247 | + elif tool_config.class_name == "AnalyzeTextFileTool": |
| 248 | + tool_config.metadata = { |
| 249 | + "llm_model": get_llm_model(tenant_id=tenant_id), |
| 250 | + "storage_client": minio_client, |
| 251 | + "data_process_service_url": DATA_PROCESS_SERVICE |
| 252 | + } |
246 | 253 |
|
247 | 254 | tool_config_list.append(tool_config) |
248 | 255 |
|
@@ -307,8 +314,8 @@ async def join_minio_file_description_to_query(minio_files, query): |
307 | 314 | if minio_files and isinstance(minio_files, list): |
308 | 315 | file_descriptions = [] |
309 | 316 | for file in minio_files: |
310 | | - if isinstance(file, dict) and "description" in file and file["description"]: |
311 | | - file_descriptions.append(file["description"]) |
| 317 | + if isinstance(file, dict) and "url" in file and file["url"] and "name" in file and file["name"]: |
| 318 | + file_descriptions.append("File S3 URL: " + "s3:/" + file["url"] + ", file name:" + file["name"]) |
312 | 319 |
|
313 | 320 | if file_descriptions: |
314 | 321 | final_query = "User provided some reference files:\n" |
|
0 commit comments