sync update from LAN repo (source dhk-1 @ 3b1ec5b4)
This commit is contained in:
1 parent
da6521b6cb
commit
264e2200d6
995 files changed
+148105
-13399
No files matched your search
+47
-1
@@ -6,11 +6,47 @@ from abc import ABC, abstractmethod
|
||||
from typing import Any, Literal
|
||||
|
||||
LlmWikiScope = Literal["personal", "public", "all"]
|
||||
UNSET = object()
|
||||
|
||||
|
||||
def serialize_wiki_parent_directories(
|
||||
value: list[str] | None,
|
||||
) -> list[str] | None:
|
||||
return None if value is None else [str(item) for item in value]
|
||||
|
||||
|
||||
def serialize_wiki_directory_paths(
|
||||
value: list[list[str]] | None,
|
||||
) -> list[list[str]] | None:
|
||||
return (
|
||||
None
|
||||
if value is None
|
||||
else [[str(segment) for segment in path] for path in value]
|
||||
)
|
||||
|
||||
|
||||
class LlmWikiStore(ABC):
|
||||
@abstractmethod
|
||||
async def create_mapping(self, *, weknora_id: str, owner_user_id: str, name: str, description: str, kb_type: str) -> dict[str, Any]: ...
|
||||
async def create_mapping(
|
||||
self,
|
||||
*,
|
||||
weknora_id: str,
|
||||
owner_user_id: str,
|
||||
name: str,
|
||||
description: str,
|
||||
kb_type: str,
|
||||
retrieval_settings: dict[str, Any] | None = None,
|
||||
wiki_parent_directories: list[str] | None = None,
|
||||
wiki_directory_paths: list[list[str]] | None = None,
|
||||
wiki_focus_instructions: str | None = None,
|
||||
wiki_content_instructions_raw: str | None = None,
|
||||
wiki_extraction_instructions_raw: str | None = None,
|
||||
wiki_generation_managed: bool | None = None,
|
||||
wiki_config_schema_version: int | None = None,
|
||||
wiki_config_revision: int | None = None,
|
||||
wiki_config_apply_status: str | None = None,
|
||||
wiki_config_apply_error: str | None = None,
|
||||
) -> dict[str, Any]: ...
|
||||
|
||||
@abstractmethod
|
||||
async def list_visible(self, user_id: str, *, scope: LlmWikiScope = "all", is_admin: bool = False) -> list[dict[str, Any]]: ...
|
||||
@@ -33,6 +69,16 @@ class LlmWikiStore(ABC):
|
||||
retrieval_settings: dict[str, Any] | None = None,
|
||||
wiki_index_enabled: bool | None = None,
|
||||
external_search_enabled: bool | None = None,
|
||||
wiki_parent_directories: list[str] | None | object = UNSET,
|
||||
wiki_directory_paths: list[list[str]] | None | object = UNSET,
|
||||
wiki_focus_instructions: str | None | object = UNSET,
|
||||
wiki_content_instructions_raw: str | None | object = UNSET,
|
||||
wiki_extraction_instructions_raw: str | None | object = UNSET,
|
||||
wiki_generation_managed: bool | None | object = UNSET,
|
||||
wiki_config_schema_version: int | None | object = UNSET,
|
||||
wiki_config_revision: int | None | object = UNSET,
|
||||
wiki_config_apply_status: str | None | object = UNSET,
|
||||
wiki_config_apply_error: str | None | object = UNSET,
|
||||
) -> dict[str, Any] | None: ...
|
||||
|
||||
@abstractmethod
|
||||
|
||||
+128
-16
@@ -3,22 +3,58 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import UTC, datetime
|
||||
from typing import Any
|
||||
from typing import Any, cast
|
||||
from uuid import uuid4
|
||||
|
||||
from deerflow.persistence.llmwiki.base import LlmWikiScope, LlmWikiStore
|
||||
from deerflow.persistence.llmwiki.base import (
|
||||
UNSET,
|
||||
LlmWikiScope,
|
||||
LlmWikiStore,
|
||||
serialize_wiki_directory_paths,
|
||||
serialize_wiki_parent_directories,
|
||||
)
|
||||
|
||||
|
||||
def _now() -> str:
|
||||
return datetime.now(UTC).isoformat()
|
||||
|
||||
|
||||
def _mapping_to_dict(row: dict[str, Any]) -> dict[str, Any]:
|
||||
data = dict(row)
|
||||
data["wiki_parent_directories"] = serialize_wiki_parent_directories(
|
||||
data.get("wiki_parent_directories")
|
||||
)
|
||||
data["wiki_directory_paths"] = serialize_wiki_directory_paths(
|
||||
data.get("wiki_directory_paths")
|
||||
)
|
||||
return data
|
||||
|
||||
|
||||
class MemoryLlmWikiStore(LlmWikiStore):
|
||||
def __init__(self) -> None:
|
||||
self._rows: dict[str, dict[str, Any]] = {}
|
||||
self._conversation_deposits: dict[str, dict[str, Any]] = {}
|
||||
|
||||
async def create_mapping(self, *, weknora_id: str, owner_user_id: str, name: str, description: str, kb_type: str) -> dict[str, Any]:
|
||||
async def create_mapping(
|
||||
self,
|
||||
*,
|
||||
weknora_id: str,
|
||||
owner_user_id: str,
|
||||
name: str,
|
||||
description: str,
|
||||
kb_type: str,
|
||||
retrieval_settings: dict[str, Any] | None = None,
|
||||
wiki_parent_directories: list[str] | None = None,
|
||||
wiki_directory_paths: list[list[str]] | None = None,
|
||||
wiki_focus_instructions: str | None = None,
|
||||
wiki_content_instructions_raw: str | None = None,
|
||||
wiki_extraction_instructions_raw: str | None = None,
|
||||
wiki_generation_managed: bool | None = None,
|
||||
wiki_config_schema_version: int | None = None,
|
||||
wiki_config_revision: int | None = None,
|
||||
wiki_config_apply_status: str | None = None,
|
||||
wiki_config_apply_error: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
if any(row["weknora_id"] == weknora_id for row in self._rows.values()):
|
||||
raise ValueError("WeKnora knowledge base is already mapped")
|
||||
now = _now()
|
||||
@@ -29,7 +65,25 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
"name": name,
|
||||
"description": description,
|
||||
"test_questions": None,
|
||||
"retrieval_settings": None,
|
||||
"retrieval_settings": (
|
||||
dict(retrieval_settings)
|
||||
if retrieval_settings is not None
|
||||
else None
|
||||
),
|
||||
"wiki_parent_directories": serialize_wiki_parent_directories(
|
||||
wiki_parent_directories
|
||||
),
|
||||
"wiki_directory_paths": serialize_wiki_directory_paths(
|
||||
wiki_directory_paths
|
||||
),
|
||||
"wiki_focus_instructions": wiki_focus_instructions,
|
||||
"wiki_content_instructions_raw": wiki_content_instructions_raw,
|
||||
"wiki_extraction_instructions_raw": wiki_extraction_instructions_raw,
|
||||
"wiki_generation_managed": wiki_generation_managed,
|
||||
"wiki_config_schema_version": wiki_config_schema_version,
|
||||
"wiki_config_revision": wiki_config_revision,
|
||||
"wiki_config_apply_status": wiki_config_apply_status,
|
||||
"wiki_config_apply_error": wiki_config_apply_error,
|
||||
"kb_type": kb_type,
|
||||
"publication_status": "private",
|
||||
"published_by": None,
|
||||
@@ -42,7 +96,7 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
"updated_at": now,
|
||||
}
|
||||
self._rows[row["id"]] = row
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
|
||||
async def list_visible(self, user_id: str, *, scope: LlmWikiScope = "all", is_admin: bool = False) -> list[dict[str, Any]]:
|
||||
rows = list(self._rows.values())
|
||||
@@ -52,22 +106,22 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
rows = [row for row in rows if row["publication_status"] == "published"]
|
||||
else:
|
||||
rows = rows if is_admin else [row for row in rows if row["owner_user_id"] == user_id or row["publication_status"] == "published"]
|
||||
return [dict(row) for row in sorted(rows, key=lambda row: row["created_at"], reverse=True)]
|
||||
return [_mapping_to_dict(row) for row in sorted(rows, key=lambda row: row["created_at"], reverse=True)]
|
||||
|
||||
async def get_authorized(self, mapping_id: str, user_id: str, *, write: bool, is_admin: bool) -> dict[str, Any] | None:
|
||||
row = self._rows.get(mapping_id)
|
||||
if row is None:
|
||||
return None
|
||||
if is_admin or row["owner_user_id"] == user_id:
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
if not write and row["publication_status"] == "published":
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
return None
|
||||
|
||||
async def get_by_weknora_id(self, weknora_id: str) -> dict[str, Any] | None:
|
||||
for row in self._rows.values():
|
||||
if row["weknora_id"] == weknora_id:
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
return None
|
||||
|
||||
async def update_mapping(
|
||||
@@ -81,6 +135,16 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
retrieval_settings: dict[str, Any] | None = None,
|
||||
wiki_index_enabled: bool | None = None,
|
||||
external_search_enabled: bool | None = None,
|
||||
wiki_parent_directories: list[str] | None | object = UNSET,
|
||||
wiki_directory_paths: list[list[str]] | None | object = UNSET,
|
||||
wiki_focus_instructions: str | None | object = UNSET,
|
||||
wiki_content_instructions_raw: str | None | object = UNSET,
|
||||
wiki_extraction_instructions_raw: str | None | object = UNSET,
|
||||
wiki_generation_managed: bool | None | object = UNSET,
|
||||
wiki_config_schema_version: int | None | object = UNSET,
|
||||
wiki_config_revision: int | None | object = UNSET,
|
||||
wiki_config_apply_status: str | None | object = UNSET,
|
||||
wiki_config_apply_error: str | None | object = UNSET,
|
||||
) -> dict[str, Any] | None:
|
||||
row = self._rows.get(mapping_id)
|
||||
if row is None:
|
||||
@@ -98,8 +162,56 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
if external_search_enabled is not None:
|
||||
row["external_search_enabled"] = external_search_enabled
|
||||
row["external_search_updated_at"] = _now()
|
||||
if wiki_parent_directories is not UNSET:
|
||||
row["wiki_parent_directories"] = serialize_wiki_parent_directories(
|
||||
cast(list[str] | None, wiki_parent_directories)
|
||||
)
|
||||
if wiki_directory_paths is not UNSET:
|
||||
row["wiki_directory_paths"] = serialize_wiki_directory_paths(
|
||||
cast(list[list[str]] | None, wiki_directory_paths)
|
||||
)
|
||||
if wiki_focus_instructions is not UNSET:
|
||||
row["wiki_focus_instructions"] = cast(
|
||||
str | None,
|
||||
wiki_focus_instructions,
|
||||
)
|
||||
if wiki_content_instructions_raw is not UNSET:
|
||||
row["wiki_content_instructions_raw"] = cast(
|
||||
str | None,
|
||||
wiki_content_instructions_raw,
|
||||
)
|
||||
if wiki_extraction_instructions_raw is not UNSET:
|
||||
row["wiki_extraction_instructions_raw"] = cast(
|
||||
str | None,
|
||||
wiki_extraction_instructions_raw,
|
||||
)
|
||||
if wiki_generation_managed is not UNSET:
|
||||
row["wiki_generation_managed"] = cast(
|
||||
bool | None,
|
||||
wiki_generation_managed,
|
||||
)
|
||||
if wiki_config_schema_version is not UNSET:
|
||||
row["wiki_config_schema_version"] = cast(
|
||||
int | None,
|
||||
wiki_config_schema_version,
|
||||
)
|
||||
if wiki_config_revision is not UNSET:
|
||||
row["wiki_config_revision"] = cast(
|
||||
int | None,
|
||||
wiki_config_revision,
|
||||
)
|
||||
if wiki_config_apply_status is not UNSET:
|
||||
row["wiki_config_apply_status"] = cast(
|
||||
str | None,
|
||||
wiki_config_apply_status,
|
||||
)
|
||||
if wiki_config_apply_error is not UNSET:
|
||||
row["wiki_config_apply_error"] = cast(
|
||||
str | None,
|
||||
wiki_config_apply_error,
|
||||
)
|
||||
row["updated_at"] = _now()
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
|
||||
async def adopt_conversation_deposit_mapping(
|
||||
self,
|
||||
@@ -124,7 +236,7 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
"updated_at": now,
|
||||
}
|
||||
)
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
|
||||
async def delete_mapping(self, mapping_id: str) -> bool:
|
||||
return self._rows.pop(mapping_id, None) is not None
|
||||
@@ -138,7 +250,7 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
row["reviewed_by"] = None
|
||||
row["published_at"] = _now()
|
||||
row["updated_at"] = _now()
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
|
||||
async def review_publish(self, mapping_id: str, reviewer_user_id: str, *, approved: bool) -> dict[str, Any] | None:
|
||||
row = self._rows.get(mapping_id)
|
||||
@@ -148,7 +260,7 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
row["reviewed_by"] = reviewer_user_id
|
||||
row["published_at"] = _now() if approved else None
|
||||
row["updated_at"] = _now()
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
|
||||
async def unpublish(self, mapping_id: str, actor_user_id: str, *, is_admin: bool) -> dict[str, Any] | None:
|
||||
row = self._rows.get(mapping_id)
|
||||
@@ -158,18 +270,18 @@ class MemoryLlmWikiStore(LlmWikiStore):
|
||||
row["reviewed_by"] = actor_user_id if is_admin else row.get("reviewed_by")
|
||||
row["published_at"] = None
|
||||
row["updated_at"] = _now()
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
|
||||
async def list_publications(self, *, status: str | None = None) -> list[dict[str, Any]]:
|
||||
rows = [row for row in self._rows.values() if row["publication_status"] != "private"]
|
||||
if status:
|
||||
rows = [row for row in rows if row["publication_status"] == status]
|
||||
return [dict(row) for row in sorted(rows, key=lambda row: row["updated_at"], reverse=True)]
|
||||
return [_mapping_to_dict(row) for row in sorted(rows, key=lambda row: row["updated_at"], reverse=True)]
|
||||
|
||||
async def get_conversation_deposit_mapping(self) -> dict[str, Any] | None:
|
||||
for row in self._rows.values():
|
||||
if row.get("owner_user_id") == "system" and row.get("name") == "对话沉淀" and row.get("publication_status") == "published":
|
||||
return dict(row)
|
||||
return _mapping_to_dict(row)
|
||||
return None
|
||||
|
||||
async def get_conversation_deposit(
|
||||
|
||||
+11
-1
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from sqlalchemy import Boolean, String, UniqueConstraint, false, true
|
||||
from sqlalchemy import Boolean, Integer, String, Text, UniqueConstraint, false, true
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from deerflow.persistence.base import Base
|
||||
@@ -24,6 +24,16 @@ class LlmWikiKnowledgeBaseRow(Base):
|
||||
# questions for this library.
|
||||
test_questions: Mapped[list | None] = mapped_column(PortableJSON(), nullable=True)
|
||||
retrieval_settings: Mapped[dict | None] = mapped_column(PortableJSON(), nullable=True)
|
||||
wiki_parent_directories: Mapped[list[str] | None] = mapped_column(PortableJSON(), nullable=True)
|
||||
wiki_directory_paths: Mapped[list[list[str]] | None] = mapped_column(PortableJSON(), nullable=True)
|
||||
wiki_focus_instructions: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
wiki_content_instructions_raw: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
wiki_extraction_instructions_raw: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
wiki_generation_managed: Mapped[bool | None] = mapped_column(Boolean, nullable=True)
|
||||
wiki_config_schema_version: Mapped[int | None] = mapped_column(Integer, nullable=True)
|
||||
wiki_config_revision: Mapped[int | None] = mapped_column(Integer, nullable=True)
|
||||
wiki_config_apply_status: Mapped[str | None] = mapped_column(String(32), nullable=True)
|
||||
wiki_config_apply_error: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
kb_type: Mapped[str] = mapped_column(String(32), default="document")
|
||||
publication_status: Mapped[str] = mapped_column(String(16), default="private", index=True)
|
||||
published_by: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
||||
|
||||
+113
-3
@@ -3,13 +3,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import UTC, datetime
|
||||
from typing import Any
|
||||
from typing import Any, cast
|
||||
from uuid import uuid4
|
||||
|
||||
from sqlalchemy import delete, or_, select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
|
||||
|
||||
from deerflow.persistence.llmwiki.base import LlmWikiScope, LlmWikiStore
|
||||
from deerflow.persistence.llmwiki.base import (
|
||||
UNSET,
|
||||
LlmWikiScope,
|
||||
LlmWikiStore,
|
||||
serialize_wiki_directory_paths,
|
||||
serialize_wiki_parent_directories,
|
||||
)
|
||||
from deerflow.persistence.llmwiki.model import LlmWikiConversationDepositRow, LlmWikiKnowledgeBaseRow
|
||||
|
||||
|
||||
@@ -19,6 +25,14 @@ def _now() -> datetime:
|
||||
|
||||
def _to_dict(row: LlmWikiKnowledgeBaseRow | LlmWikiConversationDepositRow) -> dict[str, Any]:
|
||||
data = row.to_dict()
|
||||
if "wiki_parent_directories" in data:
|
||||
data["wiki_parent_directories"] = serialize_wiki_parent_directories(
|
||||
data["wiki_parent_directories"]
|
||||
)
|
||||
if "wiki_directory_paths" in data:
|
||||
data["wiki_directory_paths"] = serialize_wiki_directory_paths(
|
||||
data["wiki_directory_paths"]
|
||||
)
|
||||
for key in ("published_at", "external_search_updated_at", "created_at", "updated_at"):
|
||||
value = data.get(key)
|
||||
if isinstance(value, datetime):
|
||||
@@ -30,13 +44,51 @@ class LlmWikiRepository(LlmWikiStore):
|
||||
def __init__(self, session_factory: async_sessionmaker[AsyncSession]) -> None:
|
||||
self._sf = session_factory
|
||||
|
||||
async def create_mapping(self, *, weknora_id: str, owner_user_id: str, name: str, description: str, kb_type: str) -> dict[str, Any]:
|
||||
async def create_mapping(
|
||||
self,
|
||||
*,
|
||||
weknora_id: str,
|
||||
owner_user_id: str,
|
||||
name: str,
|
||||
description: str,
|
||||
kb_type: str,
|
||||
retrieval_settings: dict[str, Any] | None = None,
|
||||
wiki_parent_directories: list[str] | None = None,
|
||||
wiki_directory_paths: list[list[str]] | None = None,
|
||||
wiki_focus_instructions: str | None = None,
|
||||
wiki_content_instructions_raw: str | None = None,
|
||||
wiki_extraction_instructions_raw: str | None = None,
|
||||
wiki_generation_managed: bool | None = None,
|
||||
wiki_config_schema_version: int | None = None,
|
||||
wiki_config_revision: int | None = None,
|
||||
wiki_config_apply_status: str | None = None,
|
||||
wiki_config_apply_error: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
row = LlmWikiKnowledgeBaseRow(
|
||||
id=str(uuid4()),
|
||||
weknora_id=weknora_id,
|
||||
owner_user_id=owner_user_id,
|
||||
name=name,
|
||||
description=description,
|
||||
retrieval_settings=(
|
||||
dict(retrieval_settings)
|
||||
if retrieval_settings is not None
|
||||
else None
|
||||
),
|
||||
wiki_parent_directories=serialize_wiki_parent_directories(
|
||||
wiki_parent_directories
|
||||
),
|
||||
wiki_directory_paths=serialize_wiki_directory_paths(
|
||||
wiki_directory_paths
|
||||
),
|
||||
wiki_focus_instructions=wiki_focus_instructions,
|
||||
wiki_content_instructions_raw=wiki_content_instructions_raw,
|
||||
wiki_extraction_instructions_raw=wiki_extraction_instructions_raw,
|
||||
wiki_generation_managed=wiki_generation_managed,
|
||||
wiki_config_schema_version=wiki_config_schema_version,
|
||||
wiki_config_revision=wiki_config_revision,
|
||||
wiki_config_apply_status=wiki_config_apply_status,
|
||||
wiki_config_apply_error=wiki_config_apply_error,
|
||||
kb_type=kb_type,
|
||||
publication_status="private",
|
||||
created_at=_now(),
|
||||
@@ -93,6 +145,16 @@ class LlmWikiRepository(LlmWikiStore):
|
||||
retrieval_settings: dict[str, Any] | None = None,
|
||||
wiki_index_enabled: bool | None = None,
|
||||
external_search_enabled: bool | None = None,
|
||||
wiki_parent_directories: list[str] | None | object = UNSET,
|
||||
wiki_directory_paths: list[list[str]] | None | object = UNSET,
|
||||
wiki_focus_instructions: str | None | object = UNSET,
|
||||
wiki_content_instructions_raw: str | None | object = UNSET,
|
||||
wiki_extraction_instructions_raw: str | None | object = UNSET,
|
||||
wiki_generation_managed: bool | None | object = UNSET,
|
||||
wiki_config_schema_version: int | None | object = UNSET,
|
||||
wiki_config_revision: int | None | object = UNSET,
|
||||
wiki_config_apply_status: str | None | object = UNSET,
|
||||
wiki_config_apply_error: str | None | object = UNSET,
|
||||
) -> dict[str, Any] | None:
|
||||
async with self._sf() as session:
|
||||
row = await session.get(LlmWikiKnowledgeBaseRow, mapping_id)
|
||||
@@ -111,6 +173,54 @@ class LlmWikiRepository(LlmWikiStore):
|
||||
if external_search_enabled is not None:
|
||||
row.external_search_enabled = external_search_enabled
|
||||
row.external_search_updated_at = _now()
|
||||
if wiki_parent_directories is not UNSET:
|
||||
row.wiki_parent_directories = serialize_wiki_parent_directories(
|
||||
cast(list[str] | None, wiki_parent_directories)
|
||||
)
|
||||
if wiki_directory_paths is not UNSET:
|
||||
row.wiki_directory_paths = serialize_wiki_directory_paths(
|
||||
cast(list[list[str]] | None, wiki_directory_paths)
|
||||
)
|
||||
if wiki_focus_instructions is not UNSET:
|
||||
row.wiki_focus_instructions = cast(
|
||||
str | None,
|
||||
wiki_focus_instructions,
|
||||
)
|
||||
if wiki_content_instructions_raw is not UNSET:
|
||||
row.wiki_content_instructions_raw = cast(
|
||||
str | None,
|
||||
wiki_content_instructions_raw,
|
||||
)
|
||||
if wiki_extraction_instructions_raw is not UNSET:
|
||||
row.wiki_extraction_instructions_raw = cast(
|
||||
str | None,
|
||||
wiki_extraction_instructions_raw,
|
||||
)
|
||||
if wiki_generation_managed is not UNSET:
|
||||
row.wiki_generation_managed = cast(
|
||||
bool | None,
|
||||
wiki_generation_managed,
|
||||
)
|
||||
if wiki_config_schema_version is not UNSET:
|
||||
row.wiki_config_schema_version = cast(
|
||||
int | None,
|
||||
wiki_config_schema_version,
|
||||
)
|
||||
if wiki_config_revision is not UNSET:
|
||||
row.wiki_config_revision = cast(
|
||||
int | None,
|
||||
wiki_config_revision,
|
||||
)
|
||||
if wiki_config_apply_status is not UNSET:
|
||||
row.wiki_config_apply_status = cast(
|
||||
str | None,
|
||||
wiki_config_apply_status,
|
||||
)
|
||||
if wiki_config_apply_error is not UNSET:
|
||||
row.wiki_config_apply_error = cast(
|
||||
str | None,
|
||||
wiki_config_apply_error,
|
||||
)
|
||||
row.updated_at = _now()
|
||||
await session.commit()
|
||||
return _to_dict(row)
|
||||
|
||||
Reference in new issue
Block a user