AI / Apache Burr Interview questions
How do you use runtime inputs in a Burr action?
Actions can declare parameters that live outside of state — things like an API client or a piece of human input that only exists at call time. In the function-based API, any unbound extra parameter becomes a runtime input automatically:
@action(reads=["..."], writes=["..."]) def my_action(state: State, client: Client, prompt: str) -> State: context = client.get_data(state["..."]) result = llm_call(prompt, context) return state.update(**result)
You then supply prompt at run time through the inputs dictionary:
app.run( halt_after=["my_action"], inputs={"prompt": "this gets passed into `prompt`"} )
Inputs passed to run/iterate only apply to the first action executed; later actions needing inputs should get them via step(inputs=...) calls, typically in a human-in-the-loop pattern.
More Related questions...