h2o-wave 1.0.2__py3-none-any.whl → 1.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of h2o-wave might be problematic. Click here for more details.
- h2o_wave/cli.py +6 -1
- h2o_wave/types.py +169 -1
- h2o_wave/ui.py +55 -1
- h2o_wave/version.py +1 -1
- {h2o_wave-1.0.2.dist-info → h2o_wave-1.1.1.dist-info}/METADATA +1 -1
- {h2o_wave-1.0.2.dist-info → h2o_wave-1.1.1.dist-info}/RECORD +9 -9
- {h2o_wave-1.0.2.dist-info → h2o_wave-1.1.1.dist-info}/WHEEL +0 -0
- {h2o_wave-1.0.2.dist-info → h2o_wave-1.1.1.dist-info}/entry_points.txt +0 -0
- {h2o_wave-1.0.2.dist-info → h2o_wave-1.1.1.dist-info}/licenses/LICENSE +0 -0
h2o_wave/cli.py
CHANGED
|
@@ -132,6 +132,10 @@ def run(app: str, no_reload: bool, no_autostart: bool):
|
|
|
132
132
|
# uvicorn.main() does this before calling uvicorn.run().
|
|
133
133
|
sys.path.insert(0, '.')
|
|
134
134
|
|
|
135
|
+
# Allow relative paths from bash autocomplete. E.g. wave run ./foo.py
|
|
136
|
+
if app.startswith(f'.{os.path.sep}'):
|
|
137
|
+
app = app[2:]
|
|
138
|
+
|
|
135
139
|
# DevX: treat foo/bar/baz.py as foo.bar.baz
|
|
136
140
|
app_path, ext = os.path.splitext(app)
|
|
137
141
|
if ext.lower() == '.py':
|
|
@@ -150,6 +154,7 @@ def run(app: str, no_reload: bool, no_autostart: bool):
|
|
|
150
154
|
waved_path = os.path.join(sys.exec_prefix, 'waved.exe' if IS_WINDOWS else 'waved')
|
|
151
155
|
# OS agnostic wheels do not include waved - needed for HAC.
|
|
152
156
|
is_waved_present = os.path.isfile(waved_path)
|
|
157
|
+
is_auto_started = server_not_running
|
|
153
158
|
|
|
154
159
|
try:
|
|
155
160
|
if autostart and is_waved_present and server_not_running:
|
|
@@ -171,7 +176,7 @@ def run(app: str, no_reload: bool, no_autostart: bool):
|
|
|
171
176
|
print('Could not connect to Wave server. Please start the Wave server (waved or waved.exe) prior to running any app.')
|
|
172
177
|
return
|
|
173
178
|
|
|
174
|
-
if not os.environ.get('H2O_WAVE_WAVED_DIR') and
|
|
179
|
+
if not os.environ.get('H2O_WAVE_WAVED_DIR') and is_auto_started:
|
|
175
180
|
os.environ['H2O_WAVE_WAVED_DIR'] = sys.exec_prefix
|
|
176
181
|
reload_exclude = os.environ.get('H2O_WAVE_RELOAD_EXCLUDE', None)
|
|
177
182
|
if reload_exclude:
|
h2o_wave/types.py
CHANGED
|
@@ -160,6 +160,8 @@ class Command:
|
|
|
160
160
|
icon: Optional[str] = None,
|
|
161
161
|
items: Optional[List['Command']] = None,
|
|
162
162
|
value: Optional[str] = None,
|
|
163
|
+
path: Optional[str] = None,
|
|
164
|
+
download: Optional[bool] = None,
|
|
163
165
|
):
|
|
164
166
|
_guard_scalar('Command.name', name, (str,), True, False, False)
|
|
165
167
|
_guard_scalar('Command.label', label, (str,), False, True, False)
|
|
@@ -167,6 +169,8 @@ class Command:
|
|
|
167
169
|
_guard_scalar('Command.icon', icon, (str,), False, True, False)
|
|
168
170
|
_guard_vector('Command.items', items, (Command,), False, True, False)
|
|
169
171
|
_guard_scalar('Command.value', value, (str,), False, True, False)
|
|
172
|
+
_guard_scalar('Command.path', path, (str,), False, True, False)
|
|
173
|
+
_guard_scalar('Command.download', download, (bool,), False, True, False)
|
|
170
174
|
self.name = name
|
|
171
175
|
"""An identifying name for this component. If the name is prefixed with a '#', the command sets the location hash to the name when executed."""
|
|
172
176
|
self.label = label
|
|
@@ -179,6 +183,10 @@ class Command:
|
|
|
179
183
|
"""Sub-commands, if any"""
|
|
180
184
|
self.value = value
|
|
181
185
|
"""Data associated with this command, if any."""
|
|
186
|
+
self.path = path
|
|
187
|
+
"""The path or URL to link to. The 'items' and 'value' props are ignored when specified."""
|
|
188
|
+
self.download = download
|
|
189
|
+
"""True if the link should prompt the user to save the linked URL instead of navigating to it."""
|
|
182
190
|
|
|
183
191
|
def dump(self) -> Dict:
|
|
184
192
|
"""Returns the contents of this object as a dict."""
|
|
@@ -188,6 +196,8 @@ class Command:
|
|
|
188
196
|
_guard_scalar('Command.icon', self.icon, (str,), False, True, False)
|
|
189
197
|
_guard_vector('Command.items', self.items, (Command,), False, True, False)
|
|
190
198
|
_guard_scalar('Command.value', self.value, (str,), False, True, False)
|
|
199
|
+
_guard_scalar('Command.path', self.path, (str,), False, True, False)
|
|
200
|
+
_guard_scalar('Command.download', self.download, (bool,), False, True, False)
|
|
191
201
|
return _dump(
|
|
192
202
|
name=self.name,
|
|
193
203
|
label=self.label,
|
|
@@ -195,6 +205,8 @@ class Command:
|
|
|
195
205
|
icon=self.icon,
|
|
196
206
|
items=None if self.items is None else [__e.dump() for __e in self.items],
|
|
197
207
|
value=self.value,
|
|
208
|
+
path=self.path,
|
|
209
|
+
download=self.download,
|
|
198
210
|
)
|
|
199
211
|
|
|
200
212
|
@staticmethod
|
|
@@ -212,12 +224,18 @@ class Command:
|
|
|
212
224
|
_guard_vector('Command.items', __d_items, (dict,), False, True, False)
|
|
213
225
|
__d_value: Any = __d.get('value')
|
|
214
226
|
_guard_scalar('Command.value', __d_value, (str,), False, True, False)
|
|
227
|
+
__d_path: Any = __d.get('path')
|
|
228
|
+
_guard_scalar('Command.path', __d_path, (str,), False, True, False)
|
|
229
|
+
__d_download: Any = __d.get('download')
|
|
230
|
+
_guard_scalar('Command.download', __d_download, (bool,), False, True, False)
|
|
215
231
|
name: str = __d_name
|
|
216
232
|
label: Optional[str] = __d_label
|
|
217
233
|
caption: Optional[str] = __d_caption
|
|
218
234
|
icon: Optional[str] = __d_icon
|
|
219
235
|
items: Optional[List['Command']] = None if __d_items is None else [Command.load(__e) for __e in __d_items]
|
|
220
236
|
value: Optional[str] = __d_value
|
|
237
|
+
path: Optional[str] = __d_path
|
|
238
|
+
download: Optional[bool] = __d_download
|
|
221
239
|
return Command(
|
|
222
240
|
name,
|
|
223
241
|
label,
|
|
@@ -225,6 +243,8 @@ class Command:
|
|
|
225
243
|
icon,
|
|
226
244
|
items,
|
|
227
245
|
value,
|
|
246
|
+
path,
|
|
247
|
+
download,
|
|
228
248
|
)
|
|
229
249
|
|
|
230
250
|
|
|
@@ -969,6 +989,15 @@ class MessageBar:
|
|
|
969
989
|
)
|
|
970
990
|
|
|
971
991
|
|
|
992
|
+
_TextboxType = ['text', 'number', 'tel']
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
class TextboxType:
|
|
996
|
+
TEXT = 'text'
|
|
997
|
+
NUMBER = 'number'
|
|
998
|
+
TEL = 'tel'
|
|
999
|
+
|
|
1000
|
+
|
|
972
1001
|
class Textbox:
|
|
973
1002
|
"""Create a text box.
|
|
974
1003
|
|
|
@@ -998,6 +1027,7 @@ class Textbox:
|
|
|
998
1027
|
visible: Optional[bool] = None,
|
|
999
1028
|
tooltip: Optional[str] = None,
|
|
1000
1029
|
spellcheck: Optional[bool] = None,
|
|
1030
|
+
type: Optional[str] = None,
|
|
1001
1031
|
):
|
|
1002
1032
|
_guard_scalar('Textbox.name', name, (str,), True, False, False)
|
|
1003
1033
|
_guard_scalar('Textbox.label', label, (str,), False, True, False)
|
|
@@ -1019,6 +1049,7 @@ class Textbox:
|
|
|
1019
1049
|
_guard_scalar('Textbox.visible', visible, (bool,), False, True, False)
|
|
1020
1050
|
_guard_scalar('Textbox.tooltip', tooltip, (str,), False, True, False)
|
|
1021
1051
|
_guard_scalar('Textbox.spellcheck', spellcheck, (bool,), False, True, False)
|
|
1052
|
+
_guard_enum('Textbox.type', type, _TextboxType, True)
|
|
1022
1053
|
self.name = name
|
|
1023
1054
|
"""An identifying name for this component."""
|
|
1024
1055
|
self.label = label
|
|
@@ -1059,6 +1090,8 @@ class Textbox:
|
|
|
1059
1090
|
"""An optional tooltip message displayed when a user clicks the help icon to the right of the component."""
|
|
1060
1091
|
self.spellcheck = spellcheck
|
|
1061
1092
|
"""True if the text may be checked for spelling errors. Defaults to True."""
|
|
1093
|
+
self.type = type
|
|
1094
|
+
"""Keyboard to be shown on mobile devices. Defaults to 'text'. One of 'text', 'number', 'tel'. See enum h2o_wave.ui.TextboxType."""
|
|
1062
1095
|
|
|
1063
1096
|
def dump(self) -> Dict:
|
|
1064
1097
|
"""Returns the contents of this object as a dict."""
|
|
@@ -1082,6 +1115,7 @@ class Textbox:
|
|
|
1082
1115
|
_guard_scalar('Textbox.visible', self.visible, (bool,), False, True, False)
|
|
1083
1116
|
_guard_scalar('Textbox.tooltip', self.tooltip, (str,), False, True, False)
|
|
1084
1117
|
_guard_scalar('Textbox.spellcheck', self.spellcheck, (bool,), False, True, False)
|
|
1118
|
+
_guard_enum('Textbox.type', self.type, _TextboxType, True)
|
|
1085
1119
|
return _dump(
|
|
1086
1120
|
name=self.name,
|
|
1087
1121
|
label=self.label,
|
|
@@ -1103,6 +1137,7 @@ class Textbox:
|
|
|
1103
1137
|
visible=self.visible,
|
|
1104
1138
|
tooltip=self.tooltip,
|
|
1105
1139
|
spellcheck=self.spellcheck,
|
|
1140
|
+
type=self.type,
|
|
1106
1141
|
)
|
|
1107
1142
|
|
|
1108
1143
|
@staticmethod
|
|
@@ -1148,6 +1183,8 @@ class Textbox:
|
|
|
1148
1183
|
_guard_scalar('Textbox.tooltip', __d_tooltip, (str,), False, True, False)
|
|
1149
1184
|
__d_spellcheck: Any = __d.get('spellcheck')
|
|
1150
1185
|
_guard_scalar('Textbox.spellcheck', __d_spellcheck, (bool,), False, True, False)
|
|
1186
|
+
__d_type: Any = __d.get('type')
|
|
1187
|
+
_guard_enum('Textbox.type', __d_type, _TextboxType, True)
|
|
1151
1188
|
name: str = __d_name
|
|
1152
1189
|
label: Optional[str] = __d_label
|
|
1153
1190
|
placeholder: Optional[str] = __d_placeholder
|
|
@@ -1168,6 +1205,7 @@ class Textbox:
|
|
|
1168
1205
|
visible: Optional[bool] = __d_visible
|
|
1169
1206
|
tooltip: Optional[str] = __d_tooltip
|
|
1170
1207
|
spellcheck: Optional[bool] = __d_spellcheck
|
|
1208
|
+
type: Optional[str] = __d_type
|
|
1171
1209
|
return Textbox(
|
|
1172
1210
|
name,
|
|
1173
1211
|
label,
|
|
@@ -1189,6 +1227,7 @@ class Textbox:
|
|
|
1189
1227
|
visible,
|
|
1190
1228
|
tooltip,
|
|
1191
1229
|
spellcheck,
|
|
1230
|
+
type,
|
|
1192
1231
|
)
|
|
1193
1232
|
|
|
1194
1233
|
|
|
@@ -5823,12 +5862,14 @@ class Stat:
|
|
|
5823
5862
|
caption: Optional[str] = None,
|
|
5824
5863
|
icon: Optional[str] = None,
|
|
5825
5864
|
icon_color: Optional[str] = None,
|
|
5865
|
+
name: Optional[str] = None,
|
|
5826
5866
|
):
|
|
5827
5867
|
_guard_scalar('Stat.label', label, (str,), False, False, False)
|
|
5828
5868
|
_guard_scalar('Stat.value', value, (str,), False, True, False)
|
|
5829
5869
|
_guard_scalar('Stat.caption', caption, (str,), False, True, False)
|
|
5830
5870
|
_guard_scalar('Stat.icon', icon, (str,), False, True, False)
|
|
5831
5871
|
_guard_scalar('Stat.icon_color', icon_color, (str,), False, True, False)
|
|
5872
|
+
_guard_scalar('Stat.name', name, (str,), False, True, False)
|
|
5832
5873
|
self.label = label
|
|
5833
5874
|
"""The label for the metric."""
|
|
5834
5875
|
self.value = value
|
|
@@ -5839,6 +5880,8 @@ class Stat:
|
|
|
5839
5880
|
"""An optional icon, displayed next to the label."""
|
|
5840
5881
|
self.icon_color = icon_color
|
|
5841
5882
|
"""The color of the icon."""
|
|
5883
|
+
self.name = name
|
|
5884
|
+
"""An identifying name for this item."""
|
|
5842
5885
|
|
|
5843
5886
|
def dump(self) -> Dict:
|
|
5844
5887
|
"""Returns the contents of this object as a dict."""
|
|
@@ -5847,12 +5890,14 @@ class Stat:
|
|
|
5847
5890
|
_guard_scalar('Stat.caption', self.caption, (str,), False, True, False)
|
|
5848
5891
|
_guard_scalar('Stat.icon', self.icon, (str,), False, True, False)
|
|
5849
5892
|
_guard_scalar('Stat.icon_color', self.icon_color, (str,), False, True, False)
|
|
5893
|
+
_guard_scalar('Stat.name', self.name, (str,), False, True, False)
|
|
5850
5894
|
return _dump(
|
|
5851
5895
|
label=self.label,
|
|
5852
5896
|
value=self.value,
|
|
5853
5897
|
caption=self.caption,
|
|
5854
5898
|
icon=self.icon,
|
|
5855
5899
|
icon_color=self.icon_color,
|
|
5900
|
+
name=self.name,
|
|
5856
5901
|
)
|
|
5857
5902
|
|
|
5858
5903
|
@staticmethod
|
|
@@ -5868,17 +5913,21 @@ class Stat:
|
|
|
5868
5913
|
_guard_scalar('Stat.icon', __d_icon, (str,), False, True, False)
|
|
5869
5914
|
__d_icon_color: Any = __d.get('icon_color')
|
|
5870
5915
|
_guard_scalar('Stat.icon_color', __d_icon_color, (str,), False, True, False)
|
|
5916
|
+
__d_name: Any = __d.get('name')
|
|
5917
|
+
_guard_scalar('Stat.name', __d_name, (str,), False, True, False)
|
|
5871
5918
|
label: str = __d_label
|
|
5872
5919
|
value: Optional[str] = __d_value
|
|
5873
5920
|
caption: Optional[str] = __d_caption
|
|
5874
5921
|
icon: Optional[str] = __d_icon
|
|
5875
5922
|
icon_color: Optional[str] = __d_icon_color
|
|
5923
|
+
name: Optional[str] = __d_name
|
|
5876
5924
|
return Stat(
|
|
5877
5925
|
label,
|
|
5878
5926
|
value,
|
|
5879
5927
|
caption,
|
|
5880
5928
|
icon,
|
|
5881
5929
|
icon_color,
|
|
5930
|
+
name,
|
|
5882
5931
|
)
|
|
5883
5932
|
|
|
5884
5933
|
|
|
@@ -5903,12 +5952,14 @@ class Stats:
|
|
|
5903
5952
|
inset: Optional[bool] = None,
|
|
5904
5953
|
width: Optional[str] = None,
|
|
5905
5954
|
visible: Optional[bool] = None,
|
|
5955
|
+
name: Optional[str] = None,
|
|
5906
5956
|
):
|
|
5907
5957
|
_guard_vector('Stats.items', items, (Stat,), False, False, False)
|
|
5908
5958
|
_guard_enum('Stats.justify', justify, _StatsJustify, True)
|
|
5909
5959
|
_guard_scalar('Stats.inset', inset, (bool,), False, True, False)
|
|
5910
5960
|
_guard_scalar('Stats.width', width, (str,), False, True, False)
|
|
5911
5961
|
_guard_scalar('Stats.visible', visible, (bool,), False, True, False)
|
|
5962
|
+
_guard_scalar('Stats.name', name, (str,), False, True, False)
|
|
5912
5963
|
self.items = items
|
|
5913
5964
|
"""The individual stats to be displayed."""
|
|
5914
5965
|
self.justify = justify
|
|
@@ -5919,6 +5970,8 @@ class Stats:
|
|
|
5919
5970
|
"""The width of the stats, e.g. '100px'."""
|
|
5920
5971
|
self.visible = visible
|
|
5921
5972
|
"""True if the component should be visible. Defaults to True."""
|
|
5973
|
+
self.name = name
|
|
5974
|
+
"""An identifying name for this component."""
|
|
5922
5975
|
|
|
5923
5976
|
def dump(self) -> Dict:
|
|
5924
5977
|
"""Returns the contents of this object as a dict."""
|
|
@@ -5927,12 +5980,14 @@ class Stats:
|
|
|
5927
5980
|
_guard_scalar('Stats.inset', self.inset, (bool,), False, True, False)
|
|
5928
5981
|
_guard_scalar('Stats.width', self.width, (str,), False, True, False)
|
|
5929
5982
|
_guard_scalar('Stats.visible', self.visible, (bool,), False, True, False)
|
|
5983
|
+
_guard_scalar('Stats.name', self.name, (str,), False, True, False)
|
|
5930
5984
|
return _dump(
|
|
5931
5985
|
items=[__e.dump() for __e in self.items],
|
|
5932
5986
|
justify=self.justify,
|
|
5933
5987
|
inset=self.inset,
|
|
5934
5988
|
width=self.width,
|
|
5935
5989
|
visible=self.visible,
|
|
5990
|
+
name=self.name,
|
|
5936
5991
|
)
|
|
5937
5992
|
|
|
5938
5993
|
@staticmethod
|
|
@@ -5948,17 +6003,21 @@ class Stats:
|
|
|
5948
6003
|
_guard_scalar('Stats.width', __d_width, (str,), False, True, False)
|
|
5949
6004
|
__d_visible: Any = __d.get('visible')
|
|
5950
6005
|
_guard_scalar('Stats.visible', __d_visible, (bool,), False, True, False)
|
|
6006
|
+
__d_name: Any = __d.get('name')
|
|
6007
|
+
_guard_scalar('Stats.name', __d_name, (str,), False, True, False)
|
|
5951
6008
|
items: List[Stat] = [Stat.load(__e) for __e in __d_items]
|
|
5952
6009
|
justify: Optional[str] = __d_justify
|
|
5953
6010
|
inset: Optional[bool] = __d_inset
|
|
5954
6011
|
width: Optional[str] = __d_width
|
|
5955
6012
|
visible: Optional[bool] = __d_visible
|
|
6013
|
+
name: Optional[str] = __d_name
|
|
5956
6014
|
return Stats(
|
|
5957
6015
|
items,
|
|
5958
6016
|
justify,
|
|
5959
6017
|
inset,
|
|
5960
6018
|
width,
|
|
5961
6019
|
visible,
|
|
6020
|
+
name,
|
|
5962
6021
|
)
|
|
5963
6022
|
|
|
5964
6023
|
|
|
@@ -7054,12 +7113,14 @@ class CopyableText:
|
|
|
7054
7113
|
name: Optional[str] = None,
|
|
7055
7114
|
multiline: Optional[bool] = None,
|
|
7056
7115
|
height: Optional[str] = None,
|
|
7116
|
+
width: Optional[str] = None,
|
|
7057
7117
|
):
|
|
7058
7118
|
_guard_scalar('CopyableText.value', value, (str,), False, False, False)
|
|
7059
7119
|
_guard_scalar('CopyableText.label', label, (str,), False, False, False)
|
|
7060
7120
|
_guard_scalar('CopyableText.name', name, (str,), False, True, False)
|
|
7061
7121
|
_guard_scalar('CopyableText.multiline', multiline, (bool,), False, True, False)
|
|
7062
7122
|
_guard_scalar('CopyableText.height', height, (str,), False, True, False)
|
|
7123
|
+
_guard_scalar('CopyableText.width', width, (str,), False, True, False)
|
|
7063
7124
|
self.value = value
|
|
7064
7125
|
"""Text to be displayed inside the component."""
|
|
7065
7126
|
self.label = label
|
|
@@ -7070,6 +7131,8 @@ class CopyableText:
|
|
|
7070
7131
|
"""True if the component should allow multi-line text entry."""
|
|
7071
7132
|
self.height = height
|
|
7072
7133
|
"""Custom height in px (e.g. '200px') or '1' to fill the remaining card space. Requires `multiline` to be set."""
|
|
7134
|
+
self.width = width
|
|
7135
|
+
"""The width of the copyable text , e.g. '100px'."""
|
|
7073
7136
|
|
|
7074
7137
|
def dump(self) -> Dict:
|
|
7075
7138
|
"""Returns the contents of this object as a dict."""
|
|
@@ -7078,12 +7141,14 @@ class CopyableText:
|
|
|
7078
7141
|
_guard_scalar('CopyableText.name', self.name, (str,), False, True, False)
|
|
7079
7142
|
_guard_scalar('CopyableText.multiline', self.multiline, (bool,), False, True, False)
|
|
7080
7143
|
_guard_scalar('CopyableText.height', self.height, (str,), False, True, False)
|
|
7144
|
+
_guard_scalar('CopyableText.width', self.width, (str,), False, True, False)
|
|
7081
7145
|
return _dump(
|
|
7082
7146
|
value=self.value,
|
|
7083
7147
|
label=self.label,
|
|
7084
7148
|
name=self.name,
|
|
7085
7149
|
multiline=self.multiline,
|
|
7086
7150
|
height=self.height,
|
|
7151
|
+
width=self.width,
|
|
7087
7152
|
)
|
|
7088
7153
|
|
|
7089
7154
|
@staticmethod
|
|
@@ -7099,17 +7164,21 @@ class CopyableText:
|
|
|
7099
7164
|
_guard_scalar('CopyableText.multiline', __d_multiline, (bool,), False, True, False)
|
|
7100
7165
|
__d_height: Any = __d.get('height')
|
|
7101
7166
|
_guard_scalar('CopyableText.height', __d_height, (str,), False, True, False)
|
|
7167
|
+
__d_width: Any = __d.get('width')
|
|
7168
|
+
_guard_scalar('CopyableText.width', __d_width, (str,), False, True, False)
|
|
7102
7169
|
value: str = __d_value
|
|
7103
7170
|
label: str = __d_label
|
|
7104
7171
|
name: Optional[str] = __d_name
|
|
7105
7172
|
multiline: Optional[bool] = __d_multiline
|
|
7106
7173
|
height: Optional[str] = __d_height
|
|
7174
|
+
width: Optional[str] = __d_width
|
|
7107
7175
|
return CopyableText(
|
|
7108
7176
|
value,
|
|
7109
7177
|
label,
|
|
7110
7178
|
name,
|
|
7111
7179
|
multiline,
|
|
7112
7180
|
height,
|
|
7181
|
+
width,
|
|
7113
7182
|
)
|
|
7114
7183
|
|
|
7115
7184
|
|
|
@@ -8206,6 +8275,65 @@ class ChatCard:
|
|
|
8206
8275
|
)
|
|
8207
8276
|
|
|
8208
8277
|
|
|
8278
|
+
class ChatSuggestion:
|
|
8279
|
+
"""Create a chat prompt suggestion displayed as button below the last response in the chatbot component.
|
|
8280
|
+
"""
|
|
8281
|
+
def __init__(
|
|
8282
|
+
self,
|
|
8283
|
+
name: str,
|
|
8284
|
+
label: str,
|
|
8285
|
+
caption: Optional[str] = None,
|
|
8286
|
+
icon: Optional[str] = None,
|
|
8287
|
+
):
|
|
8288
|
+
_guard_scalar('ChatSuggestion.name', name, (str,), True, False, False)
|
|
8289
|
+
_guard_scalar('ChatSuggestion.label', label, (str,), False, False, False)
|
|
8290
|
+
_guard_scalar('ChatSuggestion.caption', caption, (str,), False, True, False)
|
|
8291
|
+
_guard_scalar('ChatSuggestion.icon', icon, (str,), False, True, False)
|
|
8292
|
+
self.name = name
|
|
8293
|
+
"""An identifying name for this component."""
|
|
8294
|
+
self.label = label
|
|
8295
|
+
"""The text displayed for this suggestion."""
|
|
8296
|
+
self.caption = caption
|
|
8297
|
+
"""The caption displayed below the label."""
|
|
8298
|
+
self.icon = icon
|
|
8299
|
+
"""The icon to be displayed for this suggestion."""
|
|
8300
|
+
|
|
8301
|
+
def dump(self) -> Dict:
|
|
8302
|
+
"""Returns the contents of this object as a dict."""
|
|
8303
|
+
_guard_scalar('ChatSuggestion.name', self.name, (str,), True, False, False)
|
|
8304
|
+
_guard_scalar('ChatSuggestion.label', self.label, (str,), False, False, False)
|
|
8305
|
+
_guard_scalar('ChatSuggestion.caption', self.caption, (str,), False, True, False)
|
|
8306
|
+
_guard_scalar('ChatSuggestion.icon', self.icon, (str,), False, True, False)
|
|
8307
|
+
return _dump(
|
|
8308
|
+
name=self.name,
|
|
8309
|
+
label=self.label,
|
|
8310
|
+
caption=self.caption,
|
|
8311
|
+
icon=self.icon,
|
|
8312
|
+
)
|
|
8313
|
+
|
|
8314
|
+
@staticmethod
|
|
8315
|
+
def load(__d: Dict) -> 'ChatSuggestion':
|
|
8316
|
+
"""Creates an instance of this class using the contents of a dict."""
|
|
8317
|
+
__d_name: Any = __d.get('name')
|
|
8318
|
+
_guard_scalar('ChatSuggestion.name', __d_name, (str,), True, False, False)
|
|
8319
|
+
__d_label: Any = __d.get('label')
|
|
8320
|
+
_guard_scalar('ChatSuggestion.label', __d_label, (str,), False, False, False)
|
|
8321
|
+
__d_caption: Any = __d.get('caption')
|
|
8322
|
+
_guard_scalar('ChatSuggestion.caption', __d_caption, (str,), False, True, False)
|
|
8323
|
+
__d_icon: Any = __d.get('icon')
|
|
8324
|
+
_guard_scalar('ChatSuggestion.icon', __d_icon, (str,), False, True, False)
|
|
8325
|
+
name: str = __d_name
|
|
8326
|
+
label: str = __d_label
|
|
8327
|
+
caption: Optional[str] = __d_caption
|
|
8328
|
+
icon: Optional[str] = __d_icon
|
|
8329
|
+
return ChatSuggestion(
|
|
8330
|
+
name,
|
|
8331
|
+
label,
|
|
8332
|
+
caption,
|
|
8333
|
+
icon,
|
|
8334
|
+
)
|
|
8335
|
+
|
|
8336
|
+
|
|
8209
8337
|
class ChatbotCard:
|
|
8210
8338
|
"""Create a chatbot card to allow getting prompts from users and providing them with LLM generated answers.
|
|
8211
8339
|
"""
|
|
@@ -8217,6 +8345,8 @@ class ChatbotCard:
|
|
|
8217
8345
|
placeholder: Optional[str] = None,
|
|
8218
8346
|
events: Optional[List[str]] = None,
|
|
8219
8347
|
generating: Optional[bool] = None,
|
|
8348
|
+
suggestions: Optional[List[ChatSuggestion]] = None,
|
|
8349
|
+
disabled: Optional[bool] = None,
|
|
8220
8350
|
commands: Optional[List[Command]] = None,
|
|
8221
8351
|
):
|
|
8222
8352
|
_guard_scalar('ChatbotCard.box', box, (str,), False, False, False)
|
|
@@ -8224,6 +8354,8 @@ class ChatbotCard:
|
|
|
8224
8354
|
_guard_scalar('ChatbotCard.placeholder', placeholder, (str,), False, True, False)
|
|
8225
8355
|
_guard_vector('ChatbotCard.events', events, (str,), False, True, False)
|
|
8226
8356
|
_guard_scalar('ChatbotCard.generating', generating, (bool,), False, True, False)
|
|
8357
|
+
_guard_vector('ChatbotCard.suggestions', suggestions, (ChatSuggestion,), False, True, False)
|
|
8358
|
+
_guard_scalar('ChatbotCard.disabled', disabled, (bool,), False, True, False)
|
|
8227
8359
|
_guard_vector('ChatbotCard.commands', commands, (Command,), False, True, False)
|
|
8228
8360
|
self.box = box
|
|
8229
8361
|
"""A string indicating how to place this component on the page."""
|
|
@@ -8234,9 +8366,13 @@ class ChatbotCard:
|
|
|
8234
8366
|
self.placeholder = placeholder
|
|
8235
8367
|
"""Chat input box placeholder. Use for prompt examples."""
|
|
8236
8368
|
self.events = events
|
|
8237
|
-
"""The events to capture on this chatbot. One of 'stop'."""
|
|
8369
|
+
"""The events to capture on this chatbot. One of 'stop' | 'scroll_up' | 'feedback' | 'suggestion'."""
|
|
8238
8370
|
self.generating = generating
|
|
8239
8371
|
"""True to show a button to stop the text generation. Defaults to False."""
|
|
8372
|
+
self.suggestions = suggestions
|
|
8373
|
+
"""Clickable prompt suggestions shown below the last response."""
|
|
8374
|
+
self.disabled = disabled
|
|
8375
|
+
"""True if the user input should be disabled."""
|
|
8240
8376
|
self.commands = commands
|
|
8241
8377
|
"""Contextual menu commands for this component."""
|
|
8242
8378
|
|
|
@@ -8247,6 +8383,8 @@ class ChatbotCard:
|
|
|
8247
8383
|
_guard_scalar('ChatbotCard.placeholder', self.placeholder, (str,), False, True, False)
|
|
8248
8384
|
_guard_vector('ChatbotCard.events', self.events, (str,), False, True, False)
|
|
8249
8385
|
_guard_scalar('ChatbotCard.generating', self.generating, (bool,), False, True, False)
|
|
8386
|
+
_guard_vector('ChatbotCard.suggestions', self.suggestions, (ChatSuggestion,), False, True, False)
|
|
8387
|
+
_guard_scalar('ChatbotCard.disabled', self.disabled, (bool,), False, True, False)
|
|
8250
8388
|
_guard_vector('ChatbotCard.commands', self.commands, (Command,), False, True, False)
|
|
8251
8389
|
return _dump(
|
|
8252
8390
|
view='chatbot',
|
|
@@ -8256,6 +8394,8 @@ class ChatbotCard:
|
|
|
8256
8394
|
placeholder=self.placeholder,
|
|
8257
8395
|
events=self.events,
|
|
8258
8396
|
generating=self.generating,
|
|
8397
|
+
suggestions=None if self.suggestions is None else [__e.dump() for __e in self.suggestions],
|
|
8398
|
+
disabled=self.disabled,
|
|
8259
8399
|
commands=None if self.commands is None else [__e.dump() for __e in self.commands],
|
|
8260
8400
|
)
|
|
8261
8401
|
|
|
@@ -8273,6 +8413,10 @@ class ChatbotCard:
|
|
|
8273
8413
|
_guard_vector('ChatbotCard.events', __d_events, (str,), False, True, False)
|
|
8274
8414
|
__d_generating: Any = __d.get('generating')
|
|
8275
8415
|
_guard_scalar('ChatbotCard.generating', __d_generating, (bool,), False, True, False)
|
|
8416
|
+
__d_suggestions: Any = __d.get('suggestions')
|
|
8417
|
+
_guard_vector('ChatbotCard.suggestions', __d_suggestions, (dict,), False, True, False)
|
|
8418
|
+
__d_disabled: Any = __d.get('disabled')
|
|
8419
|
+
_guard_scalar('ChatbotCard.disabled', __d_disabled, (bool,), False, True, False)
|
|
8276
8420
|
__d_commands: Any = __d.get('commands')
|
|
8277
8421
|
_guard_vector('ChatbotCard.commands', __d_commands, (dict,), False, True, False)
|
|
8278
8422
|
box: str = __d_box
|
|
@@ -8281,6 +8425,8 @@ class ChatbotCard:
|
|
|
8281
8425
|
placeholder: Optional[str] = __d_placeholder
|
|
8282
8426
|
events: Optional[List[str]] = __d_events
|
|
8283
8427
|
generating: Optional[bool] = __d_generating
|
|
8428
|
+
suggestions: Optional[List[ChatSuggestion]] = None if __d_suggestions is None else [ChatSuggestion.load(__e) for __e in __d_suggestions]
|
|
8429
|
+
disabled: Optional[bool] = __d_disabled
|
|
8284
8430
|
commands: Optional[List[Command]] = None if __d_commands is None else [Command.load(__e) for __e in __d_commands]
|
|
8285
8431
|
return ChatbotCard(
|
|
8286
8432
|
box,
|
|
@@ -8289,6 +8435,8 @@ class ChatbotCard:
|
|
|
8289
8435
|
placeholder,
|
|
8290
8436
|
events,
|
|
8291
8437
|
generating,
|
|
8438
|
+
suggestions,
|
|
8439
|
+
disabled,
|
|
8292
8440
|
commands,
|
|
8293
8441
|
)
|
|
8294
8442
|
|
|
@@ -9608,11 +9756,13 @@ class MarkdownCard:
|
|
|
9608
9756
|
title: str,
|
|
9609
9757
|
content: str,
|
|
9610
9758
|
data: Optional[PackedRecord] = None,
|
|
9759
|
+
compact: Optional[bool] = None,
|
|
9611
9760
|
commands: Optional[List[Command]] = None,
|
|
9612
9761
|
):
|
|
9613
9762
|
_guard_scalar('MarkdownCard.box', box, (str,), False, False, False)
|
|
9614
9763
|
_guard_scalar('MarkdownCard.title', title, (str,), False, False, False)
|
|
9615
9764
|
_guard_scalar('MarkdownCard.content', content, (str,), False, False, False)
|
|
9765
|
+
_guard_scalar('MarkdownCard.compact', compact, (bool,), False, True, False)
|
|
9616
9766
|
_guard_vector('MarkdownCard.commands', commands, (Command,), False, True, False)
|
|
9617
9767
|
self.box = box
|
|
9618
9768
|
"""A string indicating how to place this component on the page."""
|
|
@@ -9622,6 +9772,8 @@ class MarkdownCard:
|
|
|
9622
9772
|
"""The markdown content. Supports Github Flavored Markdown (GFM): https://guides.github.com/features/mastering-markdown/"""
|
|
9623
9773
|
self.data = data
|
|
9624
9774
|
"""Additional data for the card."""
|
|
9775
|
+
self.compact = compact
|
|
9776
|
+
"""Make spacing tighter. Defaults to True."""
|
|
9625
9777
|
self.commands = commands
|
|
9626
9778
|
"""Contextual menu commands for this component."""
|
|
9627
9779
|
|
|
@@ -9630,6 +9782,7 @@ class MarkdownCard:
|
|
|
9630
9782
|
_guard_scalar('MarkdownCard.box', self.box, (str,), False, False, False)
|
|
9631
9783
|
_guard_scalar('MarkdownCard.title', self.title, (str,), False, False, False)
|
|
9632
9784
|
_guard_scalar('MarkdownCard.content', self.content, (str,), False, False, False)
|
|
9785
|
+
_guard_scalar('MarkdownCard.compact', self.compact, (bool,), False, True, False)
|
|
9633
9786
|
_guard_vector('MarkdownCard.commands', self.commands, (Command,), False, True, False)
|
|
9634
9787
|
return _dump(
|
|
9635
9788
|
view='markdown',
|
|
@@ -9637,6 +9790,7 @@ class MarkdownCard:
|
|
|
9637
9790
|
title=self.title,
|
|
9638
9791
|
content=self.content,
|
|
9639
9792
|
data=self.data,
|
|
9793
|
+
compact=self.compact,
|
|
9640
9794
|
commands=None if self.commands is None else [__e.dump() for __e in self.commands],
|
|
9641
9795
|
)
|
|
9642
9796
|
|
|
@@ -9650,18 +9804,22 @@ class MarkdownCard:
|
|
|
9650
9804
|
__d_content: Any = __d.get('content')
|
|
9651
9805
|
_guard_scalar('MarkdownCard.content', __d_content, (str,), False, False, False)
|
|
9652
9806
|
__d_data: Any = __d.get('data')
|
|
9807
|
+
__d_compact: Any = __d.get('compact')
|
|
9808
|
+
_guard_scalar('MarkdownCard.compact', __d_compact, (bool,), False, True, False)
|
|
9653
9809
|
__d_commands: Any = __d.get('commands')
|
|
9654
9810
|
_guard_vector('MarkdownCard.commands', __d_commands, (dict,), False, True, False)
|
|
9655
9811
|
box: str = __d_box
|
|
9656
9812
|
title: str = __d_title
|
|
9657
9813
|
content: str = __d_content
|
|
9658
9814
|
data: Optional[PackedRecord] = __d_data
|
|
9815
|
+
compact: Optional[bool] = __d_compact
|
|
9659
9816
|
commands: Optional[List[Command]] = None if __d_commands is None else [Command.load(__e) for __e in __d_commands]
|
|
9660
9817
|
return MarkdownCard(
|
|
9661
9818
|
box,
|
|
9662
9819
|
title,
|
|
9663
9820
|
content,
|
|
9664
9821
|
data,
|
|
9822
|
+
compact,
|
|
9665
9823
|
commands,
|
|
9666
9824
|
)
|
|
9667
9825
|
|
|
@@ -12684,15 +12842,19 @@ class TallStatsCard:
|
|
|
12684
12842
|
self,
|
|
12685
12843
|
box: str,
|
|
12686
12844
|
items: List[Stat],
|
|
12845
|
+
name: Optional[str] = None,
|
|
12687
12846
|
commands: Optional[List[Command]] = None,
|
|
12688
12847
|
):
|
|
12689
12848
|
_guard_scalar('TallStatsCard.box', box, (str,), False, False, False)
|
|
12690
12849
|
_guard_vector('TallStatsCard.items', items, (Stat,), False, False, False)
|
|
12850
|
+
_guard_scalar('TallStatsCard.name', name, (str,), False, True, False)
|
|
12691
12851
|
_guard_vector('TallStatsCard.commands', commands, (Command,), False, True, False)
|
|
12692
12852
|
self.box = box
|
|
12693
12853
|
"""A string indicating how to place this component on the page."""
|
|
12694
12854
|
self.items = items
|
|
12695
12855
|
"""The individual stats to be displayed."""
|
|
12856
|
+
self.name = name
|
|
12857
|
+
"""An identifying name for this component."""
|
|
12696
12858
|
self.commands = commands
|
|
12697
12859
|
"""Contextual menu commands for this component."""
|
|
12698
12860
|
|
|
@@ -12700,11 +12862,13 @@ class TallStatsCard:
|
|
|
12700
12862
|
"""Returns the contents of this object as a dict."""
|
|
12701
12863
|
_guard_scalar('TallStatsCard.box', self.box, (str,), False, False, False)
|
|
12702
12864
|
_guard_vector('TallStatsCard.items', self.items, (Stat,), False, False, False)
|
|
12865
|
+
_guard_scalar('TallStatsCard.name', self.name, (str,), False, True, False)
|
|
12703
12866
|
_guard_vector('TallStatsCard.commands', self.commands, (Command,), False, True, False)
|
|
12704
12867
|
return _dump(
|
|
12705
12868
|
view='tall_stats',
|
|
12706
12869
|
box=self.box,
|
|
12707
12870
|
items=[__e.dump() for __e in self.items],
|
|
12871
|
+
name=self.name,
|
|
12708
12872
|
commands=None if self.commands is None else [__e.dump() for __e in self.commands],
|
|
12709
12873
|
)
|
|
12710
12874
|
|
|
@@ -12715,14 +12879,18 @@ class TallStatsCard:
|
|
|
12715
12879
|
_guard_scalar('TallStatsCard.box', __d_box, (str,), False, False, False)
|
|
12716
12880
|
__d_items: Any = __d.get('items')
|
|
12717
12881
|
_guard_vector('TallStatsCard.items', __d_items, (dict,), False, False, False)
|
|
12882
|
+
__d_name: Any = __d.get('name')
|
|
12883
|
+
_guard_scalar('TallStatsCard.name', __d_name, (str,), False, True, False)
|
|
12718
12884
|
__d_commands: Any = __d.get('commands')
|
|
12719
12885
|
_guard_vector('TallStatsCard.commands', __d_commands, (dict,), False, True, False)
|
|
12720
12886
|
box: str = __d_box
|
|
12721
12887
|
items: List[Stat] = [Stat.load(__e) for __e in __d_items]
|
|
12888
|
+
name: Optional[str] = __d_name
|
|
12722
12889
|
commands: Optional[List[Command]] = None if __d_commands is None else [Command.load(__e) for __e in __d_commands]
|
|
12723
12890
|
return TallStatsCard(
|
|
12724
12891
|
box,
|
|
12725
12892
|
items,
|
|
12893
|
+
name,
|
|
12726
12894
|
commands,
|
|
12727
12895
|
)
|
|
12728
12896
|
|
h2o_wave/ui.py
CHANGED
|
@@ -58,6 +58,8 @@ def command(
|
|
|
58
58
|
icon: Optional[str] = None,
|
|
59
59
|
items: Optional[List[Command]] = None,
|
|
60
60
|
value: Optional[str] = None,
|
|
61
|
+
path: Optional[str] = None,
|
|
62
|
+
download: Optional[bool] = None,
|
|
61
63
|
) -> Command:
|
|
62
64
|
"""Create a command.
|
|
63
65
|
|
|
@@ -70,6 +72,8 @@ def command(
|
|
|
70
72
|
icon: The icon to be displayed for this command.
|
|
71
73
|
items: Sub-commands, if any
|
|
72
74
|
value: Data associated with this command, if any.
|
|
75
|
+
path: The path or URL to link to. The 'items' and 'value' props are ignored when specified.
|
|
76
|
+
download: True if the link should prompt the user to save the linked URL instead of navigating to it.
|
|
73
77
|
Returns:
|
|
74
78
|
A `h2o_wave.types.Command` instance.
|
|
75
79
|
"""
|
|
@@ -80,6 +84,8 @@ def command(
|
|
|
80
84
|
icon,
|
|
81
85
|
items,
|
|
82
86
|
value,
|
|
87
|
+
path,
|
|
88
|
+
download,
|
|
83
89
|
)
|
|
84
90
|
|
|
85
91
|
|
|
@@ -398,6 +404,7 @@ def textbox(
|
|
|
398
404
|
visible: Optional[bool] = None,
|
|
399
405
|
tooltip: Optional[str] = None,
|
|
400
406
|
spellcheck: Optional[bool] = None,
|
|
407
|
+
type: Optional[str] = None,
|
|
401
408
|
) -> Component:
|
|
402
409
|
"""Create a text box.
|
|
403
410
|
|
|
@@ -426,6 +433,7 @@ def textbox(
|
|
|
426
433
|
visible: True if the component should be visible. Defaults to True.
|
|
427
434
|
tooltip: An optional tooltip message displayed when a user clicks the help icon to the right of the component.
|
|
428
435
|
spellcheck: True if the text may be checked for spelling errors. Defaults to True.
|
|
436
|
+
type: Keyboard to be shown on mobile devices. Defaults to 'text'. One of 'text', 'number', 'tel'. See enum h2o_wave.ui.TextboxType.
|
|
429
437
|
Returns:
|
|
430
438
|
A `h2o_wave.types.Textbox` instance.
|
|
431
439
|
"""
|
|
@@ -450,6 +458,7 @@ def textbox(
|
|
|
450
458
|
visible,
|
|
451
459
|
tooltip,
|
|
452
460
|
spellcheck,
|
|
461
|
+
type,
|
|
453
462
|
))
|
|
454
463
|
|
|
455
464
|
|
|
@@ -2156,6 +2165,7 @@ def stat(
|
|
|
2156
2165
|
caption: Optional[str] = None,
|
|
2157
2166
|
icon: Optional[str] = None,
|
|
2158
2167
|
icon_color: Optional[str] = None,
|
|
2168
|
+
name: Optional[str] = None,
|
|
2159
2169
|
) -> Stat:
|
|
2160
2170
|
"""Create a stat (a label-value pair) for displaying a metric.
|
|
2161
2171
|
|
|
@@ -2165,6 +2175,7 @@ def stat(
|
|
|
2165
2175
|
caption: The caption displayed below the primary value.
|
|
2166
2176
|
icon: An optional icon, displayed next to the label.
|
|
2167
2177
|
icon_color: The color of the icon.
|
|
2178
|
+
name: An identifying name for this item.
|
|
2168
2179
|
Returns:
|
|
2169
2180
|
A `h2o_wave.types.Stat` instance.
|
|
2170
2181
|
"""
|
|
@@ -2174,6 +2185,7 @@ def stat(
|
|
|
2174
2185
|
caption,
|
|
2175
2186
|
icon,
|
|
2176
2187
|
icon_color,
|
|
2188
|
+
name,
|
|
2177
2189
|
)
|
|
2178
2190
|
|
|
2179
2191
|
|
|
@@ -2183,6 +2195,7 @@ def stats(
|
|
|
2183
2195
|
inset: Optional[bool] = None,
|
|
2184
2196
|
width: Optional[str] = None,
|
|
2185
2197
|
visible: Optional[bool] = None,
|
|
2198
|
+
name: Optional[str] = None,
|
|
2186
2199
|
) -> Component:
|
|
2187
2200
|
"""Create a set of stats laid out horizontally.
|
|
2188
2201
|
|
|
@@ -2192,6 +2205,7 @@ def stats(
|
|
|
2192
2205
|
inset: Whether to display the stats with a contrasting background.
|
|
2193
2206
|
width: The width of the stats, e.g. '100px'.
|
|
2194
2207
|
visible: True if the component should be visible. Defaults to True.
|
|
2208
|
+
name: An identifying name for this component.
|
|
2195
2209
|
Returns:
|
|
2196
2210
|
A `h2o_wave.types.Stats` instance.
|
|
2197
2211
|
"""
|
|
@@ -2201,6 +2215,7 @@ def stats(
|
|
|
2201
2215
|
inset,
|
|
2202
2216
|
width,
|
|
2203
2217
|
visible,
|
|
2218
|
+
name,
|
|
2204
2219
|
))
|
|
2205
2220
|
|
|
2206
2221
|
|
|
@@ -2617,6 +2632,7 @@ def copyable_text(
|
|
|
2617
2632
|
name: Optional[str] = None,
|
|
2618
2633
|
multiline: Optional[bool] = None,
|
|
2619
2634
|
height: Optional[str] = None,
|
|
2635
|
+
width: Optional[str] = None,
|
|
2620
2636
|
) -> Component:
|
|
2621
2637
|
"""Create a copyable text component.
|
|
2622
2638
|
Use this component when you want to enable your users to quickly copy paste sections of text.
|
|
@@ -2627,6 +2643,7 @@ def copyable_text(
|
|
|
2627
2643
|
name: An identifying name for this component.
|
|
2628
2644
|
multiline: True if the component should allow multi-line text entry.
|
|
2629
2645
|
height: Custom height in px (e.g. '200px') or '1' to fill the remaining card space. Requires `multiline` to be set.
|
|
2646
|
+
width: The width of the copyable text , e.g. '100px'.
|
|
2630
2647
|
Returns:
|
|
2631
2648
|
A `h2o_wave.types.CopyableText` instance.
|
|
2632
2649
|
"""
|
|
@@ -2636,6 +2653,7 @@ def copyable_text(
|
|
|
2636
2653
|
name,
|
|
2637
2654
|
multiline,
|
|
2638
2655
|
height,
|
|
2656
|
+
width,
|
|
2639
2657
|
))
|
|
2640
2658
|
|
|
2641
2659
|
|
|
@@ -2869,6 +2887,30 @@ def chat_card(
|
|
|
2869
2887
|
)
|
|
2870
2888
|
|
|
2871
2889
|
|
|
2890
|
+
def chat_suggestion(
|
|
2891
|
+
name: str,
|
|
2892
|
+
label: str,
|
|
2893
|
+
caption: Optional[str] = None,
|
|
2894
|
+
icon: Optional[str] = None,
|
|
2895
|
+
) -> ChatSuggestion:
|
|
2896
|
+
"""Create a chat prompt suggestion displayed as button below the last response in the chatbot component.
|
|
2897
|
+
|
|
2898
|
+
Args:
|
|
2899
|
+
name: An identifying name for this component.
|
|
2900
|
+
label: The text displayed for this suggestion.
|
|
2901
|
+
caption: The caption displayed below the label.
|
|
2902
|
+
icon: The icon to be displayed for this suggestion.
|
|
2903
|
+
Returns:
|
|
2904
|
+
A `h2o_wave.types.ChatSuggestion` instance.
|
|
2905
|
+
"""
|
|
2906
|
+
return ChatSuggestion(
|
|
2907
|
+
name,
|
|
2908
|
+
label,
|
|
2909
|
+
caption,
|
|
2910
|
+
icon,
|
|
2911
|
+
)
|
|
2912
|
+
|
|
2913
|
+
|
|
2872
2914
|
def chatbot_card(
|
|
2873
2915
|
box: str,
|
|
2874
2916
|
name: str,
|
|
@@ -2876,6 +2918,8 @@ def chatbot_card(
|
|
|
2876
2918
|
placeholder: Optional[str] = None,
|
|
2877
2919
|
events: Optional[List[str]] = None,
|
|
2878
2920
|
generating: Optional[bool] = None,
|
|
2921
|
+
suggestions: Optional[List[ChatSuggestion]] = None,
|
|
2922
|
+
disabled: Optional[bool] = None,
|
|
2879
2923
|
commands: Optional[List[Command]] = None,
|
|
2880
2924
|
) -> ChatbotCard:
|
|
2881
2925
|
"""Create a chatbot card to allow getting prompts from users and providing them with LLM generated answers.
|
|
@@ -2885,8 +2929,10 @@ def chatbot_card(
|
|
|
2885
2929
|
name: An identifying name for this component.
|
|
2886
2930
|
data: Chat messages data. Requires cyclic buffer.
|
|
2887
2931
|
placeholder: Chat input box placeholder. Use for prompt examples.
|
|
2888
|
-
events: The events to capture on this chatbot. One of 'stop'.
|
|
2932
|
+
events: The events to capture on this chatbot. One of 'stop' | 'scroll_up' | 'feedback' | 'suggestion'.
|
|
2889
2933
|
generating: True to show a button to stop the text generation. Defaults to False.
|
|
2934
|
+
suggestions: Clickable prompt suggestions shown below the last response.
|
|
2935
|
+
disabled: True if the user input should be disabled.
|
|
2890
2936
|
commands: Contextual menu commands for this component.
|
|
2891
2937
|
Returns:
|
|
2892
2938
|
A `h2o_wave.types.ChatbotCard` instance.
|
|
@@ -2898,6 +2944,8 @@ def chatbot_card(
|
|
|
2898
2944
|
placeholder,
|
|
2899
2945
|
events,
|
|
2900
2946
|
generating,
|
|
2947
|
+
suggestions,
|
|
2948
|
+
disabled,
|
|
2901
2949
|
commands,
|
|
2902
2950
|
)
|
|
2903
2951
|
|
|
@@ -3388,6 +3436,7 @@ def markdown_card(
|
|
|
3388
3436
|
title: str,
|
|
3389
3437
|
content: str,
|
|
3390
3438
|
data: Optional[PackedRecord] = None,
|
|
3439
|
+
compact: Optional[bool] = None,
|
|
3391
3440
|
commands: Optional[List[Command]] = None,
|
|
3392
3441
|
) -> MarkdownCard:
|
|
3393
3442
|
"""Create a card that renders Markdown content.
|
|
@@ -3402,6 +3451,7 @@ def markdown_card(
|
|
|
3402
3451
|
title: The title for this card.
|
|
3403
3452
|
content: The markdown content. Supports Github Flavored Markdown (GFM): https://guides.github.com/features/mastering-markdown/
|
|
3404
3453
|
data: Additional data for the card.
|
|
3454
|
+
compact: Make spacing tighter. Defaults to True.
|
|
3405
3455
|
commands: Contextual menu commands for this component.
|
|
3406
3456
|
Returns:
|
|
3407
3457
|
A `h2o_wave.types.MarkdownCard` instance.
|
|
@@ -3411,6 +3461,7 @@ def markdown_card(
|
|
|
3411
3461
|
title,
|
|
3412
3462
|
content,
|
|
3413
3463
|
data,
|
|
3464
|
+
compact,
|
|
3414
3465
|
commands,
|
|
3415
3466
|
)
|
|
3416
3467
|
|
|
@@ -4501,6 +4552,7 @@ def tall_series_stat_card(
|
|
|
4501
4552
|
def tall_stats_card(
|
|
4502
4553
|
box: str,
|
|
4503
4554
|
items: List[Stat],
|
|
4555
|
+
name: Optional[str] = None,
|
|
4504
4556
|
commands: Optional[List[Command]] = None,
|
|
4505
4557
|
) -> TallStatsCard:
|
|
4506
4558
|
"""Create a vertical label-value pairs collection. Icon in `ui.stat` is not yet supported in this card.
|
|
@@ -4508,6 +4560,7 @@ def tall_stats_card(
|
|
|
4508
4560
|
Args:
|
|
4509
4561
|
box: A string indicating how to place this component on the page.
|
|
4510
4562
|
items: The individual stats to be displayed.
|
|
4563
|
+
name: An identifying name for this component.
|
|
4511
4564
|
commands: Contextual menu commands for this component.
|
|
4512
4565
|
Returns:
|
|
4513
4566
|
A `h2o_wave.types.TallStatsCard` instance.
|
|
@@ -4515,6 +4568,7 @@ def tall_stats_card(
|
|
|
4515
4568
|
return TallStatsCard(
|
|
4516
4569
|
box,
|
|
4517
4570
|
items,
|
|
4571
|
+
name,
|
|
4518
4572
|
commands,
|
|
4519
4573
|
)
|
|
4520
4574
|
|
h2o_wave/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '1.
|
|
1
|
+
__version__ = '1.1.1'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
h2o_wave/__init__.py,sha256=XIclw-HLtXgr0wNf5eQpkh6ZiqD9QAoiS-vZhp3IR5k,1674
|
|
2
2
|
h2o_wave/__main__.py,sha256=MoNOW43ppIqCdY3iq0n25Q3SKLyk8Igg5fD_sSROK4c,638
|
|
3
|
-
h2o_wave/cli.py,sha256=
|
|
3
|
+
h2o_wave/cli.py,sha256=XZVNSF5vPq3EVhZs_Q0Jq1t8stTF4BdbTvZIQmEIsgE,13603
|
|
4
4
|
h2o_wave/core.py,sha256=whFb-Z2wokNXe_39I8aL3i7JOx6eczRfWOkn5wb_YwM,39087
|
|
5
5
|
h2o_wave/db.py,sha256=H3W_EyMfnwr4UjqPVoAsE19O2QzY1ptIYGMOqU0YUQo,7489
|
|
6
6
|
h2o_wave/graphics.py,sha256=HLYrX-lwsMKbyLmy2ClG5L46DA2_hSCEPTsv0gPVoyg,25866
|
|
@@ -11,12 +11,12 @@ h2o_wave/routing.py,sha256=de8GVfUAb6bwFXtsWj6NXmjMVGELknlZb03F-R4ManY,10592
|
|
|
11
11
|
h2o_wave/server.py,sha256=u80Jma83mMKqmTitVDFO703SrcC4Y29DQM2letSVNyA,17900
|
|
12
12
|
h2o_wave/share.py,sha256=2zgywet8540O6xM-JD3po1glyP2PBJ3lIxaWBJbQvtQ,1164
|
|
13
13
|
h2o_wave/test.py,sha256=hF_fS5e25bACnzENjpDrikv7nPOs0iENh4MuXX9BaVA,2738
|
|
14
|
-
h2o_wave/types.py,sha256=
|
|
15
|
-
h2o_wave/ui.py,sha256=
|
|
14
|
+
h2o_wave/types.py,sha256=Wxe-osfyCgtN9ihYLpEfTlbX7sHzAN6UHxIBdIbaBSs,653120
|
|
15
|
+
h2o_wave/ui.py,sha256=3L07AhP0z2yl61gO9eeJp3RIgJQFwC_fUIkibPnHXJc,170389
|
|
16
16
|
h2o_wave/ui_ext.py,sha256=zx_2Ec2-p_ztm8brfVaVF0fTQWVDrb_YxcGfVb-wA10,2325
|
|
17
|
-
h2o_wave/version.py,sha256=
|
|
18
|
-
h2o_wave-1.
|
|
19
|
-
h2o_wave-1.
|
|
20
|
-
h2o_wave-1.
|
|
21
|
-
h2o_wave-1.
|
|
22
|
-
h2o_wave-1.
|
|
17
|
+
h2o_wave/version.py,sha256=E-6wAZjiLRVInABFxrWoqdYlO_t-zVhK8XNfNnaDyzI,22
|
|
18
|
+
h2o_wave-1.1.1.dist-info/METADATA,sha256=dl7rJg_AEth1I2arYoI-wz7XLS9lu5cnqKOmkjasAsI,2907
|
|
19
|
+
h2o_wave-1.1.1.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
|
|
20
|
+
h2o_wave-1.1.1.dist-info/entry_points.txt,sha256=kFeXNqSZlW1_H7YcRdSOhz5V00F4vhDQ0NuDuvRwLGw,43
|
|
21
|
+
h2o_wave-1.1.1.dist-info/licenses/LICENSE,sha256=hpuFayniDwysSKD0tHGELH2KJDVyhUrKS29torRIpqY,53
|
|
22
|
+
h2o_wave-1.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|