from typing import Any from pydantic import BaseModel, Field from app.core.constants import ActorValue from app.modules.feishu.constants import FeishuReceiveIdType class FeishuTextMessage(BaseModel): receive_id: str | None = Field( default=None, description="chat_id or open_id depending on type.", ) receive_id_type: str = FeishuReceiveIdType.CHAT_ID tenant_key: str | None = Field(default=None, max_length=128) text: str class FeishuCardMessage(BaseModel): receive_id: str | None = None receive_id_type: str = FeishuReceiveIdType.CHAT_ID tenant_key: str | None = Field(default=None, max_length=128) card: dict[str, Any] class FeishuWebhookEvent(BaseModel): type: str | None = None challenge: str | None = None token: str | None = None schema_: str | None = Field(default=None, alias="schema") header: dict[str, Any] | None = None event: dict[str, Any] | None = None class FeishuSendResult(BaseModel): ok: bool provider_response: dict[str, Any] class FeishuCommandRequest(BaseModel): text: str chat_id: str | None = None tenant_key: str | None = Field(default=None, max_length=128) actor: str = ActorValue.API auto_reply: bool = False class FeishuCommandResult(BaseModel): command: str reply_type: str title: str content: str provider_response: dict[str, Any] | None = None