| 93 | } |
| 94 | |
| 95 | const isMessagesArray = (value: unknown): value is Array<{ role: string; content: string }> => { |
| 96 | return ( |
| 97 | Array.isArray(value) && |
| 98 | value.length > 0 && |
| 99 | value.every( |
| 100 | (item) => |
| 101 | typeof item === 'object' && |
| 102 | item !== null && |
| 103 | 'role' in item && |
| 104 | 'content' in item && |
| 105 | typeof item.role === 'string' && |
| 106 | typeof item.content === 'string' |
| 107 | ) |
| 108 | ) |
| 109 | } |
| 110 | |
| 111 | const isTagFilterArray = (value: unknown): value is TagFilterItem[] => { |
| 112 | if (!Array.isArray(value) || value.length === 0) return false |