Commit f30f9f9
committed
feat(server): port /v1/answer + /v1/answer/pageindex into the deployed router
Both answer endpoints existed only on the standalone cmd/engine binary
(internal/api), so they were unreachable on the deployed cmd/server
binary (internal/handler) that production runs. Port them, adapting the
standalone single-tenant org to the deployed server's multi-tenant
model (org + store resolved from the X-Vectorless-Org / X-Vectorless-Store
headers).
- /v1/answer runs retrieval + per-section answer-span extraction + a
synthesis LLM call, returning a quote-grounded answer with citations.
- /v1/answer/pageindex runs the PageIndex agentic loop end-to-end
(structure -> get_pages -> done), with an opt-in reasoning trace and
an SSE streaming variant. Its per-request strategy copy gets an
org-scoped TOC provider so get_document_structure reads only the
requesting tenant's documents.toc_tree.
Extend handler.Deps with the LLM client, default model, answer-span /
answer config, the replay store, and the dedicated PageIndex strategy,
and wire them at boot in cmd/server. Replay capture is shared with the
existing /v1/replay endpoint via byte-identical response storage.1 parent e78d5ea commit f30f9f9
5 files changed
Lines changed: 1006 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 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 | + | |
166 | 196 | | |
167 | 197 | | |
168 | 198 | | |
| |||
210 | 240 | | |
211 | 241 | | |
212 | 242 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
222 | 259 | | |
223 | 260 | | |
224 | 261 | | |
| |||
334 | 371 | | |
335 | 372 | | |
336 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
337 | 389 | | |
338 | 390 | | |
339 | 391 | | |
| |||
0 commit comments