Skip to content

Commit 18f5d28

Browse files
fix: remove LIMIT 100 example and unused example_queries from v1 prompt
Remove the explicit LIMIT 100 example from the LIMIT RULES section to prevent agents from hallucinating that specific value. Remove the {example_queries} template variable from the v1 prompt and the example_queries field from SqlPromptContext since it is no longer referenced by any template. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ee97d83 commit 18f5d28

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

src/uipath_langchain/agent/tools/datafabric_tool/prompts/context.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,3 @@ class SqlPromptContext(BaseModel):
4949
),
5050
)
5151

52-
# ── Example queries (customer-provided or auto-generated) ─────────
53-
example_queries: str = Field(
54-
default="",
55-
description=(
56-
"SQL example patterns for the entities. Sourced from customer "
57-
"configuration or auto-generated from entity schema as a fallback."
58-
),
59-
)

src/uipath_langchain/agent/tools/datafabric_tool/prompts/v1.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@
9696
- NEVER do: GROUP BY + MIN()/MAX() when the question asks for a single \
9797
extreme row.
9898
9. LIMIT RULES — Add LIMIT only when needed:
99-
- Queries without WHERE that could return many rows MUST have a LIMIT \
100-
(e.g. LIMIT 100).
99+
- Queries without WHERE that could return many rows MUST have a LIMIT.
101100
- Do NOT add LIMIT to queries that already naturally return a bounded \
102101
set: an equality filter on a unique key, an aggregation that returns one row, \
103102
or a question asking for "all X meeting Y".
@@ -159,4 +158,4 @@
159158
natural-language answer that directly addresses the user's question, \
160159
referencing the values from the result. Do not invent or summarise data \
161160
beyond what the query returned.
162-
{domain_guidance}{example_queries}"""
161+
{domain_guidance}"""

0 commit comments

Comments
 (0)