File size: 413 Bytes
18cce84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""validate rails result:
checking with program whether is it message or rails_off_topic"""
import json

from Brain.src.common.program_type import ProgramType


def validate_rails(data: str) -> bool:
    try:
        json_obj = json.loads(data["content"])
        if json_obj["program"] == ProgramType.RAILS_OFF_TOPIC:
            return False
        return True
    except Exception as ex:
        return False