소스 검색

Fixed the issue where recall the knowledge base in the iteration of the workflow and report errors when executing (#10060)

tags/0.11.0
JasonVV 1 년 전
부모
커밋
219f5d9845
No account linked to committer's email address
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2
    1
      api/factories/variable_factory.py

+ 2
- 1
api/factories/variable_factory.py 파일 보기

@@ -10,6 +10,7 @@ from core.variables import (
ArrayNumberVariable,
ArrayObjectSegment,
ArrayObjectVariable,
ArraySegment,
ArrayStringSegment,
ArrayStringVariable,
FileSegment,
@@ -79,7 +80,7 @@ def build_segment(value: Any, /) -> Segment:
if isinstance(value, list):
items = [build_segment(item) for item in value]
types = {item.value_type for item in items}
if len(types) != 1:
if len(types) != 1 or all(isinstance(item, ArraySegment) for item in items):
return ArrayAnySegment(value=value)
match types.pop():
case SegmentType.STRING:

Loading…
취소
저장