Skip to content

Commit 66ef58d

Browse files
committed
type(data profile): add llm_call_manager for each mode
1 parent 7d172e4 commit 66ef58d

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

alias/src/alias/agent/agents/data_source/_data_profiler_factory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def generate_profile(self) -> Dict[str, Any]:
9797
self.data,
9898
)
9999
# content = self.prompt.format(data=self.data)
100-
res = await self._call_model(content)
100+
res = await self._generate_profile_by_llm(content)
101101
self.profile = self._wrap_data_response(res)
102102
except Exception as e:
103103
logger.warning(f"Error generating profile: {e}")
@@ -157,7 +157,7 @@ async def _read_data(self):
157157
Processed data in appropriate format for the data type
158158
"""
159159

160-
async def _call_model(
160+
async def _generate_profile_by_llm(
161161
self,
162162
content: Any,
163163
) -> Dict[str, Any]:
@@ -349,7 +349,7 @@ async def _extract_irregular_table(
349349
"""
350350
prompt = self._load_prompt("IRREGULAR")
351351
content = prompt.format(raw_snippet_data=raw_data_snippet)
352-
res = await self._call_model(content=content)
352+
res = await self._generate_profile_by_llm(content=content)
353353

354354
if "is_extractable_table" in res and res["is_extractable_table"]:
355355
logger.debug(res["reasoning"])

alias/src/alias/agent/run.py

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,18 @@ async def arun_deepresearch_agent(
248248
"run_shell_command",
249249
]
250250
share_tools(global_toolkit, worker_toolkit, test_tool_list)
251-
await prepare_data_sources(session_service, sandbox, worker_toolkit)
251+
252+
llm_call_manager = LLMCallManager(
253+
base_model_name=MODEL_CONFIG_NAME,
254+
vl_model_name=VL_MODEL_NAME,
255+
model_formatter_mapping=MODEL_FORMATTER_MAPPING,
256+
)
257+
await prepare_data_sources(
258+
session_service,
259+
sandbox,
260+
worker_toolkit,
261+
llm_call_manager,
262+
)
252263

253264
worker_agent = DeepResearchAgent(
254265
name="Deep_Research_Agent",
@@ -315,7 +326,18 @@ async def arun_finance_agent(
315326
description="Finance Analysis tools",
316327
active=True,
317328
)
318-
await prepare_data_sources(session_service, sandbox, worker_toolkit)
329+
330+
llm_call_manager = LLMCallManager(
331+
base_model_name=MODEL_CONFIG_NAME,
332+
vl_model_name=VL_MODEL_NAME,
333+
model_formatter_mapping=MODEL_FORMATTER_MAPPING,
334+
)
335+
await prepare_data_sources(
336+
session_service,
337+
sandbox,
338+
worker_toolkit,
339+
llm_call_manager,
340+
)
319341

320342
worker_agent = DeepResearchAgent(
321343
name="Deep_Research_Agent",
@@ -425,7 +447,17 @@ async def arun_browseruse_agent(
425447
add_all=True,
426448
is_browser_toolkit=True,
427449
)
428-
await prepare_data_sources(session_service, sandbox, browser_toolkit)
450+
llm_call_manager = LLMCallManager(
451+
base_model_name=MODEL_CONFIG_NAME,
452+
vl_model_name=VL_MODEL_NAME,
453+
model_formatter_mapping=MODEL_FORMATTER_MAPPING,
454+
)
455+
await prepare_data_sources(
456+
session_service,
457+
sandbox,
458+
browser_toolkit,
459+
llm_call_manager,
460+
)
429461

430462
logger.info("Init browser toolkit")
431463
try:

0 commit comments

Comments
 (0)