https://www.boundaryml.com logo
🟑 What are the approaches to managing conversatio...
# questions
z
What are the approaches to managing conversation history with BAML?
i.e. how it might be different than the alternatives. I suspect more manual which is totally okay, just curious how people/the team is thinking about it.
v
yep! you just build the context yourself:
Copy code
fn Chat(messages: string[]) -> string {
   client "openai/gpt-4o-min"
   prompt #"
     {% for m in messages %}
     {{ _.role("user" if loop.index0 % 2 == 0 else "assistant")
     {{ m }}
     {% endfor %}
   "#
}
z
Makes sense! Tbh this feels much better approach to me anyways. The logic is more clear and easy to reason about versus adding a layer of abstraction to it.
Btw, I'm working on a BAML POC for my company. We have over 13k business tenants.
v
That’s amazing