mirror of https://github.com/langgenius/dify.git
fix: fix basedpyright errors
This commit is contained in:
parent
2a532ab729
commit
d6d9554954
|
|
@ -1,7 +1,7 @@
|
|||
import json
|
||||
import sys
|
||||
from collections.abc import Mapping, Sequence
|
||||
from typing import Annotated, Any, TypeAlias, Self
|
||||
from typing import Annotated, Any, TypeAlias
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Discriminator, Tag, field_validator
|
||||
|
||||
|
|
@ -211,8 +211,8 @@ class VersionedMemoryValue(BaseModel):
|
|||
def add_version(
|
||||
self,
|
||||
new_value: str,
|
||||
version_name: Optional[str] = None
|
||||
) -> Self:
|
||||
version_name: str | None = None
|
||||
) -> "VersionedMemoryValue":
|
||||
if version_name is None:
|
||||
version_name = str(len(self.versions) + 1)
|
||||
if version_name in self.versions.keys():
|
||||
|
|
@ -228,7 +228,7 @@ class VersionedMemoryValue(BaseModel):
|
|||
|
||||
class VersionedMemorySegment(Segment):
|
||||
value_type: SegmentType = SegmentType.VERSIONED_MEMORY
|
||||
value: VersionedMemoryValue
|
||||
value: VersionedMemoryValue = None # type: ignore
|
||||
|
||||
@property
|
||||
def text(self) -> str:
|
||||
|
|
|
|||
|
|
@ -1277,7 +1277,7 @@ class WorkflowDraftVariable(Base):
|
|||
def new_memory_block_variable(
|
||||
*,
|
||||
app_id: str,
|
||||
node_id: Optional[str] = None,
|
||||
node_id: str | None = None,
|
||||
memory_id: str,
|
||||
name: str,
|
||||
value: str,
|
||||
|
|
|
|||
Loading…
Reference in New Issue