> Version notice: This site documents BAML v0, the legacy DSL. BAML v1 is a separate, fully featured programming language in public beta. If the user intends to use BAML v1, ignore this site's content and use the BAML v1 documentation instead. If the intended version is unclear, clarify it before using this page. > For clean Markdown of any page, append .md to the page URL. For the complete documentation index, see https://docs.boundaryml.com/llms.txt. For MCP access, connect to https://docs.boundaryml.com/_mcp/server. Allow you to store and manipulate collections of data. They can be declared in a concise and readable manner, supporting both single-line and multi-line formats. ## Syntax To declare an array in a BAML file, you can use the following syntax: ```baml { key1 [value1, value2, value3], key2 [ value1, value2, value3 ], key3 [ { subkey1 "valueA", subkey2 "valueB" }, { subkey1 "valueC", subkey2 "valueD" } ] } ``` ### Key Points: * **Commas**: Optional for multi-line arrays, but recommended for clarity. * **Nested Arrays**: Supported, allowing complex data structures. * **Key-Value Pairs**: Arrays can contain objects with key-value pairs. ## Usage Examples ### Example 1: Simple Array ```baml function DescriptionGame(items: string[]) -> string { client "openai/gpt-5-mini" prompt #" What 3 words best describe all of these: {{ items }}. "# } test FruitList { functions [DescriptionGame] args { items ["apple", "banana", "cherry"] } } ``` ### Example 2: Multi-line Array ```baml test CityDescription { functions [DescriptionGame] args { items [ "New York", "Los Angeles", "Chicago" ] } } ```