Skip to content

Commit b988d5a

Browse files
Merge branch 'main' of https://github.com/maxkb-dev/maxkb
2 parents 0172915 + afaf3d6 commit b988d5a

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

apps/application/flow/step_node/image_generate_step_node/impl/base_image_generate_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def execute(self, model_id, prompt, negative_prompt, dialogue_number, dialogue_t
4747
file_url = FileSerializer(data={'file': file, 'meta': meta}).upload()
4848
file_urls.append(file_url)
4949
self.context['image_list'] = [{'file_id': path.split('/')[-1], 'url': path} for path in file_urls]
50-
answer = '\n'.join([f"![Image]({path})" for path in file_urls])
50+
answer = ' '.join([f"![Image]({path})" for path in file_urls])
5151
return NodeResult({'answer': answer, 'chat_model': tti_model, 'message_list': message_list,
5252
'image': [{'file_id': path.split('/')[-1], 'url': path} for path in file_urls],
5353
'history_message': history_message, 'question': question}, {})

apps/application/flow/step_node/variable_assign_node/impl/base_variable_assign_node.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ def execute(self, variable_list, stream, **kwargs) -> NodeResult:
3030
val = json.loads(variable['value'])
3131
self.workflow_manage.context[variable['fields'][1]] = val
3232
result['output_value'] = variable['value'] = val
33-
else:
33+
elif variable['type'] == 'string':
3434
# 变量解析 例如:{{global.xxx}}
3535
val = self.workflow_manage.generate_prompt(variable['value'])
3636
self.workflow_manage.context[variable['fields'][1]] = val
3737
result['output_value'] = val
38+
else:
39+
val = variable['value']
40+
self.workflow_manage.context[variable['fields'][1]] = val
41+
result['output_value'] = val
3842
else:
3943
reference = self.get_reference_content(variable['reference'])
4044
self.workflow_manage.context[variable['fields'][1]] = reference

apps/application/flow/workflow_manage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ def await_result(self):
382382
break
383383
yield chunk
384384
finally:
385+
while self.is_run():
386+
pass
385387
details = self.get_runtime_details()
386388
message_tokens = sum([row.get('message_tokens') for row in details.values() if
387389
'message_tokens' in row and row.get('message_tokens') is not None])

apps/common/middleware/gzip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ def process_response(self, request, response):
4444
if response.is_async:
4545
# pull to lexical scope to capture fixed reference in case
4646
# streaming_content is set again later.
47-
orignal_iterator = response.streaming_content
47+
original_iterator = response.streaming_content
4848

4949
async def gzip_wrapper():
50-
async for chunk in orignal_iterator:
50+
async for chunk in original_iterator:
5151
yield compress_string(
5252
chunk,
5353
max_random_bytes=self.max_random_bytes,

0 commit comments

Comments
 (0)