Skip to content

Commit

Permalink
Update README.md (#508)
Browse files Browse the repository at this point in the history
* Update README.md

Fixes inconsistencies in the REAMDE example
  • Loading branch information
elijahbenizzy authored Jan 29, 2025
1 parent 6a49eeb commit acbeff5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ from burr.core import action, State, ApplicationBuilder

@action(reads=[], writes=["prompt", "chat_history"])
def human_input(state: State, prompt: str) -> State:
# your code -- write what you want here!
# your code -- write what you want here, for example
chat_item = {"role" : "user", "content" : prompt}
return state.update(prompt=prompt).append(chat_history=chat_item)

@action(reads=["chat_history"], writes=["response", "chat_history"])
def ai_response(state: State) -> State:
# query the LLM however you want (or don't use an LLM, up to you...)
response = _query_llm(state["chat_history"]) # Burr doesn't care how you use LLMs!
chat_item = {"role" : "system", "content" : response}
return state.update(response=content).append(chat_history=chat_item)

app = (
Expand Down

0 comments on commit acbeff5

Please sign in to comment.