Skip to content

Commit

Permalink
Update demo.py in README (#458)
Browse files Browse the repository at this point in the history
* Update demo.py in README

* Update README.md
  • Loading branch information
krishvsoni authored Oct 9, 2023
1 parent c819765 commit b52aaca
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,22 @@ import chainlit as cl

@cl.on_message # this function will be called every time a user inputs a message in the UI
async def main(message: str):
# this is an intermediate step
await cl.Message(author="Tool 1", content=f"Response from tool1", indent=1).send()
"""
This function is called every time a user inputs a message in the UI.
It sends back an intermediate response from Tool 1, followed by the final answer.
# send back the final answer
Args:
message: The user's message.
Returns:
None.
"""

# Send an intermediate response from Tool 1.
await cl.Message(
author="Tool 1", content=f"Response from tool1", indent=1).send()

# Send the final answer.
await cl.Message(content=f"This is the final answer").send()
```

Expand Down

0 comments on commit b52aaca

Please sign in to comment.