Spaces:
Paused
Paused
Update src/prompts.py
Browse files- src/prompts.py +0 -14
src/prompts.py
CHANGED
|
@@ -569,19 +569,6 @@ def build_query_understanding_prompt(
|
|
| 569 |
Returns:
|
| 570 |
Formatted query understanding prompt string.
|
| 571 |
"""
|
| 572 |
-
if history:
|
| 573 |
-
history_lines = []
|
| 574 |
-
for msg in history:
|
| 575 |
-
role = msg.get("role", "user").capitalize()
|
| 576 |
-
content = msg.get("content", "")
|
| 577 |
-
# Truncate long assistant responses to save tokens
|
| 578 |
-
if role == "Assistant" and len(content) > 200:
|
| 579 |
-
content = content[:200] + "..."
|
| 580 |
-
history_lines.append(f"{role}: {content}")
|
| 581 |
-
history_str = "\n".join(history_lines)
|
| 582 |
-
else:
|
| 583 |
-
history_str = "(No prior conversation)"
|
| 584 |
-
|
| 585 |
if sql_schema_summary:
|
| 586 |
sql_routing_block = _SQL_ROUTING_INSTRUCTIONS.format(
|
| 587 |
schema_text=sql_schema_summary
|
|
@@ -600,7 +587,6 @@ def build_query_understanding_prompt(
|
|
| 600 |
|
| 601 |
return QUERY_UNDERSTANDING_PROMPT_TEMPLATE.format(
|
| 602 |
domain=domain,
|
| 603 |
-
history=history_str,
|
| 604 |
query=query,
|
| 605 |
sql_routing_block=sql_routing_block,
|
| 606 |
kb_overview_block=kb_overview_block,
|
|
|
|
| 569 |
Returns:
|
| 570 |
Formatted query understanding prompt string.
|
| 571 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 572 |
if sql_schema_summary:
|
| 573 |
sql_routing_block = _SQL_ROUTING_INSTRUCTIONS.format(
|
| 574 |
schema_text=sql_schema_summary
|
|
|
|
| 587 |
|
| 588 |
return QUERY_UNDERSTANDING_PROMPT_TEMPLATE.format(
|
| 589 |
domain=domain,
|
|
|
|
| 590 |
query=query,
|
| 591 |
sql_routing_block=sql_routing_block,
|
| 592 |
kb_overview_block=kb_overview_block,
|