feat: Parallel Execution of Nodes in Workflows (#8192)

Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
Co-authored-by: Yi <yxiaoisme@gmail.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
takatost 2024-09-10 15:23:16 +08:00 • committed by GitHub
commit dabfd74622
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
156 changed files with 11158 additions and 5605 deletions

View file

@ -34,13 +34,13 @@ class OutputModeration(BaseModel):
final_output: Optional[str] = None
model_config = ConfigDict(arbitrary_types_allowed=True)
def should_direct_output(self):
def should_direct_output(self) -> bool:
return self.final_output is not None
def get_final_output(self):
return self.final_output
def get_final_output(self) -> str:
return self.final_output or ""
def append_new_token(self, token: str):
def append_new_token(self, token: str) -> None:
self.buffer += token
if not self.thread: