motleycrew.applications.research_agent.question_prioritizer

Functions

create_question_prioritizer_langchain_tool([...])

Classes

QuestionPrioritizerInput(*, ...)

Input for the QuestionPrioritizerTool.

QuestionPrioritizerTool([prompt])

Tool to prioritize subquestions based on the original question.

class motleycrew.applications.research_agent.question_prioritizer.QuestionPrioritizerTool(prompt: str | BasePromptTemplate = None)

Bases: MotleyTool

Tool to prioritize subquestions based on the original question.

__init__(prompt: str | BasePromptTemplate = None)

Initialize the MotleyTool.

Parameters:
  • name – Name of the tool (required if tool is None).

  • description – Description of the tool (required if tool is None).

  • args_schema – Schema of the tool arguments (required if tool is None).

  • tool – Langchain BaseTool to wrap.

  • return_direct – If True, the tool’s output will be returned directly to the user.

  • exceptions_to_reflect – List of exceptions to reflect back to the agent.

  • retry_config – Configuration for retry behavior. If None, exceptions will not be retried.

class motleycrew.applications.research_agent.question_prioritizer.QuestionPrioritizerInput(*, original_question: Question, unanswered_questions: list[Question])

Bases: BaseModel

Input for the QuestionPrioritizerTool.

original_question: Question
unanswered_questions: list[Question]
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'original_question': FieldInfo(annotation=Question, required=True, description='The original question.'), 'unanswered_questions': FieldInfo(annotation=list[Question], required=True, description='Questions to pick the most pertinent to the original question from.')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

motleycrew.applications.research_agent.question_prioritizer.create_question_prioritizer_langchain_tool(prompt: str | BasePromptTemplate = None) StructuredTool