Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #508

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
elijahbenizzy marked this conversation as resolved.
Show resolved Hide resolved

app = (
Expand Down