Download apps/litigation_ai/services/session_shared.py from jun2024/fc: direct link, hf CLI and curl.
- Browser
- Download file 634 Bytes
-
https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/litigation_ai/services/session_shared.py
- Command line
-
hf download hf://spaces/jun2024/fc/apps/litigation_ai/services/session_shared.py
-
curl -L -o session_shared.py https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/litigation_ai/services/session_shared.py
634 Bytes
| """Business logic services.""" | |
| from __future__ import annotations | |
| """ | |
| 会话共享数据模型 | |
| 定义 SessionDTO 和 MessageDTO,供 session_lifecycle_service 和 session_message_service 共享. | |
| """ | |
| from dataclasses import dataclass | |
| from typing import Any | |
| class SessionDTO: | |
| id: int | |
| session_id: str | |
| case_id: int | |
| case_name: str | |
| user_id: int | None | |
| document_type: str | |
| status: str | |
| metadata: dict[str, Any] | |
| created_at: Any | |
| updated_at: Any | |
| class MessageDTO: | |
| id: int | |
| session_id: str | |
| role: str | |
| content: str | |
| metadata: dict[str, Any] | |
| created_at: Any | |