Add GetNotified and Notify components
This commit is contained in:
parent
d1557d8c1e
commit
9a93e5e417
3 changed files with 12 additions and 11 deletions
|
|
@ -21,20 +21,21 @@ class NotifyComponent(CustomComponent):
|
|||
def build(
|
||||
self, name: str, record: Optional[Record] = None, append: bool = False
|
||||
) -> Record:
|
||||
if state and not isinstance(state, Record):
|
||||
if isinstance(state, str):
|
||||
state = Record(text=state)
|
||||
elif isinstance(state, dict):
|
||||
state = Record(data=state)
|
||||
if record and not isinstance(record, Record):
|
||||
if isinstance(record, str):
|
||||
record = Record(text=record)
|
||||
elif isinstance(record, dict):
|
||||
record = Record(data=record)
|
||||
else:
|
||||
state = Record(text=str(state))
|
||||
elif not state:
|
||||
state = Record(text="")
|
||||
record = Record(text=str(record))
|
||||
elif not record:
|
||||
record = Record(text="")
|
||||
if record:
|
||||
if append:
|
||||
self.append_state(name, record)
|
||||
else:
|
||||
self.update_state(name, record)
|
||||
else:
|
||||
state = "No record provided."
|
||||
self.status = state
|
||||
self.status = "No record provided."
|
||||
self.status = record
|
||||
return record
|
||||
|
|
|
|||
|
|
@ -699,7 +699,7 @@ class Graph:
|
|||
return ChatVertex
|
||||
elif node_name in ["ShouldRunNext"]:
|
||||
return RoutingVertex
|
||||
elif node_name in ["SharedState"]:
|
||||
elif node_name in ["SharedState", "Notify", "GetNotified"]:
|
||||
return StateVertex
|
||||
elif node_base_type in lazy_load_vertex_dict.VERTEX_TYPE_MAP:
|
||||
return lazy_load_vertex_dict.VERTEX_TYPE_MAP[node_base_type]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue