|
| 1 | +{ |
| 2 | + "simpleMapConfiguration": { |
| 3 | + "field_map": { |
| 4 | + "body": "body_embedding" |
| 5 | + }, |
| 6 | + "source": { |
| 7 | + "body": "This is a test body." |
| 8 | + } |
| 9 | + }, |
| 10 | + "doublyMapConfiguration": { |
| 11 | + "field_map": { |
| 12 | + "passage": { |
| 13 | + "body": "body_embedding" |
| 14 | + } |
| 15 | + }, |
| 16 | + "source": { |
| 17 | + "passage": { |
| 18 | + "body": "This is a test body." |
| 19 | + } |
| 20 | + } |
| 21 | + }, |
| 22 | + "mapWithNestedConfiguration": { |
| 23 | + "field_map": { |
| 24 | + "passage": { |
| 25 | + "bodies": "bodies_embedding" |
| 26 | + } |
| 27 | + }, |
| 28 | + "source": { |
| 29 | + "passage": { |
| 30 | + "bodies": ["test body 1", "test body 2", "test body 3"] |
| 31 | + } |
| 32 | + } |
| 33 | + }, |
| 34 | + "nestedConfiguration": { |
| 35 | + "field_map": { |
| 36 | + "bodies": "bodies_embedding" |
| 37 | + }, |
| 38 | + "source": { |
| 39 | + "bodies": ["test body 1", "test body 2", "test body 3"] |
| 40 | + } |
| 41 | + }, |
| 42 | + "nestedWithMapConfiguration": { |
| 43 | + "field_map": { |
| 44 | + "bodies": { |
| 45 | + "body": "body_embedding" |
| 46 | + } |
| 47 | + }, |
| 48 | + "source": { |
| 49 | + "bodies": [ |
| 50 | + { |
| 51 | + "body": "This is a test body.", |
| 52 | + "seq": 1 |
| 53 | + }, |
| 54 | + { |
| 55 | + "body": "This is another test body.", |
| 56 | + "seq": 2 |
| 57 | + }] |
| 58 | + } |
| 59 | + }, |
| 60 | + "sourceMapFieldNotMapConfiguration": { |
| 61 | + "field_map": { |
| 62 | + "passage": "passage_embedding" |
| 63 | + }, |
| 64 | + "source": { |
| 65 | + "passage": { |
| 66 | + "body": "This is a test body." |
| 67 | + } |
| 68 | + }, |
| 69 | + "expectation": { |
| 70 | + "type": "IllegalArgumentException", |
| 71 | + "message": "[passage] configuration doesn't match actual value type, configuration type is: java.lang.String, actual value type is: java.util.HashMap" |
| 72 | + } |
| 73 | + }, |
| 74 | + "sourceMapTypeHasNonNestedNonStringConfiguration": { |
| 75 | + "field_map": { |
| 76 | + "passage": { |
| 77 | + "body": "body_embedding" |
| 78 | + } |
| 79 | + }, |
| 80 | + "source": { |
| 81 | + "passage": { |
| 82 | + "body": 12345 |
| 83 | + } |
| 84 | + }, |
| 85 | + "expectation": { |
| 86 | + "type": "IllegalArgumentException", |
| 87 | + "message": "map type field [body] is neither string nor nested type, cannot process it" |
| 88 | + } |
| 89 | + }, |
| 90 | + "sourceMapTypeHasEmptyStringConfiguration": { |
| 91 | + "field_map": { |
| 92 | + "passage": { |
| 93 | + "body": "body_embedding" |
| 94 | + } |
| 95 | + }, |
| 96 | + "source": { |
| 97 | + "passage": { |
| 98 | + "body": "" |
| 99 | + } |
| 100 | + }, |
| 101 | + "expectation": { |
| 102 | + "type": "IllegalArgumentException", |
| 103 | + "message": "map type field [body] has empty string value, cannot process it" |
| 104 | + } |
| 105 | + }, |
| 106 | + "sourceListTypeHasNullConfiguration": { |
| 107 | + "field_map": { |
| 108 | + "bodies": "bodies_embedding" |
| 109 | + }, |
| 110 | + "source": { |
| 111 | + "bodies": ["This is a test", null, "This is another test"] |
| 112 | + }, |
| 113 | + "expectation": { |
| 114 | + "type": "IllegalArgumentException", |
| 115 | + "message": "list type field [bodies] has null, cannot process it" |
| 116 | + } |
| 117 | + }, |
| 118 | + "sourceListTypeHasEmptyConfiguration": { |
| 119 | + "field_map": { |
| 120 | + "bodies": "bodies_embedding" |
| 121 | + }, |
| 122 | + "source": { |
| 123 | + "bodies": ["This is a test", "", "This is another test"] |
| 124 | + }, |
| 125 | + "expectation": { |
| 126 | + "type": "IllegalArgumentException", |
| 127 | + "message": "list type field [bodies] has empty string, cannot process it" |
| 128 | + } |
| 129 | + }, |
| 130 | + "sourceListTypeHasNonStringConfiguration": { |
| 131 | + "field_map": { |
| 132 | + "bodies": "bodies_embedding" |
| 133 | + }, |
| 134 | + "source": { |
| 135 | + "bodies": ["This is a test", 1, "This is another test"] |
| 136 | + }, |
| 137 | + "expectation": { |
| 138 | + "type": "IllegalArgumentException", |
| 139 | + "message": "list type field [bodies] has non string value, cannot process it" |
| 140 | + } |
| 141 | + }, |
| 142 | + "sourceDoublyListTypeConfiguration": { |
| 143 | + "field_map": { |
| 144 | + "bodies": "bodies_embedding" |
| 145 | + }, |
| 146 | + "source": { |
| 147 | + "bodies": [ |
| 148 | + [ |
| 149 | + "This is a test" |
| 150 | + ], |
| 151 | + [ |
| 152 | + "This is another tetst" |
| 153 | + ] |
| 154 | + ] |
| 155 | + }, |
| 156 | + "expectation": { |
| 157 | + "type": "IllegalArgumentException", |
| 158 | + "message": "list type field [bodies] is nested list type, cannot process it" |
| 159 | + } |
| 160 | + } |
| 161 | +} |
0 commit comments