You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/api_tool_indexer/constants.py
+18-4Lines changed: 18 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,9 @@ class ApiToolIndexerConstants:
31
31
REQUEST_TIMEOUT=60# seconds
32
32
33
33
# Context Enrichment Template
34
-
# Used to generate a rich semantic context for each endpoint before embedding
34
+
# Mirrors the service workflow (intent_data_enrichment/constants.py).
35
+
# Full template goes in chunk_prompt; document_prompt is left empty.
36
+
# The LLM summarises the chunk content into a rich semantic context.
35
37
CONTEXT_TEMPLATE="""<document>
36
38
{full_endpoint_info}
37
39
</document>
@@ -44,12 +46,24 @@ class ApiToolIndexerConstants:
44
46
</endpoint>
45
47
46
48
Please generate a rich, detailed context that describes this API endpoint comprehensively for semantic search.
47
-
Include information about:
49
+
Keep the prose context general and country-agnostic. Include information about:
48
50
- What the user wants to accomplish by calling this endpoint
49
51
- Key terms and synonyms for this action
50
52
- Related concepts and use cases
51
53
- Common ways users might ask for this functionality in natural language
52
54
53
-
IMPORTANT: Generate the context in the SAME LANGUAGE as the endpoint description above. If the description is in Estonian, respond in Estonian. If in English, respond in English. If in Russian, respond in Russian.
55
+
Then, on a new line, add a section exactly as shown below with 6 to 8 realistic and diverse example questions a real user might ask when they need this endpoint. Cover different phrasings, synonyms, and indirect ways of asking — do not just repeat the description verbatim.
54
56
55
-
Answer only with the enriched context and nothing else."""
57
+
IMPORTANT for example queries: This is a system built for Estonian government digital services (Bürokratt). Ground the examples in an Estonian context — use Estonian cities (Tallinn, Tartu, Pärnu, Narva), Estonian institutions, and Estonia-relevant scenarios. Only use non-Estonian locations if the endpoint is explicitly about comparing or fetching data for multiple countries.
58
+
59
+
Example queries:
60
+
- <example question 1>
61
+
- <example question 2>
62
+
- <example question 3>
63
+
- <example question 4>
64
+
- <example question 5>
65
+
- <example question 6>
66
+
67
+
IMPORTANT: Generate everything in the SAME LANGUAGE as the endpoint description above. If the description is in Estonian, respond in Estonian. If in English, respond in English. If in Russian, respond in Russian.
68
+
69
+
Answer only with the enriched context and example queries — nothing else."""
0 commit comments