mirror of
https://github.com/langgenius/dify.git
synced 2026-02-22 14:01:50 -05:00
feat: Human Input Node (#32060)
The frontend and backend implementation for the human input node. Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com> Co-authored-by: zhsama <torvalds@linux.do>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from datetime import datetime
|
||||
from uuid import uuid4
|
||||
|
||||
from sqlalchemy import DateTime, func
|
||||
from sqlalchemy.orm import DeclarativeBase, Mapped, MappedAsDataclass, mapped_column
|
||||
@@ -41,7 +42,7 @@ class DefaultFieldsMixin:
|
||||
)
|
||||
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
__name_pos=DateTime,
|
||||
DateTime,
|
||||
nullable=False,
|
||||
default=naive_utc_now,
|
||||
server_default=func.current_timestamp(),
|
||||
@@ -50,3 +51,16 @@ class DefaultFieldsMixin:
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
|
||||
def gen_uuidv4_string() -> str:
|
||||
"""gen_uuidv4_string generate a UUIDv4 string.
|
||||
|
||||
NOTE: This function exists only for historical reasons. New models should use uuidv7 for primary key generation.
|
||||
"""
|
||||
return str(uuid4())
|
||||
|
||||
|
||||
def gen_uuidv7_string() -> str:
|
||||
"""gen_uuidv4_string generate a UUIDv4 string."""
|
||||
return str(uuidv7())
|
||||
|
||||
Reference in New Issue
Block a user