Skip to content

Commit

Permalink
add default value for element display
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard committed May 19, 2023
1 parent 0528f18 commit 4996c4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/chainlit/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Element(ABC):
name: str
type: ElementType
display: ElementDisplay
display: ElementDisplay = "side"
forId: str = None

def __post_init__(self) -> None:
Expand Down Expand Up @@ -84,7 +84,7 @@ class LocalImage(LocalElement):
def __init__(
self,
name: str,
display: ElementDisplay,
display: ElementDisplay = "side",
path: str = None,
content: bytes = None,
):
Expand All @@ -102,15 +102,15 @@ def __init__(


class RemoteImage(RemoteElement):
def __init__(self, name: str, display: ElementDisplay, url: str):
def __init__(self, name: str, url: str, display: ElementDisplay = "side"):
self.name = name
self.display = display
self.type = "image"
self.url = url


class Text(LocalElement):
def __init__(self, name: str, display: ElementDisplay, text: str):
def __init__(self, name: str, text: str, display: ElementDisplay = "side"):
self.name = name
self.display = display
self.type = "text"
Expand Down

0 comments on commit 4996c4b

Please sign in to comment.