Skip to content

Commit 0e11c29

Browse files
Update Cache Documentation (#107)
1 parent 1890062 commit 0e11c29

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

text_2_sql/autogen/Iteration 5 - Agentic Vector Based Text2SQL.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"metadata": {},
8686
"outputs": [],
8787
"source": [
88-
"agentic_text_2_sql = AutoGenText2Sql(engine_specific_rules=\"\", use_case=\"Analysing sales data across suppliers\")"
88+
"agentic_text_2_sql = AutoGenText2Sql(engine_specific_rules=\"\", use_case=\"Analysing sales data\")"
8989
]
9090
},
9191
{

text_2_sql/autogen/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ The vector based with query cache uses the `fetch_queries_from_cache()` method t
7878

7979
If the score of the top result is higher than the defined threshold, the query will be executed against the target data source and the results included in the prompt. This allows us to prompt the LLM to evaluated whether it can use these results to answer the question, **without further SQL Query generation** to speed up the process.
8080

81+
The cache entires are rendered with Jinja templates before they are run. The following placesholders are prepopulated automatically:
82+
83+
- date
84+
- datetime
85+
- time
86+
- unix_timestamp
87+
88+
Additional parameters passed at runtime, such as a user_id, are populated automatically if included in the request.
89+
8190
#### run_sql_query()
8291

8392
This method is called by the AutoGen framework automatically, when instructed to do so by the LLM, to run a SQL query against the given database. It returns a JSON string containing a row wise dump of the results returned. These results are then interpreted to answer the question.

0 commit comments

Comments
 (0)