File size: 15,930 Bytes
76e89e6
 
 
225657d
 
76e89e6
225657d
 
 
 
 
 
 
 
 
76e89e6
 
 
 
 
 
e731b16
76e89e6
 
e731b16
 
76e89e6
e731b16
225657d
76e89e6
 
e731b16
 
76e89e6
e731b16
225657d
76e89e6
 
 
 
 
 
 
 
 
e731b16
76e89e6
 
05891f5
e731b16
05891f5
 
e731b16
 
76e89e6
e731b16
76e89e6
e731b16
05891f5
 
 
e731b16
 
76e89e6
e731b16
76e89e6
 
05891f5
e731b16
 
76e89e6
e731b16
 
 
 
76e89e6
 
05891f5
e731b16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
05891f5
e731b16
05891f5
 
76e89e6
e731b16
76e89e6
 
 
 
05891f5
 
 
e731b16
 
76e89e6
e731b16
76e89e6
 
05891f5
e731b16
 
76e89e6
e731b16
 
 
 
76e89e6
 
05891f5
e731b16
 
 
 
76e89e6
 
 
e731b16
 
76e89e6
 
e731b16
76e89e6
 
e731b16
 
76e89e6
e731b16
 
76e89e6
 
e731b16
76e89e6
 
 
 
 
 
 
 
 
05891f5
76e89e6
05891f5
 
76e89e6
 
 
 
 
 
05891f5
 
 
76e89e6
 
 
 
 
 
05891f5
76e89e6
 
 
 
 
 
05891f5
76e89e6
 
 
 
 
 
05891f5
e731b16
 
 
 
76e89e6
 
 
 
 
 
 
 
 
 
 
e731b16
76e89e6
 
e731b16
 
76e89e6
 
e731b16
76e89e6
 
 
 
 
 
 
 
 
05891f5
 
e731b16
 
76e89e6
e731b16
76e89e6
e731b16
05891f5
e731b16
 
76e89e6
e731b16
76e89e6
 
05891f5
e731b16
 
76e89e6
e731b16
76e89e6
 
05891f5
e731b16
05891f5
 
76e89e6
e731b16
76e89e6
 
 
 
05891f5
 
 
e731b16
 
76e89e6
e731b16
76e89e6
 
05891f5
e731b16
 
76e89e6
e731b16
 
 
05891f5
e731b16
 
 
 
76e89e6
 
05891f5
e731b16
 
 
 
76e89e6
 
 
e731b16
 
 
76e89e6
 
e731b16
76e89e6
 
e731b16
 
76e89e6
e731b16
 
76e89e6
 
e731b16
225657d
 
 
 
 
 
 
e731b16
 
 
 
 
 
 
 
 
 
 
225657d
 
 
e731b16
 
 
 
 
 
 
 
 
 
 
225657d
 
e731b16
 
 
 
 
 
 
 
 
 
 
225657d
 
e731b16
 
 
 
 
 
 
 
 
 
 
225657d
 
e731b16
 
 
 
 
 
 
 
 
 
 
225657d
 
e731b16
 
 
 
 
 
 
 
 
 
 
225657d
 
e731b16
 
 
 
 
 
 
 
 
 
 
225657d
 
e731b16
 
 
 
 
 
 
 
 
 
 
225657d
 
 
 
 
 
 
 
05891f5
 
225657d
 
 
 
 
 
05891f5
225657d
05891f5
 
225657d
e731b16
 
225657d
 
 
 
 
 
 
 
e731b16
 
225657d
e731b16
 
225657d
 
e731b16
225657d
 
 
e731b16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225657d
 
05891f5
 
225657d
 
 
 
 
 
05891f5
225657d
05891f5
 
225657d
e731b16
 
225657d
 
 
 
 
 
 
 
 
e731b16
225657d
e731b16
 
