|
@@ -39,12 +39,14 @@ class AdvancedChatAppRunner(WorkflowBasedAppRunner):
|
|
queue_manager: AppQueueManager,
|
|
queue_manager: AppQueueManager,
|
|
conversation: Conversation,
|
|
conversation: Conversation,
|
|
message: Message,
|
|
message: Message,
|
|
|
|
+ dialogue_count: int,
|
|
) -> None:
|
|
) -> None:
|
|
super().__init__(queue_manager)
|
|
super().__init__(queue_manager)
|
|
|
|
|
|
self.application_generate_entity = application_generate_entity
|
|
self.application_generate_entity = application_generate_entity
|
|
self.conversation = conversation
|
|
self.conversation = conversation
|
|
self.message = message
|
|
self.message = message
|
|
|
|
+ self._dialogue_count = dialogue_count
|
|
|
|
|
|
def run(self) -> None:
|
|
def run(self) -> None:
|
|
app_config = self.application_generate_entity.app_config
|
|
app_config = self.application_generate_entity.app_config
|
|
@@ -122,19 +124,13 @@ class AdvancedChatAppRunner(WorkflowBasedAppRunner):
|
|
|
|
|
|
session.commit()
|
|
session.commit()
|
|
|
|
|
|
- # Increment dialogue count.
|
|
|
|
- self.conversation.dialogue_count += 1
|
|
|
|
-
|
|
|
|
- conversation_dialogue_count = self.conversation.dialogue_count
|
|
|
|
- db.session.commit()
|
|
|
|
-
|
|
|
|
# Create a variable pool.
|
|
# Create a variable pool.
|
|
system_inputs = {
|
|
system_inputs = {
|
|
SystemVariableKey.QUERY: query,
|
|
SystemVariableKey.QUERY: query,
|
|
SystemVariableKey.FILES: files,
|
|
SystemVariableKey.FILES: files,
|
|
SystemVariableKey.CONVERSATION_ID: self.conversation.id,
|
|
SystemVariableKey.CONVERSATION_ID: self.conversation.id,
|
|
SystemVariableKey.USER_ID: user_id,
|
|
SystemVariableKey.USER_ID: user_id,
|
|
- SystemVariableKey.DIALOGUE_COUNT: conversation_dialogue_count,
|
|
|
|
|
|
+ SystemVariableKey.DIALOGUE_COUNT: self._dialogue_count,
|
|
SystemVariableKey.APP_ID: app_config.app_id,
|
|
SystemVariableKey.APP_ID: app_config.app_id,
|
|
SystemVariableKey.WORKFLOW_ID: app_config.workflow_id,
|
|
SystemVariableKey.WORKFLOW_ID: app_config.workflow_id,
|
|
SystemVariableKey.WORKFLOW_RUN_ID: self.application_generate_entity.workflow_run_id,
|
|
SystemVariableKey.WORKFLOW_RUN_ID: self.application_generate_entity.workflow_run_id,
|