mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-17 23:35:52 +08:00
fix(api): Fix incorrect handling of Variable
types in VariablePool
This commit is contained in:
parent
5cfd60ca0f
commit
036f0eba2c
@ -1,11 +1,12 @@
|
|||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
from collections.abc import Mapping, Sequence
|
from collections.abc import Mapping, Sequence
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import sys
|
|
||||||
from pydantic import BaseModel, ConfigDict, field_validator
|
from pydantic import BaseModel, ConfigDict, field_validator
|
||||||
|
|
||||||
from core.file import File
|
from core.file import File
|
||||||
|
|
||||||
from .types import SegmentType
|
from .types import SegmentType
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class VariablePool(BaseModel):
|
|||||||
|
|
||||||
if isinstance(value, Variable):
|
if isinstance(value, Variable):
|
||||||
variable = value
|
variable = value
|
||||||
if isinstance(value, Segment):
|
elif isinstance(value, Segment):
|
||||||
variable = variable_factory.segment_to_variable(segment=value, selector=selector)
|
variable = variable_factory.segment_to_variable(segment=value, selector=selector)
|
||||||
else:
|
else:
|
||||||
segment = variable_factory.build_segment(value)
|
segment = variable_factory.build_segment(value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user