225657d
 
 
76e89e6
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
{
  "edges": [
    {
      "id": "LynxScribe Message 3 LynxScribe Task Solver 1",
      "source": "LynxScribe Message 3",
      "sourceHandle": "output",
      "target": "LynxScribe Task Solver 1",
      "targetHandle": "system_prompt"
    },
    {
      "id": "LynxScribe Message 1 LynxScribe Task Solver 1",
      "source": "LynxScribe Message 1",
      "sourceHandle": "output",
      "target": "LynxScribe Task Solver 1",
      "targetHandle": "instruction_prompt"
    },
    {
      "id": "Read Excel 1 LynxScribe Task Solver 1",
      "source": "Read Excel 1",
      "sourceHandle": "output",
      "target": "LynxScribe Task Solver 1",
      "targetHandle": "dataframe"
    },
    {
      "id": "LynxScribe Task Solver 1 View DataFrame 1",
      "source": "LynxScribe Task Solver 1",
      "sourceHandle": "output",
      "target": "View DataFrame 1",
      "targetHandle": "input"
    },
    {
      "id": "Read Excel 1 View DataFrame 2",
      "source": "Read Excel 1",
      "sourceHandle": "output",
      "target": "View DataFrame 2",
      "targetHandle": "input"
    }
  ],
  "env": "LynxScribe",
  "nodes": [
    {
      "data": {
        "__execution_delay": 0.0,
        "collapsed": null,
        "display": null,
        "error": null,
        "input_metadata": null,
        "meta": {
          "inputs": [],
          "name": "LynxScribe Message",
          "outputs": [
            {
              "name": "output",
              "position": "top",
              "type": {
                "type": "None"
              }
            }
          ],
          "params": [
            {
              "default": null,
              "name": "prompt_content",
              "type": {
                "format": "textarea"
              }
            },
            {
              "default": null,
              "name": "prompt_role",
              "type": {
                "enum": [
                  "SYSTEM",
                  "USER"
                ]
              }
            }
          ],
          "position": {
            "x": 653.0,
            "y": 954.0
          },
          "type": "basic"
        },
        "params": {
          "prompt_content": "You are an AI assistant designed to clean and extract structured address information from raw text.\nYour goal is to identify and extract relevant address components while ignoring any unrelated information.\nThe output must be formatted as a structured dictionary.\n\nYour task is to parse an address from raw text and return a dictionary with the following keys:\n - zip_code: The postal or ZIP code.\n - country: The country name.\n - state_or_county: The state, province, or county (if applicable).\n - city: The city or town name.\n - district: The district or borough name (if mentioned).\n - street_type: The type of public space (e.g., street, avenue, boulevard, square).\n - street_name: The name of the public space (e.g., Main, Baker, Champs-\u00c9lys\u00e9es).\n - house_number: The house or building number.\n - floor: The floor number (if mentioned).\n - flat_number: The apartment or unit number (if mentioned).\n - additional_info: Any other useful details, such as building names, or known landmarks.\n\nIf any information is missing from the input, leave the corresponding key as an empty string.\n\nYou must return only a python dictionary with the following keys:\n`zip_code`, `country`, `state_or_county`, `city`, `district`, `street_name`, \n`house_number`, `floor`, `flat_number`, `additional_info`.\n\nDo not include any extra text, comments, or explanations\u2014only return the dictionary.",
          "prompt_role": "SYSTEM"
        },
        "status": "done",
        "title": "LynxScribe Message"
      },
      "dragHandle": ".bg-primary",
      "height": 354.0,
      "id": "LynxScribe Message 3",
      "position": {
        "x": 36.0,
        "y": 569.0
      },
      "type": "basic",
      "width": 740.0
    },
    {
      "data": {
        "__execution_delay": 0.0,
        "collapsed": null,
        "display": null,
        "error": null,
        "input_metadata": null,
        "meta": {
          "inputs": [],
          "name": "LynxScribe Message",
          "outputs": [
            {
              "name": "output",
              "position": "top",
              "type": {
                "type": "None"
              }
            }
          ],
          "params": [
            {
              "default": null,
              "name": "prompt_content",
              "type": {
                "format": "textarea"
              }
            },
            {
              "default": null,
              "name": "prompt_role",
              "type": {
                "enum": [
                  "SYSTEM",
                  "USER"
                ]
              }
            }
          ],
          "position": {
            "x": 1498.0,
            "y": 660.0
          },
          "type": "basic"
        },
        "params": {
          "prompt_content": "Extract structured address information from the following text: {message_parts}",
          "prompt_role": "USER"
        },
        "status": "done",
        "title": "LynxScribe Message"
      },
      "dragHandle": ".bg-primary",
      "height": 347.0,
      "id": "LynxScribe Message 1",
      "position": {
        "x": 817.0,
        "y": 566.0
      },
      "type": "basic",
      "width": 498.0
    },
    {
      "data": {
        "__execution_delay": 0.0,
        "collapsed": null,
        "display": null,
        "error": null,
        "input_metadata": null,
        "meta": {
          "inputs": [],
          "name": "Read Excel",
          "outputs": [
            {
              "name": "output",
              "position": "right",
              "type": {
                "type": "None"
              }
            }
          ],
          "params": [
            {
              "default": "",
              "name": "columns",
              "type": {
                "type": "<class 'str'>"
              }
            },
            {
              "default": null,
              "name": "file_path",
              "type": {
                "type": "<class 'str'>"
              }
            },
            {
              "default": "Sheet1",
              "name": "sheet_name",
              "type": {
                "type": "<class 'str'>"
              }
            }
          ],
          "position": {
            "x": 236.0,
            "y": 150.0
          },
          "type": "basic"
        },
        "params": {
          "columns": "",
          "file_path": "uploads/task_solver_examples.xlsx",
          "sheet_name": "address_example"
        },
        "status": "done",
        "title": "Read Excel"
      },
      "dragHandle": ".bg-primary",
      "height": 284.0,
      "id": "Read Excel 1",
      "position": {
        "x": 41.0,
        "y": 168.0
      },
      "type": "basic",
      "width": 332.0
    },
    {
      "data": {
        "__execution_delay": 0.0,
        "collapsed": null,
        "display": null,
        "error": null,
        "input_metadata": null,
        "meta": {
          "inputs": [
            {
              "name": "dataframe",
              "position": "left",
              "type": {
                "type": "<class 'inspect._empty'>"
              }
            },
            {
              "name": "instruction_prompt",
              "position": "bottom",
              "type": {
                "type": "<class 'inspect._empty'>"
              }
            },
            {
              "name": "system_prompt",
              "position": "bottom",
              "type": {
                "type": "<class 'inspect._empty'>"
              }
            }
          ],
          "name": "LynxScribe Task Solver",
          "outputs": [
            {
              "name": "output",
              "position": "right",
              "type": {
                "type": "None"
              }
            }
          ],
          "params": [
            {
              "default": "openai",
              "name": "llm_interface",
              "type": {
                "type": "<class 'str'>"
              }
            },
            {
              "default": "gpt-4o",
              "name": "llm_model_name",
              "type": {
                "type": "<class 'str'>"
              }
            },
            {
              "default": "processed_field",
              "name": "new_column_names",
              "type": {
                "type": "<class 'str'>"
              }
            }
          ],
          "position": {
            "x": 1511.0,
            "y": 220.0
          },
          "type": "basic"
        },
        "params": {
          "llm_interface": "openai",
          "llm_model_name": "gpt-4o-mini",
          "new_column_names": "zip_code, country, state_or_county, city, district, street_name, house_number, floor, flat_number, additional_info"
        },
        "status": "done",
        "title": "LynxScribe Task Solver"
      },
      "dragHandle": ".bg-primary",
      "height": 282.0,
      "id": "LynxScribe Task Solver 1",
      "position": {
        "x": 626.0,
        "y": 170.0
      },
      "type": "basic",
      "width": 272.0
    },
    {
      "data": {
        "display": {
          "dataframes": {
            "df": {
              "columns": [
                "message_parts",
                "zip_code",
                "country",
                "state_or_county",
                "city",
                "district",
                "street_name",
                "house_number",
                "floor",
                "flat_number",
                "additional_info"
              ],
              "data": [
                [
                  "John's old apartment: 742 Evergreen Terrace, Springfield, IL 62704, USA. Call me at +1-555-1234 or email [email protected].",
                  "62704",
                  "USA",
                  "IL",
                  "Springfield",
                  "",
                  "Evergreen Terrace",
                  "742",
                  "",
                  "",
                  "John's old apartment"
                ],
                [
                  "Visit our office at 56B Baker Street, Marylebone, London W1U 8ED, UK. (Nearest Tube: Baker Street). Contact: [email protected].",
                  "W1U 8ED",
                  "UK",
                  "",
                  "London",
                  "Marylebone",
                  "Baker",
                  "56B",
                  "",
                  "",
                  ""
                ],
                [
                  "New residence: 300, 5th Avenue, New York, NY 10001, USA. Floor 12, Apt 1204. My new phone is (212) 555-6789.",
                  "10001",
                  "USA",
                  "NY",
                  "New York",
                  "",
                  "5th Avenue",
                  "300",
                  "12",
                  "1204",
                  ""
                ],
                [
                  "We just moved to 23 rue de la Paix, 75002 Paris, France. Floor 3, Flat 5. Send mail to my old address instead.",
                  "75002",
                  "France",
                  "",
                  "Paris",
                  "",
                  "rue de la Paix",
                  "23",
                  "3",
                  "5",
                  ""
                ],
                [
                  "Warehouse location: 1024 Industrial Blvd, Houston, TX 77002, USA. Not open on weekends. Customer support: [email protected].",
                  "77002",
                  "USA",
                  "TX",
                  "Houston",
                  "",
                  "Industrial Blvd",
                  "1024",
                  "",
                  "",
                  "Warehouse location"
                ],
                [
                  "My grandma lives at 2F, 15-3 Shinjuku, Tokyo 160-0022, Japan. Don't use my old phone number anymore!",
                  "160-0022",
                  "Japan",
                  "",
                  "Tokyo",
                  "Shinjuku",
                  "Shinjuku",
                  "15-3",
                  "2F",
                  "",
                  ""
                ],
                [
                  "Delivery address: Apt 9, 88 Queen's Road Central, Central, Hong Kong. Landmark: Opposite IFC Mall.",
                  "",
                  "Hong Kong",
                  "",
                  "Central",
                  "",
                  "Queen's Road Central",
                  "88",
                  "",
                  "9",
                  "Opposite IFC Mall"
                ]
              ]
            }
          }
        },
        "error": null,
        "input_metadata": null,
        "meta": {
          "inputs": [
            {
              "name": "input",
              "position": "bottom",
              "type": {
                "type": "<class 'inspect._empty'>"
              }
            }
          ],
          "name": "View DataFrame",
          "outputs": [],
          "params": [],
          "position": {
            "x": 1719.0,
            "y": 332.0
          },
          "type": "table_view"
        },
        "params": {},
        "status": "done",
        "title": "View DataFrame"
      },
      "dragHandle": ".bg-primary",
      "height": 316.0,
      "id": "View DataFrame 1",
      "position": {
        "x": 1139.0,
        "y": 91.0
      },
      "type": "table_view",
      "width": 1118.0
    },
    {
      "data": {
        "display": {
          "dataframes": {
            "df": {
              "columns": [
                "message_parts"
              ],
              "data": [
                [
                  "John's old apartment: 742 Evergreen Terrace, Springfield, IL 62704, USA. Call me at +1-555-1234 or email [email protected]."
                ],
                [
                  "Visit our office at 56B Baker Street, Marylebone, London W1U 8ED, UK. (Nearest Tube: Baker Street). Contact: [email protected]."
                ],
                [
                  "New residence: 300, 5th Avenue, New York, NY 10001, USA. Floor 12, Apt 1204. My new phone is (212) 555-6789."
                ],
                [
                  "We just moved to 23 rue de la Paix, 75002 Paris, France. Floor 3, Flat 5. Send mail to my old address instead."
                ],
                [
                  "Warehouse location: 1024 Industrial Blvd, Houston, TX 77002, USA. Not open on weekends. Customer support: [email protected]."
                ],
                [
                  "My grandma lives at 2F, 15-3 Shinjuku, Tokyo 160-0022, Japan. Don't use my old phone number anymore!"
                ],
                [
                  "Delivery address: Apt 9, 88 Queen's Road Central, Central, Hong Kong. Landmark: Opposite IFC Mall."
                ]
              ]
            }
          }
        },
        "error": null,
        "input_metadata": null,
        "meta": {
          "inputs": [
            {
              "name": "input",
              "position": "bottom",
              "type": {
                "type": "<class 'inspect._empty'>"
              }
            }
          ],
          "name": "View DataFrame",
          "outputs": [],
          "params": [],
          "position": {
            "x": 1083.0,
            "y": 134.0
          },
          "type": "table_view"
        },
        "params": {},
        "status": "done",
        "title": "View DataFrame"
      },
      "dragHandle": ".bg-primary",
      "height": 200.0,
      "id": "View DataFrame 2",
      "position": {
        "x": 515.0,
        "y": -135.125
      },
      "type": "table_view",
      "width": 200.0
    }
  ]
}