SessionInfoProtocol (storage/protocols.py)

PraisonAI · src/praisonai-agents/praisonaiagents/storage/protocols.py · python · MIT
database

Protocol interfaces for pluggable storage backends.

# Source: https://github.com/MervinPraison/PraisonAI | License: MIT
# Provided via justclaw.it.com; keep this notice with the code.
"""
Storage Protocol Definitions for PraisonAI Agents.

Provides Protocol interfaces for storage implementations to enable:
- DRY: Common storage patterns shared across modules
- Mocking: Easy testing without real file I/O
- Extensibility: Custom storage backends

These protocols are lightweight and have zero performance impact.
"""
from typing import Protocol, runtime_checkable, List, Dict, Any, TypeVar
from pathlib import Path
from datetime import datetime


T = TypeVar('T')


@runtime_checkable
class SessionInfoProtocol(Protocol):
    """
    Protocol for session/trace info.
    
    Defines the minimal interface for session metadata.
    Used by TrainingSe

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key