Refactor system prompt variables for clarity and consistency across agent setup and runner modules

This commit is contained in:
Roberto Musso
2026-04-07 00:23:41 +02:00
parent 1ce1d492b0
commit aa8bcbf0d8
3 changed files with 17 additions and 17 deletions

View File

@@ -102,7 +102,7 @@ _DOMAIN_DESCRIPTIONS: dict[str, str] = {
),
}
_STEP1_SYSTEM_PROMPT = """\
_BATCH_FILE_CLASSIFIER_PROMPT = """\
You are a file classifier for a freelance project management tool.
Your job is to match a file to an existing project and identify which data domains to extract.
@@ -133,7 +133,7 @@ Respond ONLY with a JSON object — no markdown, no explanation:
# ── Step 2: Processing prompt ─────────────────────────────────────────────
_PROCESSING_SYSTEM_PROMPT = """\
_BATCH_PROCESSING_PROMPT = """\
You are a data extraction assistant for a freelance project management tool.
Your task: extract structured data from the file content and persist it using the available tools.
@@ -162,7 +162,7 @@ Domains to extract: {data_types}
# ── Cloud processing prompt (kept separate for cloud agent) ───────────────
_CLOUD_PROCESSING_PROMPT = """\
_BATCH_CLOUD_PROCESSING_PROMPT = """\
You are a data extraction and management assistant for a freelance project
management tool.
@@ -560,7 +560,7 @@ async def _classify_file(
)
step1_template, step1_prompt_obj = get_prompt_or_fallback(
"batch_file_classifier", _STEP1_SYSTEM_PROMPT
"batch_file_classifier", _BATCH_FILE_CLASSIFIER_PROMPT
)
system = step1_template.format(
domain_definitions=domain_definitions,
@@ -774,7 +774,7 @@ async def run_local_agent(
existing_context = "\n\n".join(existing_blocks)
step2_template, step2_prompt_obj = get_prompt_or_fallback(
"batch_processing", _PROCESSING_SYSTEM_PROMPT
"batch_processing", _BATCH_PROCESSING_PROMPT
)
system_prompt = step2_template.format(
existing_context=existing_context,
@@ -995,7 +995,7 @@ async def run_cloud_agent(
items_processed += 1
cloud_template, cloud_prompt_obj = get_prompt_or_fallback(
"batch_cloud_processing", _CLOUD_PROCESSING_PROMPT
"batch_cloud_processing", _BATCH_CLOUD_PROCESSING_PROMPT
)
processing_prompt = cloud_template.format(
data_types=", ".join(config.data_types),