def extract_objs()

in databricks/notebooks/commit_annotations.py [0:0]


def extract_objs(gpt: List[Dict[str, Any]]) -> List[dict[str, Any]]:
    bd_objs = []
    for needle in gpt:
        for gpt_key, gpt_value in needle.items():
            for category, bd_value in gpt_to_badgerdoc_annotation(
                gpt_key, gpt_value
            ):
                if category:
                    bd_objs.append(
                        {
                            "id": random.choice(range(0, 0xFFFFFF)),
                            "category": category,
                            "type": "document",
                            "text": bd_value,
                        }
                    )

    return bd_objs