fix knowledge single retrieve when function call response is none

This commit is contained in:
jyong 2024-03-19 17:18:29 +08:00
parent 8386abaed1
commit 1607fcfaa7
3 changed files with 18 additions and 14 deletions

View File

@ -50,11 +50,11 @@ The input text is in the variable text_field. Categories are specified as a comm
DO NOT include anything other than the JSON array in your response.
### Example
Input:
{"input_text": ["I recently had a great experience with your company. The service was prompt and the staff was very friendly."],"categories": ["Customer Service, Satisfaction, Sales, Product"], "classification_instructions": ["classify the text based on the feedback provided by customer"]}
{"input_text": ["bad service, slow to bring the food"],"categories": ["Food Quality, Experience, Price" ], "classification_instructions": []}
{{"input_text": ["I recently had a great experience with your company. The service was prompt and the staff was very friendly."],"categories": ["Customer Service, Satisfaction, Sales, Product"], "classification_instructions": ["classify the text based on the feedback provided by customer"]}}
{{"input_text": ["bad service, slow to bring the food"],"categories": ["Food Quality, Experience, Price" ], "classification_instructions": []}}
Output:
{"keywords": ["recently", "great experience", "company", "service", "prompt", "staff", "friendly"],"categories": ["Customer Service"]}
{"keywords": ["bad service", "slow", "food", "tip", "terrible", "waitresses"],"categories": ["Experience""]}
{{"keywords": ["recently", "great experience", "company", "service", "prompt", "staff", "friendly"],"categories": ["Customer Service"]}}
{{"keywords": ["bad service", "slow", "food", "tip", "terrible", "waitresses"],"categories": ["Experience""]}}
### Memory
Here is the chat histories between human and assistant, inside <histories></histories> XML tags.
### User Input

View File

@ -9,4 +9,4 @@ class VariableAssignerNodeData(BaseNodeData):
"""
type: str = 'variable-assigner'
output_type: str
variables: list[str]
variables: list[list[str]]

View File

@ -14,15 +14,19 @@ class VariableAssignerNode(BaseNode):
def _run(self, variable_pool: VariablePool) -> NodeRunResult:
node_data: VariableAssignerNodeData = cast(self._node_data_cls, self.node_data)
value = variable_pool.get_variable_value(node_data.variables)
variable_pool.append_variable(
node_id=self.node_id,
variable_key_list=node_data.variables,
value=value
)
outputs = {
"output": value
}
outputs = {}
for variable in node_data.variables:
value = variable_pool.get_variable_value(variable)
if value:
variable_pool.append_variable(
node_id=self.node_id,
variable_key_list=variable,
value=value
)
outputs = {
"output": value
}
break
return NodeRunResult(
status=WorkflowNodeExecutionStatus.SUCCEEDED,