motleycrew.applications.research_agent.question_generator
Functions
Classes
|
Gets a question as input Retrieves relevant docs (llama index basic RAG) (Retrieves existing questions from graph (to avoid overlap)) Generates extra questions (research agent prompt) |
|
Input for the Question Generator Tool. |
- class motleycrew.applications.research_agent.question_generator.QuestionGeneratorTool(query_tool: MotleyTool, graph: MotleyGraphStore, max_questions: int = 3, llm: BaseLanguageModel | None = None, prompt: str | BasePromptTemplate = None)
Bases:
MotleyToolGets a question as input Retrieves relevant docs (llama index basic RAG) (Retrieves existing questions from graph (to avoid overlap)) Generates extra questions (research agent prompt)
Adds questions as children of current q by calling Q insertion tool once exits
- __init__(query_tool: MotleyTool, graph: MotleyGraphStore, max_questions: int = 3, llm: BaseLanguageModel | None = None, 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_generator.QuestionGeneratorToolInput(*, question: Question)
Bases:
BaseModelInput for the Question Generator Tool.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- motleycrew.applications.research_agent.question_generator.create_question_generator_langchain_tool(query_tool: MotleyTool, graph: MotleyGraphStore, max_questions: int = 3, llm: BaseLanguageModel | None = None, prompt: str | BasePromptTemplate = None)