from llama_index.core.callbacks import CallbackManager, LlamaDebugHandler
from llama_index.agent import FunctionAgent # ✅ Make sure this is the correct import based on your LlamaIndex version
# Stub: Replace with actual tool and LLM
ferramenta = ... # your tool, e.g. a function tool or ToolSpec
llm = ... # your LLM instance, e.g. from OpenAI or HuggingFace
# Initialize debug handler
llama_debug = LlamaDebugHandler()
callback_manager = CallbackManager([llama_debug])
# Initialize the agent
agent = FunctionAgent(
tools=[ferramenta],
llm=llm,
system_prompt=(
"Você é um assistente muito prestativo que irá me ajudar a "
"responder minhas questões sobre engajamento."
),
callback_manager=callback_manager,
allow_parallel_tool_calls=True,
)