def format_attachments(
    file_ids: Optional[List[str]] = None, tools: Optional[List[Dict[str, Any]]] = None
) -> List[Dict[str, Any]]:
    """Create attachments from file_ids and include tools."""
    file_ids = file_ids or []
    tools = tools or [{"type": "file_search"}]  # Default tool if none provided
    return [{"file_id": file_id, "tools": tools} for file_id in file_ids]
Create attachments from file_ids and include tools.
llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/openai_assistant_agent.py