https://github.com/stitchfix/hamilton logo
Join Slack
Powered by
# burr-help
  • j

    Jay

    08/07/2024, 8:10 PM
    hey, was just going through examples of Burr and had a question. Why do actions return a Tuple of state and the output
    Copy code
    @action(
        reads=[],
        writes=["question", "chat_history"],
    )
    def human_converse(state: State, user_question: str) -> Tuple[dict, State]:
        """Human converse step -- make sure we get input, and store it as state."""
        state = state.update(question=user_question).append(chat_history=f"Human: {user_question}")
        return {"question": user_question}, state
    s
    • 2
    • 2