(content: Content)
| 40 | } |
| 41 | |
| 42 | function isValidContent(content: Content): boolean { |
| 43 | if (content.parts === undefined || content.parts.length === 0) { |
| 44 | return false; |
| 45 | } |
| 46 | for (const part of content.parts) { |
| 47 | if (part === undefined || Object.keys(part).length === 0) { |
| 48 | return false; |
| 49 | } |
| 50 | if (!part.thought && part.text !== undefined && part.text === '') { |
| 51 | return false; |
| 52 | } |
| 53 | } |
| 54 | return true; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Validates the history contains the correct roles. |
no outgoing calls
no test coverage detected