You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current situation:
Whenever a message is sent within a step, the message will appear within that step.
What would also be nice to have:
I have a case where we want to use a step, but also allow messages to be sent to the UI which are not nested within the step. For example, we have a COT, but also need the users to see a "suggested" answer before the agent is finished.
We currently have this hacky work around:
from chainlit.context import local_steps
async def tell_user(message: str, **kwargs) -> None:
msg = cl.Message(
content=message,
**kwargs
)
# A hack to allow the feedback feature to work, but also stop the message being inserted within a step
# The parent_id is needed to enable feedback, so we cannot just set it as None.
previous_steps = local_steps.get() or []
parent_step = previous_steps[0] if previous_steps else None
if parent_step:
msg.parent_id = parent_step.id
await msg.send()
The text was updated successfully, but these errors were encountered:
Current situation:
Whenever a message is sent within a step, the message will appear within that step.
What would also be nice to have:
I have a case where we want to use a step, but also allow messages to be sent to the UI which are not nested within the step. For example, we have a COT, but also need the users to see a "suggested" answer before the agent is finished.
We currently have this hacky work around:
The text was updated successfully, but these errors were encountered: