Check the content type of the input. Four types are allowed: str, dict, liststr, listdict.
(self, msgs)
| 47 | raise NotImplementedError |
| 48 | |
| 49 | def check_content(self, msgs): |
| 50 | """Check the content type of the input. Four types are allowed: str, dict, liststr, listdict. |
| 51 | """ |
| 52 | if isinstance(msgs, str): |
| 53 | return 'str' |
| 54 | if isinstance(msgs, dict): |
| 55 | return 'dict' |
| 56 | if isinstance(msgs, list): |
| 57 | types = [self.check_content(m) for m in msgs] |
| 58 | if all(t == 'str' for t in types): |
| 59 | return 'liststr' |
| 60 | if all(t == 'dict' for t in types): |
| 61 | return 'listdict' |
| 62 | return 'unknown' |
| 63 | |
| 64 | def preproc_content(self, inputs): |
| 65 | """Convert the raw input messages to a list of dicts. |
no outgoing calls
no test coverage detected