AI / Apache Burr Interview questions
What is the purpose of Burr’s ApplicationBuilder?
The ApplicationBuilder is the fluent builder class you use to assemble a Burr Application. You are expected to only ever instantiate ApplicationBuilder, never the Application class directly.
At minimum it needs three things: the actions (via with_actions(...)), the transitions between them (via with_transitions(...)), and an entrypoint (via with_entrypoint(...)).
from burr.core import ApplicationBuilder, default app = ( ApplicationBuilder() .with_actions(human_input, ai_response) .with_transitions( ("human_input", "ai_response"), ("ai_response", "human_input") ).with_state(chat_history=[]) .with_entrypoint("human_input") .build() )
Calling .build() returns the actual, runnable Application object.
More Related questions...