( value: unknown, context: string )
| 139 | } |
| 140 | |
| 141 | function parseStrictStreamSnapshot( |
| 142 | value: unknown, |
| 143 | context: string |
| 144 | ): MothershipChatHistory['streamSnapshot'] { |
| 145 | if (value === undefined || value === null) { |
| 146 | return null |
| 147 | } |
| 148 | |
| 149 | const snapshot = parseStreamSnapshot(value) |
| 150 | assertValid(snapshot !== null, `${context} is invalid`) |
| 151 | return snapshot |
| 152 | } |
| 153 | |
| 154 | function parseChatHistory(value: unknown): MothershipChatHistory { |
| 155 | const responseContext = 'Invalid chat response' |
no test coverage detected