Merge branch 'main' into fix/chore-fix

This commit is contained in:
Yeuoly
2024-12-04 15:34:39 +08:00
288 changed files with 8067 additions and 1950 deletions

View File

@ -24,30 +24,30 @@ from .workflow import (
)
__all__ = [
"Account",
"AccountIntegrate",
"ApiToken",
"App",
"AppMode",
"Conversation",
"ConversationVariable",
"Document",
"DataSourceOauthBinding",
"Dataset",
"DatasetProcessRule",
"Document",
"DocumentSegment",
"DataSourceOauthBinding",
"AppMode",
"Workflow",
"App",
"Message",
"EndUser",
"InstalledApp",
"InvitationCode",
"Message",
"MessageAnnotation",
"MessageFile",
"RecommendedApp",
"Site",
"Tenant",
"ToolFile",
"UploadFile",
"Account",
"Workflow",
"WorkflowAppLog",
"WorkflowRun",
"Site",
"InstalledApp",
"RecommendedApp",
"ApiToken",
"AccountIntegrate",
"InvitationCode",
"Tenant",
"Conversation",
"MessageAnnotation",
"ToolFile",
]

View File

@ -243,7 +243,9 @@ class Workflow(Base):
tenant_id = contexts.tenant_id.get()
environment_variables_dict: dict[str, Any] = json.loads(self._environment_variables)
results = [variable_factory.build_variable_from_mapping(v) for v in environment_variables_dict.values()]
results = [
variable_factory.build_environment_variable_from_mapping(v) for v in environment_variables_dict.values()
]
# decrypt secret variables value
decrypt_func = (
@ -308,7 +310,7 @@ class Workflow(Base):
self._conversation_variables = "{}"
variables_dict: dict[str, Any] = json.loads(self._conversation_variables)
results = [variable_factory.build_variable_from_mapping(v) for v in variables_dict.values()]
results = [variable_factory.build_conversation_variable_from_mapping(v) for v in variables_dict.values()]
return results
@conversation_variables.setter
@ -803,4 +805,4 @@ class ConversationVariable(Base):
def to_variable(self) -> Variable:
mapping = json.loads(self.data)
return variable_factory.build_variable_from_mapping(mapping)
return variable_factory.build_conversation_variable_from_mapping(mapping)