init
ComponentState = object
module-attribute
__all__ = ['ComponentState', 'ConversationListLoaderComponent', 'IDs', 'control_area', 'control_drawer_layout', 'control_group', 'control_item', 'conversation_history_drawer_layout', 'error_notification', 'generate_error_notification', 'notification', 'render_any_message', 'render_any_messages', 'render_card_with_heading', 'render_dialog_with_heading', 'render_info_item', 'render_page_heading', 'render_slider', 'render_text_area', 'to_json_str_var']
module-attribute
ConversationListLoaderComponent
Bases: MyComponentState
Loads the conversation list (i.e. titles and uids) for the logged-in user.
Creates either a "select" dropdown for conversations, or "vstack" of clickable items
Note: Requires the .load_conversation_list_handler to be called on page load
...
on_load=[conv_list_component.State.load_conversation_list_event]
conversation_selected = ''
class-attribute
instance-attribute
conversations_list = []
class-attribute
instance-attribute
max_num_conversations_to_load = 50
class-attribute
instance-attribute
conversation_options()
For use in a select dropdown to show title but use value of uid.
get_component(mode='select', on_select_handlers=None, max_num_conversations_to_load=50, show_selection=False)
classmethod
load_conversation_list_handler()
async
set_conversation_selected(value)
IDs
Bases: SimpleNamespace
conversation_scroll_area = 'conversation-scroll-area'
class-attribute
instance-attribute
main_user_input = 'main_user_input'
class-attribute
instance-attribute
control_area(heading, items)
For grouping together multiple control groups with a heading.
control_drawer_layout(agent_selection_component=rx.fragment(), graph_info_component=rx.fragment(), update_gh_api_key_component=rx.fragment())
This provides a drawer for configs that slides in from the right.
This should be placed anywhere within the main page content (position of slide out button is fixed, and drawer is an overlay).
control_group(heading, items, mode='grid')
For grouping together multiple control items with a heading.
control_item(label, item, description=None, width=None, flex=None)
Groups together a label, item, and optional description.
conversation_history_drawer_layout(conversation_list_component)
This provides a drawer for the conversation history that slides in from the left.
This should be placed anywhere within the main page content (position of slide out button is fixed, and drawer is an overlay) 2024-04-04 -- Works if placed in the vstack Returns:
error_notification(error_message)
generate_error_notification(exception)
notification(message)
render_any_message(message)
render_any_messages(messages)
render_card_with_heading(heading, *children, width='100%', align='stretch', **props)
Creates a card with a header part that has a background color.
heading: Heading to put in the card (string or component)
*children: Children to put in the card (will be put in a vstack)
flex: flex property to use in the card
width: width of card
align: Align to use in the item vstack
**props: Additional props to pass to the card
render_dialog_with_heading(heading, content)
render_info_item(label, value, base_width='10em')
Creates basic label and value pairs for use in information displays.
render_page_heading(title)
render_slider(value=None, on_change=None, min_=None, max_=None, decimal_places=0, id_=None, str_labels=None, **slider_props)
My defaults for rx.slider.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
Value for the slider.
TYPE:
|
on_change
|
Event handler to call when the slider value changes.
TYPE:
|
min_
|
Minimum value for the slider.
TYPE:
|
max_
|
Maximum value for the slider.
TYPE:
|
decimal_places
|
Number of decimal places to round to.
TYPE:
|
id_
|
ID for the slider.
TYPE:
|
str_labels
|
Labels to show instead of exact values.
TYPE:
|
**slider_props
|
Additional properties for the slider.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Component
|
rx.Component: A slider component. |
render_text_area(id_, value, on_change, max_length=5000, max_height='30vh', placeholder=None)
to_json_str_var(data, indent=2)
Convert a var into a JSON formatted string var.