maartenbreddels commited on
Commit
15534c0
·
1 Parent(s): a5a5fb4

refactor: make code a bit more compact

Browse files
Files changed (1) hide show
  1. wanderlust.py +7 -26
wanderlust.py CHANGED
@@ -130,39 +130,20 @@ def ChatMessage(message):
130
  solara.v.Icon(children=[icon], style_="padding-top: 10px;")
131
  solara.Markdown(message["output"])
132
  elif message.role == "user":
133
- solara.Text(
134
- message.content[0].text.value,
135
- style={"font-weight": "bold;"},
136
- )
137
  elif message.role == "assistant":
138
  if message.content[0].text.value:
139
- solara.v.Icon(
140
- children=["mdi-compass-outline"],
141
- style_="padding-top: 10px;",
142
- )
143
  solara.Markdown(message.content[0].text.value)
144
  elif message.content.tool_calls:
145
- solara.v.Icon(
146
- children=["mdi-map"],
147
- style_="padding-top: 10px;",
148
- )
149
  solara.Markdown("*Calling map functions*")
150
  else:
151
- solara.v.Icon(
152
- children=["mdi-compass-outline"],
153
- style_="padding-top: 10px;",
154
- )
155
- solara.Preformatted(
156
- repr(message),
157
- )
158
  else:
159
- solara.v.Icon(
160
- children=["mdi-compass-outline"],
161
- style_="padding-top: 10px;",
162
- )
163
- solara.Preformatted(
164
- repr(message),
165
- )
166
 
167
 
168
  @solara.component
 
130
  solara.v.Icon(children=[icon], style_="padding-top: 10px;")
131
  solara.Markdown(message["output"])
132
  elif message.role == "user":
133
+ solara.Text(message.content[0].text.value, style={"font-weight": "bold;"})
 
 
 
134
  elif message.role == "assistant":
135
  if message.content[0].text.value:
136
+ solara.v.Icon(children=["mdi-compass-outline"], style_="padding-top: 10px;")
 
 
 
137
  solara.Markdown(message.content[0].text.value)
138
  elif message.content.tool_calls:
139
+ solara.v.Icon(children=["mdi-map"], style_="padding-top: 10px;")
 
 
 
140
  solara.Markdown("*Calling map functions*")
141
  else:
142
+ solara.v.Icon(children=["mdi-compass-outline"], style_="padding-top: 10px;")
143
+ solara.Preformatted(repr(message))
 
 
 
 
 
144
  else:
145
+ solara.v.Icon(children=["mdi-compass-outline"], style_="padding-top: 10px;")
146
+ solara.Preformatted(repr(message))
 
 
 
 
 
147
 
148
 
149
  @solara.component