Commit 1519e33
refactor: Consolidate backward compatibility into API models; simplify handler logic (#520)
* hotfix:hotfix
* feat: enhance APIADDRequest with custom_tags, info, and is_feedback fields
- Add custom_tags field for user-defined tags (e.g., ['Travel', 'family']) that can be used as search filters
- Add info field for additional metadata (agent_id, app_id, source_type, etc.) with all keys usable as search filters
- Add is_feedback field to indicate if the request represents user feedback
- Reorganize fields with category comments for better readability
- Mark async_mode as required with default value 'async'
- Mark mem_cube_id, memory_content, doc_path, and source as deprecated
- Enhance field descriptions for better API documentation
* refactor(api): enhance APISearchRequest model with improved structure and documentation
- Reorganize fields with clear section comments (Basic inputs, Cube scoping, Search mode, etc.)
- Add comprehensive field descriptions for better API documentation
- Add new 'filter' field for structured filter conditions with support for logical operators, comparisons, and string operations
- Add 'pref_top_k' and 'include_preference' fields for preference memory handling
- Mark 'mem_cube_id' as deprecated, recommend 'readable_cube_ids' for multi-cube search
- Make 'user_id' required field (was optional)
- Add validation constraints (e.g., top_k >= 1)
- Improve backward compatibility notes and internal field descriptions
- Add 'threshold' field for internal similarity threshold control
* test: add routers api
* fix: Fixed the compatibility issue in the product router.
* fix: tests unpass
* fix: test_api bug
* feat: change MessageDict to MessagesType in routers
* feat: adjust deprecated input parameters in Add/Search Request
---------
Co-authored-by: HarveyXiang <[email protected]>
Co-authored-by: fridayL <[email protected]>
Co-authored-by: chunyu li <[email protected]>1 parent 74e0247 commit 1519e33
File tree
4 files changed
+136
-60
lines changed- src/memos
- api
- handlers
- types
4 files changed
+136
-60
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 47 | | |
54 | 48 | | |
55 | 49 | | |
| |||
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 62 | + | |
| 63 | + | |
71 | 64 | | |
72 | | - | |
| 65 | + | |
73 | 66 | | |
74 | 67 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 68 | | |
79 | 69 | | |
80 | 70 | | |
| |||
106 | 96 | | |
107 | 97 | | |
108 | 98 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 66 | + | |
| 67 | + | |
69 | 68 | | |
70 | | - | |
| 69 | + | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 72 | | |
77 | 73 | | |
78 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
218 | | - | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 225 | | |
231 | 226 | | |
232 | 227 | | |
| |||
297 | 292 | | |
298 | 293 | | |
299 | 294 | | |
300 | | - | |
| 295 | + | |
301 | 296 | | |
302 | 297 | | |
303 | 298 | | |
| |||
307 | 302 | | |
308 | 303 | | |
309 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
| |||
317 | 320 | | |
318 | 321 | | |
319 | 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 | + | |
320 | 358 | | |
321 | 359 | | |
322 | 360 | | |
| |||
328 | 366 | | |
329 | 367 | | |
330 | 368 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | 369 | | |
338 | 370 | | |
339 | 371 | | |
| |||
374 | 406 | | |
375 | 407 | | |
376 | 408 | | |
377 | | - | |
| 409 | + | |
378 | 410 | | |
379 | 411 | | |
380 | 412 | | |
| |||
390 | 422 | | |
391 | 423 | | |
392 | 424 | | |
393 | | - | |
| 425 | + | |
394 | 426 | | |
395 | 427 | | |
396 | 428 | | |
| |||
406 | 438 | | |
407 | 439 | | |
408 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
409 | 446 | | |
410 | 447 | | |
411 | 448 | | |
| |||
426 | 463 | | |
427 | 464 | | |
428 | 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 | + | |
429 | 538 | | |
430 | 539 | | |
431 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments