File size: 401 Bytes
68a9b68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from dataclasses import dataclass
from typing import List, Literal, Optional

from langchain.schema import Document


@dataclass
class Message:
    """Class for keeping track of a chat message."""

    origin: Literal["human", "ai"]
    message: str
    documents: Optional[List[Document]] = None

    def __repr__(self) -> str:
        return f"Message(origin={self.origin}, message={self.message})"