Skip to content

Commit f2079cc

Browse files
authored
Merge pull request #2751 from ModelEngine-Group/xyc/clean-logs
♻️ Clean unnecessary skill logs
2 parents 5cd16b8 + 4a45ea2 commit f2079cc

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

backend/agents/create_agent_info.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,6 @@ async def create_agent_config(
297297
}
298298
system_prompt = Template(prompt_template["system_prompt"], undefined=StrictUndefined).render(render_kwargs)
299299

300-
_print_prompt_with_token_count(system_prompt, agent_id, "BEFORE_INJECTION")
301-
302300
if agent_info.get("model_id") is not None:
303301
model_info = get_model_by_model_id(agent_info.get("model_id"))
304302
model_name = model_info["display_name"] if model_info is not None else "main_model"
@@ -452,25 +450,9 @@ async def prepare_prompt_templates(
452450
prompt_templates = get_agent_prompt_template(is_manager, language)
453451
prompt_templates["system_prompt"] = system_prompt
454452

455-
# Print final prompt with all injections
456-
_print_prompt_with_token_count(prompt_templates["system_prompt"], agent_id, "FINAL_PROMPT")
457-
458453
return prompt_templates
459454

460455

461-
def _print_prompt_with_token_count(prompt: str, agent_id: int = None, stage: str = "PROMPT"):
462-
"""Print prompt content and estimate token count using tiktoken."""
463-
try:
464-
import tiktoken
465-
encoding = tiktoken.get_encoding("cl100k_base")
466-
token_count = len(encoding.encode(prompt))
467-
logger.info(f"[Skill Debug][{stage}] Agent {agent_id} token count: {token_count}")
468-
logger.info(f"[Skill Debug][{stage}] Agent {agent_id} prompt:\n{prompt}")
469-
except Exception as e:
470-
logger.warning(f"[Skill Debug][{stage}] Failed to count tokens: {e}")
471-
logger.info(f"[Skill Debug][{stage}] Agent {agent_id} prompt:\n{prompt}")
472-
473-
474456
async def join_minio_file_description_to_query(minio_files, query):
475457
final_query = query
476458
if minio_files and isinstance(minio_files, list):

backend/utils/prompt_template_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ def get_prompt_template(template_type: str, language: str = LANGUAGE["ZH"], **kw
2626
Returns:
2727
dict: Loaded prompt template
2828
"""
29-
logger.info(
30-
f"Getting prompt template for type: {template_type}, language: {language}, kwargs: {kwargs}")
3129

3230
# Define template path mapping
3331
template_paths = {

sdk/nexent/core/utils/prompt_template_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ def get_prompt_template(template_type: str, language: str = LANGUAGE["ZH"], **kw
3737
Returns:
3838
dict: Loaded prompt template
3939
"""
40-
logger.info(
41-
f"Getting prompt template for type: {template_type}, language: {language}, kwargs: {kwargs}")
4240

4341
if template_type not in template_paths:
4442
raise ValueError(f"Unsupported template type: {template_type}")

0 commit comments

Comments
 (0)