https://www.boundaryml.com logo
Element missing in parsed array
# help
p
t
Can you include the class definition in BAML file?
This probably outlines it much better! 🙂
p
Here is my class definition:
Copy code
class HotelExchangeTask {
  id int @description("Unique identifier for the task, start from 1 and increment sequentially.")
  step_type HotelExchangeStep @description("Type of operation this task performs")
  status TaskStatus @description("Current status of the task")
  dependencies int[] @description("List of task IDs that must be completed before this task can start")
}
Copy code
class HotelExchangeConversationStateSchema {
  hotel_order_number string? @description("The order number of the hotel booking to be modified/exchanged")
  hotel_property_id int? @description("The property ID of the current hotel booking")
  change_type string? @description("Type of hotel change: extension, change_date, change_city, change_hotel, change_room")
  agent_response string @description("Response explaining the exchange options or limitations and current task to execute.")
  execution_plan HotelExchangeTask[]? @description("List of tasks to be executed for the hotel exchange")
  current_task_id int? @description("ID of the currently active task")
  exchange_search_core_criteria HotelSearchCoreCriteria? @description("Core search criteria for the hotel exchange")
  exchange_search_additional_criteria HotelSearchAdditionalCriteria? @description("Additional search criteria for the hotel exchange")
  updated_hotel_select_result HotelSelectResult? @description("Hotel selection made by user during exchange process - contains property_id, room_product_id, hotel_name, room_title, and other selection details")
}
t
Thanks for that. The problem you are encountering is that the step #2 Validate Exchange is present in LLM response, but not in BAML parsed output, right? Per Vai's suggestion, it seems like the issue is parser silently failing. If I'm in your shoes, I would first make the elements in HotelExchangeTask class to optional by adding
?
(https://docs.boundaryml.com/ref/baml/types#optional-) and see which one is returning value and which ones aren't. That should get you one step closer. The
HotelExchangeStep
and
TaskStatus
are enums, I take? https://cdn.discordapp.com/attachments/1428434388072530011/1428516169878339715/Screenshot_2025-10-16_at_15.32.49.png?ex=68f2c8db&is=68f1775b&hm=7c0c289a46ae94cb4fcd74fb79f948744e63ae3090a0649247160ccfcc7e72fc&