Find answers from the community

歐東
Offline, last seen 3 months ago
Joined September 25, 2024
@kapa.ai

I'm currently developing a complex RAG Pipeline.
This pipeline needs to answer all user inquiries about a specific topic.

I currently have the following tools:

Plain Text
get_trim_list = FunctionTool.from_defaults(
    fn=trim_list_for_specific_model,
    name="trim_list_for_specific_model",
    description="This tool returns a trim list for a specified model. You can use it to ensure the trim that user asks for is valid. And use the trim name to do further processing.",
)

# Tool mainly used to query specific specifications
specific_trim_specs_tool = FunctionTool.from_defaults(
    fn=get_specific_trim_specs,
    name="specific_trim_specs_tool",
    description=(
        "Provides data about product specifications. "
        "This tool can return specific specification in dictionary format for a given trim and category. "
        "If the user question contains 'and', you need to split it into multiple questions first. "
        "Use a detailed plain text question as input to the tool."
    ),
)


I aim to use OpenAIAgent as the entry point for questions.

Plain Text
open_AI_agent = OpenAIAgent.from_tools([specific_trim_specs_tool, get_trim_list], verbose=True, callback_manager=CallbackManager([token_counter]))
response = open_AI_agent.chat("user_question_here")


However, if the user question is extremely complex, such as:
"Can you provide a detailed comparison of the different trim levels available for the specific model, including their respective prices, key specifications, and unique features? Additionally, how do these trims compare in terms of total cost of ownership, considering potential incentives, maintenance costs, and resale value?"

I want OpenAIAgent to use SubQuestionQueryEngine to break the question into several sub-questions, then use specific_trim_specs_tool to retrieve the specifications data, and finally synthesize the responses in English.
3 comments
k