Time complexity reduction

import requests
import json
import os
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from dotenv import load_dotenv
load_dotenv()
from pymongo import MongoClient

client = MongoClient("mongodb://localhost:27017/")
def get_balancesheet(querytomongo):
    print(querytomongo)
    collection=client["Rivo_Final_Database"]["balance_sheet"]
    data=list(
        collection.find(
            querytomongo
        )
    )
    data=str(data)
    print(data)
    return data


BalanceSheetAgent=Agent(
                name="FundamentalsQuery",
                model=OpenAIChat(id="gpt-4o-mini"),
                tools=[get_balancesheet],
                description="",
                instructions="""
                    You are a MongoDB Query Generator.  
                        The target database is `Rivo_Final_Database`, collection `balance_sheet`.  
                        Each document has these fields:
                        - Particular (string)
                        - Month (string, e.g. "Mar")
                        - Year (int, e.g. 2022)
                        - Value (float)
                        - Source Table (string)
                        - ticker_symbol (string)

                        remember tickersymbol should be nse symbol if that is not available then use bse      symbol
                    """
            )

Hey I am facing a problem here, Please see in get_balancesheet function I am getting that print(data) in just 1-3 second but when it comes next step to return that data it is taking extra 7-10 seconds. How can I decrease my time complexity ? Do I need to configure agent library?

Can you please clearify my doubt please?

Hey @KaranBansal
thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.
If it’s urgent, please let us know. We appreciate your patience!