-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
7872 lines (7872 loc) · 238 KB
/
Copy pathopenapi.json
File metadata and controls
7872 lines (7872 loc) · 238 KB
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
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"components": {
"schemas": {
"ABAnalysisResult": {
"description": "Outcome of comparing two experiment variants on one metric — Step 5.7.\n\nProduced by ``rag_config.eval.analyze_ab_experiment``. ``lift`` is the\n*relative* change of B over A (``(mean_b - mean_a) / mean_a``); ``diff`` is\nthe absolute difference, and ``ci_lower`` / ``ci_upper`` bound that difference\nat ``confidence`` (a normal-approximation Welch interval). ``significant`` is\n``True`` when the interval excludes 0 (equivalently ``p_value < 1 - confidence``).\n``status`` is ``analyzed`` or ``insufficient_data`` (either side below\n``min_samples``), in which case the statistics are ``0`` / not meaningful.\n\nAttributes:\n experiment: The experiment id this verdict is for.\n metric: The compared metric (e.g. ``\"satisfaction\"`` / ``\"latency_ms\"``).\n variant_a: Control variant name.\n variant_b: Candidate variant name.\n status: ``analyzed`` or ``insufficient_data``.\n n_a / n_b: Sample counts per variant.\n mean_a / mean_b: Per-variant means.\n diff: ``mean_b - mean_a`` (absolute).\n lift: ``diff / mean_a`` (relative; ``0`` when ``mean_a == 0``).\n ci_lower / ci_upper: Confidence interval on ``diff``.\n p_value: Two-sided p-value (normal approximation).\n confidence: The interval's confidence level (e.g. ``0.95``).\n significant: Whether the CI excludes 0 at ``confidence``.",
"properties": {
"ci_lower": {
"default": 0.0,
"title": "Ci Lower",
"type": "number"
},
"ci_upper": {
"default": 0.0,
"title": "Ci Upper",
"type": "number"
},
"confidence": {
"default": 0.95,
"title": "Confidence",
"type": "number"
},
"diff": {
"default": 0.0,
"title": "Diff",
"type": "number"
},
"experiment": {
"default": "",
"title": "Experiment",
"type": "string"
},
"lift": {
"default": 0.0,
"title": "Lift",
"type": "number"
},
"mean_a": {
"default": 0.0,
"title": "Mean A",
"type": "number"
},
"mean_b": {
"default": 0.0,
"title": "Mean B",
"type": "number"
},
"metric": {
"default": "",
"title": "Metric",
"type": "string"
},
"n_a": {
"default": 0,
"title": "N A",
"type": "integer"
},
"n_b": {
"default": 0,
"title": "N B",
"type": "integer"
},
"p_value": {
"default": 1.0,
"title": "P Value",
"type": "number"
},
"significant": {
"default": false,
"title": "Significant",
"type": "boolean"
},
"status": {
"default": "insufficient_data",
"title": "Status",
"type": "string"
},
"variant_a": {
"default": "control",
"title": "Variant A",
"type": "string"
},
"variant_b": {
"default": "candidate",
"title": "Variant B",
"type": "string"
}
},
"title": "ABAnalysisResult",
"type": "object"
},
"AgentRequest": {
"description": "``POST /v1/agent`` body / gRPC ``ConverseRequest`` payload.\n\nThe budget fields map one-for-one onto :class:`~rag_core.types.Budget`\ncaps; ``None`` means uncapped on that dimension. ``max_steps`` is the\nconfig-level ceiling (defence-in-depth, distinct from ``budget_iter``\nwhich is operator-set per request).",
"properties": {
"budget_dollars": {
"anyOf": [
{
"exclusiveMinimum": 0.0,
"type": "number"
},
{
"type": "null"
}
],
"title": "Budget Dollars"
},
"budget_iter": {
"anyOf": [
{
"minimum": 1.0,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Budget Iter"
},
"budget_tokens": {
"anyOf": [
{
"minimum": 1.0,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Budget Tokens"
},
"budget_wall_ms": {
"anyOf": [
{
"minimum": 1.0,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Budget Wall Ms"
},
"corpus_ids": {
"items": {
"type": "string"
},
"title": "Corpus Ids",
"type": "array"
},
"goal": {
"description": "The task / question for the agent.",
"minLength": 1,
"title": "Goal",
"type": "string"
},
"max_steps": {
"default": 6,
"maximum": 50.0,
"minimum": 1.0,
"title": "Max Steps",
"type": "integer"
},
"principal_id": {
"title": "Principal Id",
"type": "string"
},
"request_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Request Id"
},
"resume_run_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Resume a previously checkpointed run instead of starting fresh.",
"title": "Resume Run Id"
},
"tenant_id": {
"title": "Tenant Id",
"type": "string"
},
"top_k": {
"default": 8,
"maximum": 100.0,
"minimum": 1.0,
"title": "Top K",
"type": "integer"
}
},
"required": [
"tenant_id",
"principal_id",
"goal"
],
"title": "AgentRequest",
"type": "object"
},
"Answer": {
"description": "LLM-generated natural-language response (Step 3.1, ``generate=True``).\n\nEmbedded inside :class:`QueryResponse.answer` when the caller\nrequested generation. ``citations`` link the generated text to\nspecific chunks in the packed context — built by string-matching\ncitation markers in the LLM output, with the packer's chunk\norder as the index.\n\nSee [reference/gateway.md](../../../../docs/reference/gateway.md#answer-generation)\nfor the citation format the prompt asks the LLM to emit.",
"properties": {
"citations": {
"items": {
"$ref": "#/components/schemas/Citation"
},
"title": "Citations",
"type": "array"
},
"finish_reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Finish Reason"
},
"guard": {
"anyOf": [
{
"$ref": "#/components/schemas/GuardResult"
},
{
"type": "null"
}
]
},
"id": {
"title": "Id",
"type": "string"
},
"input_tokens": {
"default": 0,
"title": "Input Tokens",
"type": "integer"
},
"metadata": {
"additionalProperties": true,
"title": "Metadata",
"type": "object"
},
"model": {
"title": "Model",
"type": "string"
},
"output_tokens": {
"default": 0,
"title": "Output Tokens",
"type": "integer"
},
"text": {
"title": "Text",
"type": "string"
}
},
"required": [
"text",
"model"
],
"title": "Answer",
"type": "object"
},
"AuditEvent": {
"description": "Immutable record of a security-relevant or compliance-relevant action.\n\nWritten by every pipeline stage that touches tenant data. The hash-chain\nverification (Step 0.7c) links consecutive events to detect tampering.",
"properties": {
"action": {
"title": "Action",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"metadata": {
"additionalProperties": true,
"title": "Metadata",
"type": "object"
},
"outcome": {
"$ref": "#/components/schemas/AuditOutcome"
},
"principal_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Principal Id"
},
"resource": {
"title": "Resource",
"type": "string"
},
"tenant_id": {
"title": "Tenant Id",
"type": "string"
},
"timestamp": {
"format": "date-time",
"title": "Timestamp",
"type": "string"
},
"trace_context": {
"$ref": "#/components/schemas/TraceContext"
}
},
"required": [
"tenant_id",
"action",
"resource",
"outcome",
"trace_context"
],
"title": "AuditEvent",
"type": "object"
},
"AuditExport": {
"description": "A signed, point-in-time WORM export of the audit log (Step 6.6b).\n\nA self-verifying bundle: ``content_hash`` is the SHA-256 over the canonical\nserialisation of ``events`` (pins the exact set + order), and ``signature``\nis the HMAC over that hash (authenticity). An offline verifier recomputes\n``content_hash`` from ``events`` and re-checks the HMAC, so any add / remove /\nedit is detected. ``chain_verified`` attests the *source* store's whole-log\nhash chain was intact at export time. ``tenant_id`` is set for a\ntenant-scoped export (the HTTP path) and ``None`` for a whole-log export.\nThe bundle is the artifact an operator writes to immutable storage\n(e.g. S3 Object Lock).",
"properties": {
"chain_verified": {
"default": true,
"title": "Chain Verified",
"type": "boolean"
},
"content_hash": {
"default": "",
"title": "Content Hash",
"type": "string"
},
"count": {
"default": 0,
"title": "Count",
"type": "integer"
},
"events": {
"items": {
"$ref": "#/components/schemas/AuditEvent"
},
"title": "Events",
"type": "array"
},
"exported_at": {
"format": "date-time",
"title": "Exported At",
"type": "string"
},
"schema_version": {
"default": "audit-export-v1",
"title": "Schema Version",
"type": "string"
},
"signature": {
"anyOf": [
{
"$ref": "#/components/schemas/AuditExportSignature"
},
{
"type": "null"
}
]
},
"tenant_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Tenant Id"
}
},
"title": "AuditExport",
"type": "object"
},
"AuditExportSignature": {
"description": "Detached HMAC signature over an :class:`AuditExport` (Step 6.6b).\n\nMirrors :class:`ProvenanceSignature` — HMAC-SHA256 over\n``f\"{timestamp}.{content_hash}\"`` — so the WORM export reuses one signing\nmodel across the platform. ``timestamp`` (unix seconds) is bound into the\ndigest; ``key_id`` is an opaque label for key-rotation bookkeeping.",
"properties": {
"algorithm": {
"default": "HMAC-SHA256",
"title": "Algorithm",
"type": "string"
},
"key_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Key Id"
},
"timestamp": {
"default": 0,
"title": "Timestamp",
"type": "integer"
},
"value": {
"default": "",
"title": "Value",
"type": "string"
}
},
"title": "AuditExportSignature",
"type": "object"
},
"AuditListResponse": {
"description": "``GET /v1/audit`` response — the tenant's audit events (Step 6.6).\n\nReturns the calling tenant's :class:`AuditEvent` records **newest-first**\n(only its own — never another tenant's), bounded by the ``limit`` query\nparam. ``chain_verified`` reports whether the **whole-log** SHA-256 hash\nchain still validates at read time, so a consumer sees in one call both the\nevents and that the underlying log is tamper-free. ``returned`` is the page\nsize; ``total`` is how many events the tenant has before the limit.",
"properties": {
"chain_verified": {
"default": true,
"title": "Chain Verified",
"type": "boolean"
},
"events": {
"items": {
"$ref": "#/components/schemas/AuditEvent"
},
"title": "Events",
"type": "array"
},
"returned": {
"default": 0,
"title": "Returned",
"type": "integer"
},
"tenant_id": {
"title": "Tenant Id",
"type": "string"
},
"total": {
"default": 0,
"title": "Total",
"type": "integer"
}
},
"required": [
"tenant_id"
],
"title": "AuditListResponse",
"type": "object"
},
"AuditOutcome": {
"enum": [
"allowed",
"denied",
"error"
],
"title": "AuditOutcome",
"type": "string"
},
"AuditVerifyResponse": {
"description": "``GET /v1/audit/verify`` response — whole-log hash-chain integrity (Step 6.6).\n\nThe hash chain links **all** events (across tenants) into one tamper-evident\nsequence, so verification is inherently whole-log: ``ok`` is True when every\nlink matches its expected SHA-256, False if any event or stored hash was\naltered. ``event_count`` is the total number of events verified.",
"properties": {
"event_count": {
"default": 0,
"title": "Event Count",
"type": "integer"
},
"ok": {
"title": "Ok",
"type": "boolean"
}
},
"required": [
"ok"
],
"title": "AuditVerifyResponse",
"type": "object"
},
"BillingUsageResponse": {
"description": "One tenant's accrued metered usage for the current billing period (Step 7.9).\n\nMirrors :class:`~rag_observability.billing.UsageSnapshot`. Per-tenant — the\ntenant comes from the ``tenant_id`` query param or the ``X-Tenant-Id`` header.\n``usage`` maps each billing dimension (queries / docs_ingested / storage_gb /\nreranker_calls / llm_tokens) to its accrued quantity; empty when no usage meter\nis wired. Read-only — metering never mutates a request.",
"properties": {
"tenant_id": {
"title": "Tenant Id",
"type": "string"
},
"usage": {
"additionalProperties": {
"type": "number"
},
"title": "Usage",
"type": "object"
}
},
"required": [
"tenant_id"
],
"title": "BillingUsageResponse",
"type": "object"
},
"BlobRef": {
"description": "Reference to a blob stored in the ``Storage`` SPI rather than inline.\n\nUsed by chunks whose text exceeds the inline-storage threshold (see\nADR-0007 tiered storage). Callers must hydrate via ``Storage.get(uri)``\nonly when the text is actually needed.",
"properties": {
"content_type": {
"default": "text/plain; charset=utf-8",
"title": "Content Type",
"type": "string"
},
"sha256": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Sha256"
},
"size_bytes": {
"title": "Size Bytes",
"type": "integer"
},
"uri": {
"title": "Uri",
"type": "string"
}
},
"required": [
"uri",
"size_bytes"
],
"title": "BlobRef",
"type": "object"
},
"Body_ingest_document_v1_ingest_document_post": {
"properties": {
"corpus_id": {
"title": "Corpus Id",
"type": "string"
},
"file": {
"contentMediaType": "application/octet-stream",
"title": "File",
"type": "string"
},
"principal_id": {
"default": "gateway-anon",
"title": "Principal Id",
"type": "string"
},
"source_uri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Uri"
},
"tenant_id": {
"title": "Tenant Id",
"type": "string"
}
},
"required": [
"tenant_id",
"corpus_id",
"file"
],
"title": "Body_ingest_document_v1_ingest_document_post",
"type": "object"
},
"BreakerActionResponse": {
"description": "Result of an operator breaker action (force-close).",
"properties": {
"breaker": {
"$ref": "#/components/schemas/BreakerSnapshot"
},
"forced_closed": {
"title": "Forced Closed",
"type": "boolean"
}
},
"required": [
"breaker",
"forced_closed"
],
"title": "BreakerActionResponse",
"type": "object"
},
"BreakerSnapshot": {
"description": "Frozen point-in-time view of one circuit breaker (Step 4.4).\n\nProduced by :meth:`~rag_breaker.breaker.CircuitBreaker.snapshot`; surfaced by\nthe gateway status API (``GET /v1/status/breakers``) and the operator\nconsole. Carries only operational counters — no tenant data or query text —\nso it is safe to expose on the unauthenticated status surface.\n\n``failure_count`` is the current consecutive-failure streak (meaningful only\nwhile CLOSED). ``opened_total`` is the lifetime trip count (how many times\nthis backend has gone OPEN). ``seconds_until_retry`` is how long until the\nOPEN breaker admits its next trial call (``None`` unless OPEN).",
"properties": {
"failure_count": {
"default": 0,
"title": "Failure Count",
"type": "integer"
},
"failure_threshold": {
"default": 0,
"title": "Failure Threshold",
"type": "integer"
},
"name": {
"title": "Name",
"type": "string"
},
"opened_total": {
"default": 0,
"title": "Opened Total",
"type": "integer"
},
"reset_timeout_s": {
"default": 0.0,
"title": "Reset Timeout S",
"type": "number"
},
"seconds_until_retry": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Seconds Until Retry"
},
"state": {
"$ref": "#/components/schemas/CircuitState"
}
},
"required": [
"name",
"state"
],
"title": "BreakerSnapshot",
"type": "object"
},
"BreakersStatusResponse": {
"description": "Snapshot of every per-backend circuit breaker (Step 4.4).\n\n``breakers`` reuses the domain :class:`~rag_core.types.BreakerSnapshot` (the\nsnapshot *is* the data — operational counters only, no tenant rows), ordered\nby backend name. Empty when no breaker registry is wired (the plain\n``build_app`` default).",
"properties": {
"breakers": {
"items": {
"$ref": "#/components/schemas/BreakerSnapshot"
},
"title": "Breakers",
"type": "array"
},
"total": {
"title": "Total",
"type": "integer"
}
},
"required": [
"breakers",
"total"
],
"title": "BreakersStatusResponse",
"type": "object"
},
"ChatCompletionChoice": {
"description": "One choice in a non-streaming completion.",
"properties": {
"finish_reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": "stop",
"title": "Finish Reason"
},
"index": {
"default": 0,
"title": "Index",
"type": "integer"
},
"message": {
"$ref": "#/components/schemas/ChatCompletionResponseMessage"
}
},
"required": [
"message"
],
"title": "ChatCompletionChoice",
"type": "object"
},
"ChatCompletionRequest": {
"description": "``POST /v1/chat/completions`` body (OpenAI-compatible + ``rag`` ext).\n\nStandard OpenAI fields are honoured where they map onto the LLM SPI\n(``messages`` / ``temperature`` / ``max_tokens`` / ``stop`` /\n``stream``). ``n > 1`` is rejected (the gateway returns a single\nchoice). Unsupported sampling knobs (``top_p`` etc.) are accepted and\nignored so clients that always send them don't break.",
"properties": {
"max_tokens": {
"default": 1024,
"maximum": 32000.0,
"minimum": 1.0,
"title": "Max Tokens",
"type": "integer"
},
"messages": {
"description": "Conversation so far. Retrieval runs over the last user turn.",
"items": {
"$ref": "#/components/schemas/ChatMessage"
},
"minItems": 1,
"title": "Messages",
"type": "array"
},
"model": {
"default": "rag-gateway",
"description": "Informational — the wired LLM's model id is reported in the response.",
"title": "Model",
"type": "string"
},
"n": {
"default": 1,
"description": "Only a single choice is supported.",
"maximum": 1.0,
"minimum": 1.0,
"title": "N",
"type": "integer"
},
"rag": {
"$ref": "#/components/schemas/RagOptions",
"description": "Retrieval pre-fetch controls (non-standard extension)."
},
"stop": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Up to 4 stop sequences forwarded to the LLM.",
"title": "Stop"
},
"stream": {
"default": false,
"description": "When true, responses are streamed as SSE chat.completion.chunk events.",
"title": "Stream",
"type": "boolean"
},
"temperature": {
"default": 0.0,
"maximum": 2.0,
"minimum": 0.0,
"title": "Temperature",
"type": "number"
},
"top_p": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Accepted for compatibility; ignored.",
"title": "Top P"
},
"user": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Opaque end-user id for abuse monitoring (not used for auth).",
"title": "User"
}
},
"required": [
"messages"
],
"title": "ChatCompletionRequest",
"type": "object"
},
"ChatCompletionResponse": {
"description": "``POST /v1/chat/completions`` response (OpenAI-compatible + ``rag``).",
"properties": {
"choices": {
"items": {
"$ref": "#/components/schemas/ChatCompletionChoice"
},
"title": "Choices",
"type": "array"
},
"created": {
"title": "Created",
"type": "integer"
},
"id": {
"title": "Id",
"type": "string"
},
"model": {
"title": "Model",
"type": "string"
},
"object": {
"const": "chat.completion",
"default": "chat.completion",
"title": "Object",
"type": "string"
},
"rag": {
"anyOf": [
{
"$ref": "#/components/schemas/RagAnnotations"
},
{
"type": "null"
}
]
},
"usage": {
"$ref": "#/components/schemas/ChatCompletionUsage"
}
},
"required": [
"model"
],
"title": "ChatCompletionResponse",
"type": "object"
},
"ChatCompletionResponseMessage": {
"description": "The assistant message inside a completion choice.",
"properties": {
"content": {
"title": "Content",
"type": "string"
},
"role": {
"const": "assistant",
"default": "assistant",
"title": "Role",
"type": "string"
}
},
"required": [
"content"
],
"title": "ChatCompletionResponseMessage",
"type": "object"
},
"ChatCompletionUsage": {
"description": "Prompt / completion / total token accounting.",
"properties": {
"completion_tokens": {
"default": 0,
"title": "Completion Tokens",
"type": "integer"
},
"prompt_tokens": {
"default": 0,
"title": "Prompt Tokens",
"type": "integer"
},
"total_tokens": {
"default": 0,
"title": "Total Tokens",
"type": "integer"
}
},
"title": "ChatCompletionUsage",
"type": "object"
},
"ChatMessage": {
"description": "A single chat turn.\n\nOnly the string ``content`` form is supported (not OpenAI's\nmulti-part content arrays). ``role`` is one of ``system`` / ``user``\n/ ``assistant`` / ``tool``; the gateway treats unknown roles as\nopaque and forwards them to the LLM.",
"properties": {
"content": {
"default": "",
"title": "Content",
"type": "string"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"role": {
"title": "Role",
"type": "string"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
},
"Chunk": {
"description": "A contiguous piece of a Document produced by the chunking pipeline.\n\nStep 1.1a promoted three governance-relevant fields out of the\n``metadata`` dict into typed required fields:\n\n- ``acl_labels`` — set of ACL labels the PolicyEngine compares against\n the requesting principal's ``acl_labels``.\n- ``trust_level`` — provenance, used by the prompt-injection defense.\n- ``content_ref`` — optional ``BlobRef`` for tiered text storage; when set,\n ``content`` may be ``None`` and callers must hydrate via Storage.",
"properties": {
"acl_labels": {
"items": {
"type": "string"
},
"title": "Acl Labels",
"type": "array",
"uniqueItems": true
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Content"
},
"content_ref": {
"anyOf": [
{
"$ref": "#/components/schemas/BlobRef"
},
{
"type": "null"
}
]
},
"corpus_id": {
"title": "Corpus Id",
"type": "string"
},
"created_at": {
"format": "date-time",
"title": "Created At",
"type": "string"
},
"document_id": {
"title": "Document Id",
"type": "string"
},
"id": {
"title": "Id",
"type": "string"
},
"metadata": {
"additionalProperties": true,
"title": "Metadata",
"type": "object"
},
"parent_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Parent Id"
},
"position": {
"title": "Position",
"type": "integer"
},
"score": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Score"
},
"tenant_id": {