style: 移动

This commit is contained in:
2026-05-08 18:34:02 +08:00
parent 209ba45477
commit 2d8571dee3
29 changed files with 82 additions and 126 deletions
-8
View File
@@ -1,8 +0,0 @@
from sqlmodel import SQLModel, Field
class EventRecord(SQLModel, table=True):
trace_id: str = Field(
primary_key=True, description="The unique trace ID of the PretorEvent"
)
event_data_json: str = Field(description="The JSON serialized PretorEvent data")
@@ -1,6 +1,6 @@
from sqlmodel import select
from typing import List, Optional
from pretor.core.database.table.event import EventRecord
from pretor.core.postgres_database.table.event import EventRecord
from sqlalchemy.ext.asyncio import async_sessionmaker, AsyncSession
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from pretor.core.database.table.individual import WorkerIndividual
from pretor.core.postgres_database.table.individual import WorkerIndividual
from sqlmodel import select
from typing import List, Optional
from pretor.core.database.database_exception import database_exception
from pretor.core.postgres_database.database_exception import database_exception
from ulid import ULID
@@ -14,9 +14,9 @@
from typing import List
from pretor.core.database.table.provider import Provider
from pretor.core.postgres_database.table.provider import Provider
from sqlmodel import select
from pretor.core.database.database_exception import database_exception
from pretor.core.postgres_database.database_exception import database_exception
class ProviderDatabase:
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from pretor.core.database.table.system_node import SystemNodeConfig
from pretor.core.postgres_database.table.system_node import SystemNodeConfig
from sqlmodel import select
from typing import List, Optional
from pretor.core.database.database_exception import database_exception
from pretor.core.postgres_database.database_exception import database_exception
class SystemNodeDatabase:
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from pretor.core.database.table.user import User
from pretor.core.postgres_database.table.user import User
from sqlmodel import select
from pretor.utils.error import UserNotExistError, UserPasswordError
from pretor.core.database.database_exception import database_exception
from pretor.core.database.table.user import UserAuthority
from pretor.core.postgres_database.database_exception import database_exception
from pretor.core.postgres_database.table.user import UserAuthority
from pretor.utils.access import Accessor
+5 -5
View File
@@ -20,11 +20,11 @@ from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import sessionmaker
from sqlmodel import SQLModel
from pretor.core.database.module.individual import IndividualDatabase
from pretor.core.database.module.event import EventDatabase
from pretor.core.database.module.user import AuthDatabase
from pretor.core.database.module.provider import ProviderDatabase
from pretor.core.database.module.system_node import SystemNodeDatabase
from .module.individual import IndividualDatabase
from .module.event import EventDatabase
from .module.user import AuthDatabase
from .module.provider import ProviderDatabase
from .module.system_node import SystemNodeDatabase
@ray.remote
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from pretor.core.database.table.user import User
from pretor.core.database.table.provider import Provider
from pretor.core.database.table.individual import WorkerIndividual
from pretor.core.postgres_database.table.user import User
from pretor.core.postgres_database.table.provider import Provider
from pretor.core.postgres_database.table.individual import WorkerIndividual
__all__ = ["User", "Provider", "WorkerIndividual"]
@@ -0,0 +1,19 @@
# Copyright 2026 zhaoxi826
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from sqlalchemy.ext.asyncio import AsyncAttrs
from sqlalchemy.orm import DeclarativeBase
class BaseDataModel(DeclarativeBase, AsyncAttrs):
pass
@@ -12,3 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sqlmodel import SQLModel, Field
class ChatHistory(SQLModel):
__tablename__ = "chat_history"
@@ -0,0 +1,23 @@
# Copyright 2026 zhaoxi826
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from sqlmodel import SQLModel, Field
class EventRecord(SQLModel, table=True):
trace_id: str = Field(
primary_key=True, description="The unique trace ID of the PretorEvent"
)
event_data_json: str = Field(description="The JSON serialized PretorEvent data")