ViewSelector Base Class#
View selectors are responsible for choosing the most relevant View for the given user query.
flowchart LR
Q[Do we have any Data Scientists?]
Views["`Employees View
ProjectsView
BenefitsView`"]
VS[ViewSelector]
Q --> VS
Views --> VS
VS --> S[EmployeesView]
dbally.view_selection.base.ViewSelector
#
Bases: ABC
Base class for view selectors.
select_view
abstractmethod
async
#
select_view(question: str, views: Dict[str, str], event_tracker: EventTracker, llm_options: Optional[LLMOptions] = None) -> str
Based on user question and list of available views select the most relevant one.
PARAMETER | DESCRIPTION |
---|---|
question |
user question asked in the natural language e.g "Do we have any data scientists?"
TYPE:
|
views |
dictionary of available view names with corresponding descriptions.
TYPE:
|
event_tracker |
event tracker used to audit the selection process.
TYPE:
|
llm_options |
options to use for the LLM client.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
The most relevant view name. |