# ---------------------------------------------------------------------------- # # Welcome to Baml! To use this generated code, please run the following: # # $ pip install baml # # ---------------------------------------------------------------------------- # This file was generated by BAML: please do not edit it. Instead, edit the # BAML files and re-generate this code using: baml-cli generate # baml-cli is available with the baml package. _file_map = { "clients.baml": "// ISR LLM clients\n\nclient GPT4oMini {\n provider openai\n retry_policy Retry\n options {\n model \"gpt-4o-mini\"\n api_key env.OPENAI_API_KEY\n temperature 0.1\n }\n}\n\nclient GPT4o {\n provider openai\n retry_policy Retry\n options {\n model \"gpt-4o\"\n api_key env.OPENAI_API_KEY\n temperature 0.2\n }\n}\n\nretry_policy Retry {\n max_retries 2\n strategy {\n type exponential_backoff\n delay_ms 500\n multiplier 2.0\n max_delay_ms 5000\n }\n}\n", "generators.baml": "// This helps use auto generate libraries you can use in the language of\n// your choice. You can have multiple generators if you use multiple languages.\n// Just ensure that the output_dir is different for each generator.\ngenerator target {\n // Valid values: \"python/pydantic\", \"typescript\", \"go\", \"rust\", \"ruby/sorbet\", \"rest/openapi\"\n output_type \"python/pydantic\"\n\n // Where the generated code will be saved (relative to baml_src/)\n output_dir \"../\"\n\n // The version of the BAML package you have installed (e.g. same version as your baml-py or @boundaryml/baml).\n // The BAML VSCode extension version should also match this version.\n version \"0.220.0\"\n\n // Valid values: \"sync\", \"async\"\n // This controls what `b.FunctionName()` will be (sync or async).\n default_client_mode sync\n}\n", "isr.baml": "// ISR Mission Planning & Assessment Functions\n\n// ── Mission Planning ─────────────────────────────────────────────\n// Takes a free-form mission objective and produces:\n// 1. Concrete object class queries for the detector (YOLO/DETR/GDINO)\n// 2. A refined mission statement for downstream assessment\n\nclass MissionPlan {\n detector_queries string[] @description(\"ONLY the object classes directly targeted by the mission. Use COCO class names (person, car, truck, bicycle, motorcycle, bus, dog, cat, etc.). Include ONLY classes the mission explicitly asks to find — do NOT pad with tangentially related classes. Typically 1-4 items.\")\n refined_mission string @description(\"A clear, one-sentence restatement of the mission objective that a downstream analyst LLM will evaluate each detection against.\")\n reasoning string @description(\"Brief explanation of why these queries were chosen.\")\n}\n\nfunction PlanMission(mission_text: string) -> MissionPlan {\n client GPT4oMini\n prompt #\"\n You are an ISR (Intelligence, Surveillance, Reconnaissance) mission planner.\n\n Your job is to decide what BROAD object categories a visual detector (YOLO / DETR / Grounding DINO) should look for.\n\n IMPORTANT — separation of concerns:\n - The DETECTOR can only recognize broad visual categories (person, car, truck, bus, etc.).\n It CANNOT judge intent, context, or mission-specific conditions.\n - A DOWNSTREAM ANALYST LLM will later examine each detection and decide whether it\n satisfies the mission. That is where nuanced judgment happens.\n\n Therefore:\n - Output ONLY the object classes the mission EXPLICITLY targets. Keep the list MINIMAL.\n - NEVER pad with \"context\" classes that happen to appear in the scene but are not the\n mission target. Every extra class wastes GPU cycles on irrelevant detections.\n - NEVER output mission-specific or subjective labels (e.g. \"stranded person\", \"cargo truck\",\n \"suspicious vehicle\"). The detector cannot distinguish these from their parent category.\n - Use standard COCO class names when possible: person, car, truck, bus, motorcycle, bicycle,\n dog, cat, horse, sheep, cow, elephant, bear, zebra, giraffe, bird,\n boat, airplane, backpack, suitcase, handbag, umbrella, etc.\n\n KEY RULE — ask \"Is the mission trying to FIND this class of object?\"\n - YES → include it. NO → leave it out, even if it appears in the scene.\n\n Examples:\n - \"identify person stranded on rooftop\" → detector_queries: [\"person\"]\n (mission targets people, NOT rooftops. Downstream LLM judges context.)\n - \"find motorcycles lane-splitting between traffic\" → detector_queries: [\"motorcycle\"]\n (mission targets motorcycles, NOT the surrounding cars/trucks.)\n - \"identify vehicles that can carry heavy cargos\" → detector_queries: [\"truck\", \"bus\", \"car\"]\n (mission targets vehicles broadly — multiple vehicle classes needed.)\n - \"find abandoned luggage in airport\" → detector_queries: [\"suitcase\", \"backpack\", \"handbag\"]\n (mission targets luggage — multiple luggage classes needed.)\n\n Mission objective: \"{{ mission_text }}\"\n\n {{ ctx.output_format }}\n \"#\n}\n\n\n// ── Mission Suggestion ──────────────────────────────────────────\n// Analyzes a video frame and suggests actionable ISR missions\n\nclass MissionSuggestion {\n mission string @description(\"A concise mission objective. Imperative command, e.g. 'Identify vehicles that can carry heavy cargos'. 8-15 words.\")\n reasoning string @description(\"One sentence: what you see in the image that makes this mission feasible.\")\n}\n\nfunction SuggestMissions(frame: image) -> MissionSuggestion[] {\n client GPT4oMini\n prompt #\"\n {{ _.role(\"system\") }}\n You are an ISR (Intelligence, Surveillance, Reconnaissance) mission advisor.\n Given a single video frame, suggest 3-5 surveillance missions.\n\n HOW THE SYSTEM WORKS — read carefully:\n - A DETECTOR (YOLO) finds broad object categories: person, car, truck, boat, etc.\n - An ANALYST LLM then examines EACH detected object's bounding box crop and decides:\n \"Does this specific object satisfy the mission?\" based on its VISUAL APPEARANCE.\n - The analyst judges each object INDEPENDENTLY. No spatial reasoning, no counting,\n no temporal tracking, no multi-frame analysis.\n\n THE BEST MISSIONS ask the analyst to make a VISUAL INFERENCE about each object.\n The mission should filter a broad category into a meaningful subset based on what\n the object LOOKS LIKE — its sub-type, visible attributes, condition, or equipment.\n\n Think of it as: \"The detector found 20 [trucks]. Which ones are [interesting subset]?\"\n The analyst looks at each truck's appearance and decides yes or no.\n\n Categories of visual inference (use these as inspiration, NOT as templates):\n - SUB-TYPE: narrowing a broad class by what variant it is\n - ATTRIBUTES: filtering by visible features like clothing, markings, equipment\n - CONDITION: filtering by visible state like loaded/empty, damaged/intact\n - CO-OCCURRENCE: filtering by what else appears in the same bounding box crop\n\n WHAT THE ANALYST CAN JUDGE (from a single object crop):\n - Sub-type or variant within a class\n - Visual attributes (clothing, markings, color, size, equipment, accessories)\n - Visible condition or state\n - What else is visible in the same crop (person holding something, vehicle carrying something)\n\n WHAT THE ANALYST CANNOT JUDGE:\n - Spatial relationships to other objects or scene landmarks (near, on, inside)\n - Counting or aggregation (how many, total)\n - Motion, direction, speed, or behavior over time\n - Scene-level context (restricted zone, authorized area)\n\n RULES:\n 1. Only reference objects you ACTUALLY SEE in the frame. Look at the image carefully.\n 2. Only target COCO-detectable objects (person, car, truck, bus, motorcycle, bicycle,\n boat, dog, cat, airplane, backpack, suitcase, horse, cow, etc.).\n 3. Each mission = a visual inference about object appearance or sub-type.\n 4. Use verbs like: identify, find, detect — NOT: count, track, monitor, follow, locate.\n 5. Be ORIGINAL — craft each mission specifically for what you see in THIS frame.\n Do NOT reuse generic templates. Every mission should feel tailored to the scene.\n\n {{ _.role(\"user\") }}\n Analyze this video frame and suggest 3-5 missions based on the objects visible:\n\n {{ frame }}\n\n {{ ctx.output_format }}\n \"#\n}\n\n\n// ── Detection Assessment ─────────────────────────────────────────\n// Replaces hand-rolled JSON parsing with type-safe BAML output\n\nclass DetectionInfo {\n track_id string\n class_label string\n confidence float @description(\"Detection model confidence 0.0-1.0. Lower values mean the detector is less sure about the class.\")\n center_x float @description(\"Horizontal position in frame, 0.0=left edge, 1.0=right edge\")\n center_y float @description(\"Vertical position in frame, 0.0=top edge, 1.0=bottom edge\")\n speed_kph float\n direction string @description(\"Clock direction (e.g. '3 o'clock' for rightward) or 'stationary'\")\n}\n\nclass DetectionVerdict {\n track_id string\n mission_relevant bool @description(\"Does this broad object CLASS relate to the mission? e.g. 'person' is relevant to a rescue mission, 'dog' is not.\")\n satisfies bool? @description(\"Based on visual context, does THIS SPECIFIC detection actually meet the mission criteria? e.g. a person on a rooftop satisfies 'find stranded people', but a person walking on a street does not. null if the image is too ambiguous to judge.\")\n reason string @description(\"1-2 sentences: what you observe in the image that supports your verdict. Reference specific visual cues (location, posture, surroundings, motion).\")\n features map @description(\"2-5 observable properties from the image relevant to the mission. e.g. location: 'rooftop', posture: 'standing', surroundings: 'floodwater', vehicle_type: 'flatbed truck'\")\n}\n\n// ── PlanMission Tests ────────────────────────────────────────────\n\ntest HeavyCargoVehicles {\n functions [PlanMission]\n args {\n mission_text \"identify vehicles that can carry heavy cargos\"\n }\n // Mission targets vehicles broadly — multiple vehicle types needed\n @@assert( {{ this.detector_queries|length >= 2 }} )\n @@assert( {{ this.detector_queries|length <= 5 }} )\n @@assert( {{ \"truck\" in this.detector_queries }} )\n @@assert( {{ \"cargo\" not in this.detector_queries|join(\" \") }} )\n // No non-vehicle padding\n @@assert( {{ \"person\" not in this.detector_queries }} )\n @@assert( {{ \"dog\" not in this.detector_queries }} )\n}\n\ntest PersonOnRooftop {\n functions [PlanMission]\n args {\n mission_text \"identify person stranded on rooftop\"\n }\n // Mission targets person only — rooftop is context for assessor\n @@assert( {{ \"person\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"stranded\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"rooftop\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"dog\" not in this.detector_queries }} )\n}\n\ntest AbandonedLuggage {\n functions [PlanMission]\n args {\n mission_text \"find abandoned luggage in airport terminal\"\n }\n // Mission targets luggage — multiple luggage classes needed\n @@assert( {{ this.detector_queries|length >= 2 }} )\n @@assert( {{ this.detector_queries|length <= 4 }} )\n @@assert( {{ \"abandoned\" not in this.detector_queries|join(\" \") }} )\n // No non-luggage padding\n @@assert( {{ \"person\" not in this.detector_queries }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"airplane\" not in this.detector_queries }} )\n}\n\ntest VehiclesBlockingHighway {\n functions [PlanMission]\n args {\n mission_text \"locate vehicles blocking the highway exit ramp\"\n }\n // Mission targets vehicles — multiple vehicle types needed\n @@assert( {{ \"car\" in this.detector_queries }} )\n @@assert( {{ \"truck\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 5 }} )\n @@assert( {{ \"blocking\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"highway\" not in this.detector_queries|join(\" \") }} )\n // No non-vehicle padding\n @@assert( {{ \"person\" not in this.detector_queries }} )\n @@assert( {{ \"dog\" not in this.detector_queries }} )\n}\n\ntest PeopleJaywalking {\n functions [PlanMission]\n args {\n mission_text \"identify people jaywalking across the main road\"\n }\n // Mission targets people only — road/vehicles are context\n @@assert( {{ \"person\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"jaywalking\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"road\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"truck\" not in this.detector_queries }} )\n @@assert( {{ \"bus\" not in this.detector_queries }} )\n @@assert( {{ \"bicycle\" not in this.detector_queries }} )\n}\n\ntest BoatsNearRestrictedDock {\n functions [PlanMission]\n args {\n mission_text \"find boats anchored near the restricted dock area\"\n }\n // Mission targets boats only\n @@assert( {{ \"boat\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"anchored\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"restricted\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"dock\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n}\n\ntest DogsOffLeash {\n functions [PlanMission]\n args {\n mission_text \"detect dogs off-leash in the public park\"\n }\n // Mission targets dogs only — leash/park are context\n @@assert( {{ \"dog\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"leash\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"off-leash\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"park\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n @@assert( {{ \"cat\" not in this.detector_queries }} )\n}\n\ntest DeliveryTrucksInDriveways {\n functions [PlanMission]\n args {\n mission_text \"locate delivery trucks parked in residential driveways\"\n }\n // Mission targets trucks only — delivery/residential are context\n @@assert( {{ \"truck\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"delivery\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"residential\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"driveway\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n}\n\ntest CyclistsOnSidewalk {\n functions [PlanMission]\n args {\n mission_text \"identify cyclists riding on the pedestrian sidewalk\"\n }\n // Mission targets cyclists = bicycle + person\n @@assert( {{ \"bicycle\" in this.detector_queries }} )\n @@assert( {{ \"person\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 3 }} )\n @@assert( {{ \"cyclist\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"sidewalk\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"pedestrian\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"truck\" not in this.detector_queries }} )\n}\n\ntest PersonsLoiteringNearExit {\n functions [PlanMission]\n args {\n mission_text \"find persons loitering near the emergency exit\"\n }\n // Mission targets persons only — exit is context\n @@assert( {{ \"person\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"loitering\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"emergency\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"door\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n}\n\ntest OverturnedVehicles {\n functions [PlanMission]\n args {\n mission_text \"detect overturned vehicles on the freeway\"\n }\n // Mission targets vehicles — multiple vehicle types needed\n @@assert( {{ \"car\" in this.detector_queries }} )\n @@assert( {{ \"truck\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 5 }} )\n @@assert( {{ \"overturned\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"freeway\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n @@assert( {{ \"dog\" not in this.detector_queries }} )\n}\n\ntest AircraftOutsideApron {\n functions [PlanMission]\n args {\n mission_text \"locate aircraft parked outside designated apron area\"\n }\n // Mission targets aircraft only\n @@assert( {{ \"airplane\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"designated\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"apron\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n}\n\ntest PersonsWithBackpacksNearFence {\n functions [PlanMission]\n args {\n mission_text \"identify persons carrying large backpacks near the perimeter fence\"\n }\n // Mission targets persons + backpacks\n @@assert( {{ \"person\" in this.detector_queries }} )\n @@assert( {{ \"backpack\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 3 }} )\n @@assert( {{ \"perimeter\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"fence\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"carrying\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n}\n\ntest MotorcyclesLaneSplitting {\n functions [PlanMission]\n args {\n mission_text \"find motorcycles lane-splitting between traffic\"\n }\n // Mission targets motorcycles only — surrounding traffic is context\n @@assert( {{ \"motorcycle\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"lane-splitting\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"traffic\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"truck\" not in this.detector_queries }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n}\n\ntest CattleOnRoadway {\n functions [PlanMission]\n args {\n mission_text \"detect cattle that have crossed onto the roadway\"\n }\n // Mission targets cattle (COCO: cow) only\n @@assert( {{ \"cow\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"cattle\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"roadway\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"crossed\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n}\n\ntest BusesAtUnauthorizedStops {\n functions [PlanMission]\n args {\n mission_text \"locate buses stopped at unauthorized pickup points\"\n }\n // Mission targets buses only\n @@assert( {{ \"bus\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"unauthorized\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"pickup\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"truck\" not in this.detector_queries }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n}\n\ntest PeopleSwimmingInRestrictedArea {\n functions [PlanMission]\n args {\n mission_text \"identify people swimming in the restricted waterway\"\n }\n // Mission targets people only — waterway is context\n @@assert( {{ \"person\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"swimming\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"restricted\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"waterway\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"boat\" not in this.detector_queries }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n}\n\ntest TrucksWithOversizedLoads {\n functions [PlanMission]\n args {\n mission_text \"find trucks carrying visible oversized loads on the bridge\"\n }\n // Mission targets trucks only — bridge/load are context\n @@assert( {{ \"truck\" in this.detector_queries }} )\n @@assert( {{ this.detector_queries|length <= 2 }} )\n @@assert( {{ \"oversized\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"cargo\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"bridge\" not in this.detector_queries|join(\" \") }} )\n @@assert( {{ \"car\" not in this.detector_queries }} )\n @@assert( {{ \"person\" not in this.detector_queries }} )\n}\n\n\n// ── Detection Assessment ─────────────────────────────────────────\n// Replaces hand-rolled JSON parsing with type-safe BAML output\n\nfunction AssessDetections(mission: string, detections: DetectionInfo[], frame_image: image) -> DetectionVerdict[] {\n client GPT4oMini\n prompt #\"\n {{ _.role(\"system\") }}\n You are an ISR analyst. A broad-net detector found candidate objects. Your job: decide\n which ones actually satisfy the mission using the image and metadata below.\n\n Reading the metadata:\n - **confidence**: detector certainty (0-1). Below 0.4 = likely false positive — verify visually before trusting the class label.\n - **position**: (x, y) in frame where (0,0)=top-left, (1,1)=bottom-right. Use this to locate each detection in the image.\n - **speed/direction**: from multi-frame tracking. speed=0 means stationary. Direction uses clock notation (12=up, 3=right, 6=down, 9=left).\n\n For each detection, decide:\n - **mission_relevant**: Does this object CLASS relate to the mission? (person vs dog, not this specific instance.)\n - **satisfies**: Based on what you SEE in the image — does this specific detection meet the mission criteria? Consider location, posture, surroundings, object subtype. Set null only when genuinely ambiguous.\n - **reason**: Cite what you observe in the image. No generic statements.\n - **features**: 2-5 observable properties from the image relevant to the mission.\n\n {{ _.role(\"user\") }}\n Mission: \"{{ mission }}\"\n\n Detected objects:\n {% for d in detections %}\n - {{ d.track_id }}: {{ d.class_label }} (conf={{ d.confidence }}) at ({{ d.center_x }}, {{ d.center_y }}), {{ d.speed_kph }}kph {{ d.direction }}\n {% endfor %}\n\n {{ frame_image }}\n\n Assess every detection above.\n\n {{ ctx.output_format }}\n \"#\n}\n\n// ── AssessDetections Tests ───────────────────────────────────────\n// SAR flood scene: person + dog on rooftop, surrounded by floodwater\n\n// Wide net: detector found person + dog. Assessor must judge context from image.\ntest SAR_PersonOnRooftop {\n functions [AssessDetections]\n args {\n mission \"identify person stranded on rooftop needing rescue\"\n detections [\n {\n track_id \"T01\"\n class_label \"person\"\n confidence 0.87\n center_x 0.45\n center_y 0.35\n speed_kph 0.0\n direction \"stationary\"\n },\n {\n track_id \"T02\"\n class_label \"dog\"\n confidence 0.72\n center_x 0.52\n center_y 0.40\n speed_kph 0.0\n direction \"stationary\"\n }\n ]\n frame_image {\n file \"fixtures/sar_rooftop.jpg\"\n media_type \"image/jpeg\"\n }\n }\n @@assert( {{ this|length == 2 }} )\n // Person on rooftop: class is relevant AND visual context satisfies mission\n @@assert( {{ this[0].track_id == \"T01\" }} )\n @@assert( {{ this[0].mission_relevant == true }} )\n @@assert( {{ this[0].satisfies == true }} )\n // Dog: class is not relevant to \"person stranded\" mission\n @@assert( {{ this[1].track_id == \"T02\" }} )\n @@assert( {{ this[1].mission_relevant == false }} )\n}\n\n// Wide net caught person + dog, but mission is about vehicles — both should be irrelevant.\ntest NeitherPersonNorDogIsVehicle {\n functions [AssessDetections]\n args {\n mission \"identify vehicles capable of transporting heavy cargo\"\n detections [\n {\n track_id \"T01\"\n class_label \"person\"\n confidence 0.87\n center_x 0.45\n center_y 0.35\n speed_kph 0.0\n direction \"stationary\"\n },\n {\n track_id \"T02\"\n class_label \"dog\"\n confidence 0.72\n center_x 0.52\n center_y 0.40\n speed_kph 0.0\n direction \"stationary\"\n }\n ]\n frame_image {\n file \"fixtures/sar_rooftop.jpg\"\n media_type \"image/jpeg\"\n }\n }\n @@assert( {{ this|length == 2 }} )\n // Neither person nor dog is a vehicle — both mission_relevant=false\n @@assert( {{ this[0].mission_relevant == false }} )\n @@assert( {{ this[1].mission_relevant == false }} )\n @@assert( {{ this[0].satisfies != true }} )\n @@assert( {{ this[1].satisfies != true }} )\n}\n", } def get_baml_files(): return _file_map