Module core.navigation
Functions
Classes
-
Helper class that provides a standard way to create an ABC using inheritance.
Ancestors
- lavague.core.base_engine.BaseEngine
- abc.ABC
- lavague.core.logger.Loggable
- lavague.core.display.Display
Class variables
Methods
-
NavigationEngine leverages the llm model and the to output code from the prompt and the html page.
Args
- driver (
BaseDriver): - The Web driver used to interact with the headless browser
- llm (
BaseLLM) - llama-index LLM that will generate the action
- retriever (
BaseHtmlRetriever) - Specify which algorithm will be used for RAG
- prompt_template (
PromptTemplate) - Squelette of the final prompt
- extractor (
BaseExtractor) - Specify how to extract the final code from the llm answer
- time_between_actions (
float) - Time between each action
logger- (
AgentLogger) Logger to log the actions taken by the agent
Ancestors
- lavague.core.base_engine.BaseEngine
- abc.ABC
- lavague.core.logger.Loggable
- lavague.core.display.Display
Static methods
-
Create an NavigationEngine from a context
Methods
-
Generates code and executes it to answer the instruction
Args
instruction (
str): The instruction to performReturn
bool: True if the code was executed without errorAny: The output of navigation is always None -
Generates code and executes it to answer the instruction
Args
instruction (
str): The instruction to performReturn
bool: True if the code was executed without errorAny: The output of navigation is always None -
Generate the code from a query
Args
query (
str): Instructions given at the end of the prompt to tell the model what to do on the html pageReturn
str: The generated code -
Generate the code from a query and a context
-
Get the nodes from the html page
Args
query (
str): The query to search forReturn
List[str]: The nodes
- driver (
-
Methods
-
Rephrase the query
Args
instruction (
str): The instruction to rephrase for the retrieverReturn
str: The rephrased query
-