SearchAgent

class SearchAgent(ChatAgent):
An agent that summarizes text based on a query and evaluates the relevance of an answer. Parameters:
  • model (BaseModelBackend, optional): The model backend to use for generating responses. (default: :obj:OpenAIModel with GPT_4O_MINI)

init

def __init__(self, model: Optional[BaseModelBackend] = None):

summarize_text

def summarize_text(self, text: str, query: str):
Summarize the information from the text, base on the query. Parameters:
  • text (str): Text to summarize.
  • query (str): What information you want.
Returns: str: Strings with information.
def continue_search(self, query: str, answer: str):
Ask whether to continue search or not based on the provided answer. Parameters:
  • query (str): The question.
  • answer (str): The answer to the question.
Returns: bool: True if the user want to continue search, False otherwise.