def get_files_ai_extract_data(
    box_client: BoxClient, ai_prompt: str, box_files: List[File]
) -> List[File]:
    """
    Extracts data from Box files using Box AI features.

    This function takes a Box client, an AI prompt string, and a list of Box File objects as input. It utilizes the Box AI capabilities, specifically the `AiExtractManager`, to extract data from the files based on the provided prompt. The function then updates the File objects with the prompt and AI extracted data information.

    Args:
        box_client (BoxClient): An authenticated Box client object.
        ai_prompt (str): The AI prompt string used to guide data extraction.
        box_files (List[File]): A list of Box File objects representing the files to extract data from.

    Returns:
        List[File]: The original list of Box File objects with additional attributes:
            * `ai_prompt`: The AI prompt used for data extraction.
            * `ai_response`: The extracted data from the file based on the prompt (format may vary depending on Box AI configuration).

    Raises:
        BoxAPIError: If an error occurs while interacting with the Box AI API.

    """
    for file in box_files:
        ask_item = AiItemBase(file.id)
        logger.info(f"Getting AI extracted data for file: {file.id} {file.name}")

        # get the AI extracted data for the file
        try:
            ai_response = box_client.ai.create_ai_extract(
                prompt=ai_prompt, items=[ask_item]
            )
        except BoxAPIError as e:
            logger.error(
                f"An error occurred while getting AI extracted data for file: {e}",
                exc_info=True,
            )
            raise

        file.ai_prompt = ai_prompt
        file.ai_response = ai_response.answer

    return box_files

    Extracts data from Box files using Box AI features.

    This function takes a Box client, an AI prompt string, and a list of Box File objects as input. It utilizes the Box AI capabilities, specifically the `AiExtractManager`, to extract data from the files based on the provided prompt. The function then updates the File objects with the prompt and AI extracted data information.

    Args:
        box_client (BoxClient): An authenticated Box client object.
        ai_prompt (str): The AI prompt string used to guide data extraction.
        box_files (List[File]): A list of Box File objects representing the files to extract data from.

    Returns:
        List[File]: The original list of Box File objects with additional attributes:
            * `ai_prompt`: The AI prompt used for data extraction.
            * `ai_response`: The extracted data from the file based on the prompt (format may vary depending on Box AI configuration).

    Raises:
        BoxAPIError: If an error occurs while interacting with the Box AI API.

    
llama-index-integrations/readers/llama-index-readers-box/llama_index/readers/box/BoxAPI/box_api.py