AgentMark supports iterating over arrays using the <ForEach> tag.
<ForEach>
arr
--- name: message-history text_config: model_name: gpt-4 test_settings: props: messageHistory: - role: user message: Hello - role: assistant message: Hi there --- <ForEach arr={props.messageHistory}> {(item) => ( <> <If condition={item.role == "user"}> <User>{item.message}</User> </If> <ElseIf condition={item.role == "assistant"}> <Assistant>{item.message}</Assistant> </ElseIf> </> )} </ForEach>
<>...</>
We’re here to help! Choose the best way to reach us: