Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add result ranking prompt for NLDataframeRetriever
This commit adds a new result ranking prompt to the NLDataframeRetriever class. The prompt allows users to provide a schema and query, and asks them to rate the relevance of the schema in modeling the domain of the query. The relevance must be a number between 0 and 1, where 1 indicates high relevance and 0 indicates low relevance. The significant changes include: - Added DEFAULT_RESULT_RANKING_TMPL constant for the result ranking template - Added DEFAULT_RESULT_RANKING_PROMPTROMPT constant for the result ranking prompt template - Updated NLDataframeRetriever constructor to accept a result_ranking_prompt parameter - Initialized self._result_ranking_prompt with either the provided parameter or the default prompt template - Modified NLDataframeRetriever.complete() method to use self._result_ranking_prompt as part of the LLM completion request These changes allow users of NLDataframeRetriever to easily rank the relevance of schemas in modeling their queries, providing more accurate results.
- Loading branch information