Skip to content

Commit

Permalink
little updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii committed Dec 13, 2024
1 parent cdaa11e commit f58818d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from enum import Enum

import streamlit as st
from microchain.functions import Reasoning
from microchain.functions import Reasoning, Stop
from prediction_market_agent_tooling.tools.balances import get_balances
from prediction_market_agent_tooling.tools.utils import check_not_none
from streamlit_extras.stylable_container import stylable_container
Expand Down Expand Up @@ -101,6 +101,8 @@ def customized_chat_message(
match parsed_function_call_name:
case Reasoning.__name__:
icon = "🧠"
case Stop.__name__:
icon = "😴"
case ReceiveMessage.__name__:
icon = "👤"
case BroadcastPublicMessageToHumans.__name__:
Expand All @@ -116,6 +118,9 @@ def customized_chat_message(
st.markdown(
parsed_function_call_body.replace("reasoning='", "").replace("')", "")
)
elif parsed_function_call_name == Stop.__name__:
# If the agent decided to stop, show it as a break, as it will be started soon again.
st.markdown("Taking a break.")
else:
# Otherwise, show it as a normal function-response call, e.g. `ReceiveMessages() -> ...`.
st.markdown(
Expand All @@ -125,6 +130,7 @@ def customized_chat_message(
# Only show the output if it's supposed to be interesting.
if parsed_function_call_name not in (
Reasoning.__name__,
Stop.__name__,
BroadcastPublicMessageToHumans.__name__,
SendPaidMessageToAnotherAgent.__name__,
):
Expand Down

0 comments on commit f58818d

Please sign in to comment.