finish is-1
This commit is contained in:
parent
db25e5ed30
commit
7454728340
2 changed files with 6 additions and 2 deletions
|
|
@ -405,11 +405,13 @@ class Canvas(Graph):
|
|||
_m += m
|
||||
cpn_obj.set_output("content", _m)
|
||||
cite = re.search(r"\[ID:[ 0-9]+\]", _m)
|
||||
elif isinstance(cpn_obj.output("attachment"), tuple):
|
||||
yield decorate("message", {"attachment": cpn_obj.output("attachment")})
|
||||
else:
|
||||
yield decorate("message", {"content": cpn_obj.output("content")})
|
||||
cite = re.search(r"\[ID:[ 0-9]+\]", cpn_obj.output("content"))
|
||||
|
||||
if isinstance(cpn_obj.output("attachment"), tuple):
|
||||
yield decorate("message", {"attachment": cpn_obj.output("attachment")})
|
||||
|
||||
yield decorate("message_end", {"reference": self.get_reference() if cite else None})
|
||||
|
||||
while partials:
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ class Message(ComponentBase):
|
|||
for n, v in kwargs.items():
|
||||
content = re.sub(n, v, content)
|
||||
|
||||
self.set_output("content", content)
|
||||
self._convert_content(content)
|
||||
|
||||
def thoughts(self) -> str:
|
||||
|
|
@ -222,6 +223,7 @@ class Message(ComponentBase):
|
|||
|
||||
settings.STORAGE_IMPL.put(self._canvas._tenant_id, doc_id, binary_content)
|
||||
|
||||
# document id, format, filename
|
||||
self.set_output("attachment", (doc_id, self._param.output_format, f"{doc_id[:8]}.{self._param.output_format}"))
|
||||
|
||||
logging.info(f"Converted content uploaded as {doc_id} (format={self._param.output_format})")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue