File size: 721 Bytes
dec332b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Code in support of the Apps.py page.

from typing import Any, ClassVar, Optional

import pydantic

from trulens_eval.app import App
from trulens_eval.utils.serial import JSON


class ChatRecord(pydantic.BaseModel):

    model_config: ClassVar[dict] = dict(
        arbitrary_types_allowed = True
    )

    # Human input
    human: Optional[str] = None

    # Computer response
    computer: Optional[str] = None

    # Jsonified record. Available only after the app is run on human input and
    # produced a computer output.
    record_json: Optional[JSON] = None

    # The final app state for continuing the session.
    app: App

    # The state of the app as was when this record was produced.
    app_json: JSON