Skip to content

Commit

Permalink
Update Cache Documentation (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenConstable9 authored Dec 17, 2024
1 parent 1890062 commit 0e11c29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"metadata": {},
"outputs": [],
"source": [
"agentic_text_2_sql = AutoGenText2Sql(engine_specific_rules=\"\", use_case=\"Analysing sales data across suppliers\")"
"agentic_text_2_sql = AutoGenText2Sql(engine_specific_rules=\"\", use_case=\"Analysing sales data\")"
]
},
{
Expand Down
9 changes: 9 additions & 0 deletions text_2_sql/autogen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ The vector based with query cache uses the `fetch_queries_from_cache()` method t

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.

The cache entires are rendered with Jinja templates before they are run. The following placesholders are prepopulated automatically:

- date
- datetime
- time
- unix_timestamp

Additional parameters passed at runtime, such as a user_id, are populated automatically if included in the request.

#### run_sql_query()

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.
Expand Down

0 comments on commit 0e11c29

Please sign in to comment.