feat: extend init_data to load and sync user_agent_catalog
- Add UserAgentCatalogSeed and UserAgentCatalogYaml Pydantic models - Add load_user_agent_catalog function to load from YAML - Add _upsert_user_agent_catalog helper for upsert logic - Add initialize_user_agent_catalog function for initialization - Refactor initialize_data to call initialize_llm_catalog and initialize_user_agent_catalog - Fix UserAgentCatalog.llm_id type from str to uuid.UUID
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import ForeignKey, String
|
||||
from sqlalchemy.dialects.postgresql import JSONB, UUID
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
@@ -14,7 +16,7 @@ class UserAgentCatalog(TimestampMixin, Base):
|
||||
String(20),
|
||||
primary_key=True,
|
||||
)
|
||||
llm_id: Mapped[str] = mapped_column(
|
||||
llm_id: Mapped[uuid.UUID] = mapped_column(
|
||||
UUID(as_uuid=True),
|
||||
ForeignKey("llms.id", ondelete="RESTRICT"),
|
||||
nullable=False,
|
||||
|
||||
Reference in New Issue
Block a user