Commit deb0dc0
committed
Address review: similarity_top_k closure default, fuzzy cap, magic number, kwargs split
- Wire AgentConfig.similarity_top_k into _make_similarity_search_tool's
default_k so the configured retrieval depth wins when the LLM omits k
(previously hard-coded k=8 partially defeated similarity_top_k plumbing).
- Bump MAX_DOC_LENGTH_FOR_FUZZY 50K -> 200K. Per-query timeout and n-gram
anchor pre-filter are the real safety valves; the cap only needs to
guard pathological inputs the timeout might miss.
- Replace the second 30000 magic-number site in OpenAIEmbedder.embed_texts_batch
with the existing OPENAI_EMBEDDER_MAX_INPUT_CHARS constant.
- Pop similarity_top_k (config-time) from kwargs before forwarding to
agent.structured_response (run-time) in api.py to make the routing explicit.1 parent 97ceb29 commit deb0dc0
4 files changed
Lines changed: 26 additions & 19 deletions
File tree
- opencontractserver
- constants
- llms
- agents
- pipeline/embedders
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
122 | | - | |
| 120 | + | |
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
| |||
2104 | 2102 | | |
2105 | 2103 | | |
2106 | 2104 | | |
2107 | | - | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
2108 | 2108 | | |
2109 | 2109 | | |
2110 | 2110 | | |
| |||
2610 | 2610 | | |
2611 | 2611 | | |
2612 | 2612 | | |
2613 | | - | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
2614 | 2616 | | |
2615 | 2617 | | |
2616 | 2618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
398 | 404 | | |
399 | 405 | | |
400 | 406 | | |
| |||
416 | 422 | | |
417 | 423 | | |
418 | 424 | | |
419 | | - | |
| 425 | + | |
420 | 426 | | |
421 | 427 | | |
422 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | 290 | | |
292 | | - | |
293 | 291 | | |
294 | 292 | | |
295 | 293 | | |
296 | | - | |
| 294 | + | |
297 | 295 | | |
298 | 296 | | |
299 | 297 | | |
| |||
0 commit comments