inspect-ai 0.3.103__py3-none-any.whl → 0.3.105__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inspect_ai/_cli/common.py +2 -1
- inspect_ai/_cli/eval.py +2 -2
- inspect_ai/_display/core/active.py +3 -0
- inspect_ai/_display/core/config.py +1 -0
- inspect_ai/_display/core/panel.py +21 -13
- inspect_ai/_display/core/results.py +3 -7
- inspect_ai/_display/core/rich.py +3 -5
- inspect_ai/_display/log/__init__.py +0 -0
- inspect_ai/_display/log/display.py +173 -0
- inspect_ai/_display/plain/display.py +2 -2
- inspect_ai/_display/rich/display.py +2 -4
- inspect_ai/_display/textual/app.py +1 -6
- inspect_ai/_display/textual/widgets/task_detail.py +3 -14
- inspect_ai/_display/textual/widgets/tasks.py +1 -1
- inspect_ai/_eval/eval.py +1 -1
- inspect_ai/_eval/evalset.py +3 -3
- inspect_ai/_eval/registry.py +6 -1
- inspect_ai/_eval/run.py +5 -1
- inspect_ai/_eval/task/constants.py +1 -0
- inspect_ai/_eval/task/log.py +2 -0
- inspect_ai/_eval/task/run.py +65 -39
- inspect_ai/_util/citation.py +88 -0
- inspect_ai/_util/content.py +24 -2
- inspect_ai/_util/json.py +17 -2
- inspect_ai/_util/registry.py +19 -4
- inspect_ai/_view/schema.py +0 -6
- inspect_ai/_view/server.py +17 -0
- inspect_ai/_view/www/dist/assets/index.css +93 -31
- inspect_ai/_view/www/dist/assets/index.js +10639 -10011
- inspect_ai/_view/www/log-schema.json +418 -1
- inspect_ai/_view/www/node_modules/flatted/python/flatted.py +149 -0
- inspect_ai/_view/www/node_modules/katex/src/fonts/generate_fonts.py +58 -0
- inspect_ai/_view/www/node_modules/katex/src/metrics/extract_tfms.py +114 -0
- inspect_ai/_view/www/node_modules/katex/src/metrics/extract_ttfs.py +122 -0
- inspect_ai/_view/www/node_modules/katex/src/metrics/format_json.py +28 -0
- inspect_ai/_view/www/node_modules/katex/src/metrics/parse_tfm.py +211 -0
- inspect_ai/_view/www/package.json +2 -2
- inspect_ai/_view/www/src/@types/log.d.ts +140 -39
- inspect_ai/_view/www/src/app/content/RecordTree.tsx +13 -0
- inspect_ai/_view/www/src/app/log-view/LogView.tsx +1 -1
- inspect_ai/_view/www/src/app/routing/logNavigation.ts +31 -0
- inspect_ai/_view/www/src/app/routing/{navigationHooks.ts → sampleNavigation.ts} +39 -86
- inspect_ai/_view/www/src/app/samples/SampleDialog.tsx +1 -1
- inspect_ai/_view/www/src/app/samples/SampleDisplay.tsx +1 -1
- inspect_ai/_view/www/src/app/samples/chat/ChatMessage.module.css +4 -0
- inspect_ai/_view/www/src/app/samples/chat/ChatMessage.tsx +17 -0
- inspect_ai/_view/www/src/app/samples/chat/MessageCitations.module.css +16 -0
- inspect_ai/_view/www/src/app/samples/chat/MessageCitations.tsx +63 -0
- inspect_ai/_view/www/src/app/samples/chat/MessageContent.module.css +6 -0
- inspect_ai/_view/www/src/app/samples/chat/MessageContent.tsx +174 -25
- inspect_ai/_view/www/src/app/samples/chat/MessageContents.tsx +21 -3
- inspect_ai/_view/www/src/app/samples/chat/content-data/ContentDataView.module.css +7 -0
- inspect_ai/_view/www/src/app/samples/chat/content-data/ContentDataView.tsx +111 -0
- inspect_ai/_view/www/src/app/samples/chat/content-data/WebSearch.module.css +10 -0
- inspect_ai/_view/www/src/app/samples/chat/content-data/WebSearch.tsx +14 -0
- inspect_ai/_view/www/src/app/samples/chat/content-data/WebSearchResults.module.css +19 -0
- inspect_ai/_view/www/src/app/samples/chat/content-data/WebSearchResults.tsx +49 -0
- inspect_ai/_view/www/src/app/samples/chat/messages.ts +7 -1
- inspect_ai/_view/www/src/app/samples/chat/tools/ToolCallView.tsx +12 -2
- inspect_ai/_view/www/src/app/samples/chat/types.ts +4 -0
- inspect_ai/_view/www/src/app/samples/list/SampleList.tsx +1 -1
- inspect_ai/_view/www/src/app/samples/sample-tools/filters.ts +26 -0
- inspect_ai/_view/www/src/app/samples/sample-tools/sample-filter/SampleFilter.tsx +14 -3
- inspect_ai/_view/www/src/app/samples/sample-tools/sample-filter/completions.ts +359 -7
- inspect_ai/_view/www/src/app/samples/sample-tools/sample-filter/language.ts +6 -0
- inspect_ai/_view/www/src/app/samples/sampleLimit.ts +2 -2
- inspect_ai/_view/www/src/app/samples/transcript/ModelEventView.tsx +1 -1
- inspect_ai/_view/www/src/app/samples/transcript/SampleLimitEventView.tsx +4 -4
- inspect_ai/_view/www/src/app/samples/transcript/outline/OutlineRow.tsx +1 -1
- inspect_ai/_view/www/src/app/samples/transcript/outline/TranscriptOutline.tsx +1 -1
- inspect_ai/_view/www/src/client/api/api-browser.ts +25 -0
- inspect_ai/_view/www/src/client/api/api-http.ts +3 -0
- inspect_ai/_view/www/src/client/api/api-vscode.ts +6 -0
- inspect_ai/_view/www/src/client/api/client-api.ts +3 -0
- inspect_ai/_view/www/src/client/api/jsonrpc.ts +1 -0
- inspect_ai/_view/www/src/client/api/types.ts +3 -0
- inspect_ai/_view/www/src/components/MarkdownDiv.tsx +15 -2
- inspect_ai/_view/www/src/state/samplePolling.ts +17 -1
- inspect_ai/_view/www/src/tests/README.md +2 -2
- inspect_ai/_view/www/src/utils/git.ts +3 -1
- inspect_ai/_view/www/src/utils/html.ts +6 -0
- inspect_ai/agent/_handoff.py +8 -5
- inspect_ai/agent/_react.py +5 -5
- inspect_ai/dataset/_dataset.py +1 -1
- inspect_ai/log/_condense.py +5 -0
- inspect_ai/log/_file.py +4 -1
- inspect_ai/log/_log.py +9 -4
- inspect_ai/log/_recorders/json.py +4 -2
- inspect_ai/log/_samples.py +5 -0
- inspect_ai/log/_util.py +2 -0
- inspect_ai/model/__init__.py +14 -0
- inspect_ai/model/_call_tools.py +17 -8
- inspect_ai/model/_chat_message.py +3 -0
- inspect_ai/model/_openai_responses.py +80 -34
- inspect_ai/model/_providers/_anthropic_citations.py +158 -0
- inspect_ai/model/_providers/_google_citations.py +100 -0
- inspect_ai/model/_providers/anthropic.py +219 -36
- inspect_ai/model/_providers/google.py +98 -22
- inspect_ai/model/_providers/mistral.py +20 -7
- inspect_ai/model/_providers/openai.py +11 -10
- inspect_ai/model/_providers/openai_compatible.py +3 -2
- inspect_ai/model/_providers/openai_responses.py +2 -5
- inspect_ai/model/_providers/perplexity.py +123 -0
- inspect_ai/model/_providers/providers.py +13 -2
- inspect_ai/model/_providers/vertex.py +3 -0
- inspect_ai/model/_trim.py +5 -0
- inspect_ai/tool/__init__.py +14 -0
- inspect_ai/tool/_mcp/_mcp.py +5 -2
- inspect_ai/tool/_mcp/sampling.py +19 -3
- inspect_ai/tool/_mcp/server.py +1 -1
- inspect_ai/tool/_tool.py +10 -1
- inspect_ai/tool/_tools/_web_search/_base_http_provider.py +104 -0
- inspect_ai/tool/_tools/_web_search/_exa.py +78 -0
- inspect_ai/tool/_tools/_web_search/_google.py +22 -25
- inspect_ai/tool/_tools/_web_search/_tavily.py +47 -65
- inspect_ai/tool/_tools/_web_search/_web_search.py +83 -36
- inspect_ai/tool/_tools/_web_search/_web_search_provider.py +7 -0
- inspect_ai/util/__init__.py +8 -0
- inspect_ai/util/_background.py +64 -0
- inspect_ai/util/_display.py +11 -2
- inspect_ai/util/_limit.py +72 -5
- inspect_ai/util/_sandbox/__init__.py +2 -0
- inspect_ai/util/_sandbox/docker/compose.py +2 -2
- inspect_ai/util/_sandbox/service.py +28 -7
- inspect_ai/util/_span.py +12 -1
- inspect_ai/util/_subprocess.py +51 -38
- {inspect_ai-0.3.103.dist-info → inspect_ai-0.3.105.dist-info}/METADATA +2 -2
- {inspect_ai-0.3.103.dist-info → inspect_ai-0.3.105.dist-info}/RECORD +134 -109
- /inspect_ai/model/{_openai_computer_use.py → _providers/_openai_computer_use.py} +0 -0
- /inspect_ai/model/{_openai_web_search.py → _providers/_openai_web_search.py} +0 -0
- {inspect_ai-0.3.103.dist-info → inspect_ai-0.3.105.dist-info}/WHEEL +0 -0
- {inspect_ai-0.3.103.dist-info → inspect_ai-0.3.105.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.103.dist-info → inspect_ai-0.3.105.dist-info}/licenses/LICENSE +0 -0
- {inspect_ai-0.3.103.dist-info → inspect_ai-0.3.105.dist-info}/top_level.txt +0 -0
@@ -247,6 +247,9 @@
|
|
247
247
|
},
|
248
248
|
{
|
249
249
|
"$ref": "#/$defs/ContentVideo"
|
250
|
+
},
|
251
|
+
{
|
252
|
+
"$ref": "#/$defs/ContentData"
|
250
253
|
}
|
251
254
|
]
|
252
255
|
},
|
@@ -271,6 +274,19 @@
|
|
271
274
|
"default": null,
|
272
275
|
"title": "Source"
|
273
276
|
},
|
277
|
+
"metadata": {
|
278
|
+
"anyOf": [
|
279
|
+
{
|
280
|
+
"additionalProperties": true,
|
281
|
+
"type": "object"
|
282
|
+
},
|
283
|
+
{
|
284
|
+
"type": "null"
|
285
|
+
}
|
286
|
+
],
|
287
|
+
"default": null,
|
288
|
+
"title": "Metadata"
|
289
|
+
},
|
274
290
|
"internal": {
|
275
291
|
"anyOf": [
|
276
292
|
{
|
@@ -320,6 +336,7 @@
|
|
320
336
|
"id",
|
321
337
|
"content",
|
322
338
|
"source",
|
339
|
+
"metadata",
|
323
340
|
"internal",
|
324
341
|
"role",
|
325
342
|
"tool_calls",
|
@@ -366,6 +383,9 @@
|
|
366
383
|
},
|
367
384
|
{
|
368
385
|
"$ref": "#/$defs/ContentVideo"
|
386
|
+
},
|
387
|
+
{
|
388
|
+
"$ref": "#/$defs/ContentData"
|
369
389
|
}
|
370
390
|
]
|
371
391
|
},
|
@@ -390,6 +410,19 @@
|
|
390
410
|
"default": null,
|
391
411
|
"title": "Source"
|
392
412
|
},
|
413
|
+
"metadata": {
|
414
|
+
"anyOf": [
|
415
|
+
{
|
416
|
+
"additionalProperties": true,
|
417
|
+
"type": "object"
|
418
|
+
},
|
419
|
+
{
|
420
|
+
"type": "null"
|
421
|
+
}
|
422
|
+
],
|
423
|
+
"default": null,
|
424
|
+
"title": "Metadata"
|
425
|
+
},
|
393
426
|
"internal": {
|
394
427
|
"anyOf": [
|
395
428
|
{
|
@@ -412,6 +445,7 @@
|
|
412
445
|
"id",
|
413
446
|
"content",
|
414
447
|
"source",
|
448
|
+
"metadata",
|
415
449
|
"internal",
|
416
450
|
"role"
|
417
451
|
],
|
@@ -456,6 +490,9 @@
|
|
456
490
|
},
|
457
491
|
{
|
458
492
|
"$ref": "#/$defs/ContentVideo"
|
493
|
+
},
|
494
|
+
{
|
495
|
+
"$ref": "#/$defs/ContentData"
|
459
496
|
}
|
460
497
|
]
|
461
498
|
},
|
@@ -480,6 +517,19 @@
|
|
480
517
|
"default": null,
|
481
518
|
"title": "Source"
|
482
519
|
},
|
520
|
+
"metadata": {
|
521
|
+
"anyOf": [
|
522
|
+
{
|
523
|
+
"additionalProperties": true,
|
524
|
+
"type": "object"
|
525
|
+
},
|
526
|
+
{
|
527
|
+
"type": "null"
|
528
|
+
}
|
529
|
+
],
|
530
|
+
"default": null,
|
531
|
+
"title": "Metadata"
|
532
|
+
},
|
483
533
|
"internal": {
|
484
534
|
"anyOf": [
|
485
535
|
{
|
@@ -537,6 +587,7 @@
|
|
537
587
|
"id",
|
538
588
|
"content",
|
539
589
|
"source",
|
590
|
+
"metadata",
|
540
591
|
"internal",
|
541
592
|
"role",
|
542
593
|
"tool_call_id",
|
@@ -584,6 +635,9 @@
|
|
584
635
|
},
|
585
636
|
{
|
586
637
|
"$ref": "#/$defs/ContentVideo"
|
638
|
+
},
|
639
|
+
{
|
640
|
+
"$ref": "#/$defs/ContentData"
|
587
641
|
}
|
588
642
|
]
|
589
643
|
},
|
@@ -608,6 +662,19 @@
|
|
608
662
|
"default": null,
|
609
663
|
"title": "Source"
|
610
664
|
},
|
665
|
+
"metadata": {
|
666
|
+
"anyOf": [
|
667
|
+
{
|
668
|
+
"additionalProperties": true,
|
669
|
+
"type": "object"
|
670
|
+
},
|
671
|
+
{
|
672
|
+
"type": "null"
|
673
|
+
}
|
674
|
+
],
|
675
|
+
"default": null,
|
676
|
+
"title": "Metadata"
|
677
|
+
},
|
611
678
|
"internal": {
|
612
679
|
"anyOf": [
|
613
680
|
{
|
@@ -645,6 +712,7 @@
|
|
645
712
|
"id",
|
646
713
|
"content",
|
647
714
|
"source",
|
715
|
+
"metadata",
|
648
716
|
"internal",
|
649
717
|
"role",
|
650
718
|
"tool_call_id"
|
@@ -696,6 +764,116 @@
|
|
696
764
|
"type": "object",
|
697
765
|
"additionalProperties": false
|
698
766
|
},
|
767
|
+
"ContentCitation": {
|
768
|
+
"description": "A generic content citation.",
|
769
|
+
"properties": {
|
770
|
+
"cited_text": {
|
771
|
+
"anyOf": [
|
772
|
+
{
|
773
|
+
"type": "string"
|
774
|
+
},
|
775
|
+
{
|
776
|
+
"additionalItems": false,
|
777
|
+
"items": [
|
778
|
+
{
|
779
|
+
"type": "integer"
|
780
|
+
},
|
781
|
+
{
|
782
|
+
"type": "integer"
|
783
|
+
}
|
784
|
+
],
|
785
|
+
"maxItems": 2,
|
786
|
+
"minItems": 2,
|
787
|
+
"type": "array"
|
788
|
+
},
|
789
|
+
{
|
790
|
+
"type": "null"
|
791
|
+
}
|
792
|
+
],
|
793
|
+
"default": null,
|
794
|
+
"title": "Cited Text"
|
795
|
+
},
|
796
|
+
"title": {
|
797
|
+
"anyOf": [
|
798
|
+
{
|
799
|
+
"type": "string"
|
800
|
+
},
|
801
|
+
{
|
802
|
+
"type": "null"
|
803
|
+
}
|
804
|
+
],
|
805
|
+
"default": null,
|
806
|
+
"title": "Title"
|
807
|
+
},
|
808
|
+
"internal": {
|
809
|
+
"anyOf": [
|
810
|
+
{
|
811
|
+
"additionalProperties": {
|
812
|
+
"$ref": "#/$defs/JsonValue"
|
813
|
+
},
|
814
|
+
"type": "object"
|
815
|
+
},
|
816
|
+
{
|
817
|
+
"type": "null"
|
818
|
+
}
|
819
|
+
],
|
820
|
+
"default": null,
|
821
|
+
"title": "Internal"
|
822
|
+
},
|
823
|
+
"type": {
|
824
|
+
"const": "content",
|
825
|
+
"default": "content",
|
826
|
+
"title": "Type",
|
827
|
+
"type": "string"
|
828
|
+
}
|
829
|
+
},
|
830
|
+
"title": "ContentCitation",
|
831
|
+
"type": "object",
|
832
|
+
"required": [
|
833
|
+
"cited_text",
|
834
|
+
"title",
|
835
|
+
"internal",
|
836
|
+
"type"
|
837
|
+
],
|
838
|
+
"additionalProperties": false
|
839
|
+
},
|
840
|
+
"ContentData": {
|
841
|
+
"description": "Model internal.",
|
842
|
+
"properties": {
|
843
|
+
"internal": {
|
844
|
+
"anyOf": [
|
845
|
+
{
|
846
|
+
"$ref": "#/$defs/JsonValue"
|
847
|
+
},
|
848
|
+
{
|
849
|
+
"type": "null"
|
850
|
+
}
|
851
|
+
],
|
852
|
+
"default": null
|
853
|
+
},
|
854
|
+
"type": {
|
855
|
+
"const": "data",
|
856
|
+
"default": "data",
|
857
|
+
"title": "Type",
|
858
|
+
"type": "string"
|
859
|
+
},
|
860
|
+
"data": {
|
861
|
+
"additionalProperties": {
|
862
|
+
"$ref": "#/$defs/JsonValue"
|
863
|
+
},
|
864
|
+
"title": "Data",
|
865
|
+
"type": "object"
|
866
|
+
}
|
867
|
+
},
|
868
|
+
"required": [
|
869
|
+
"internal",
|
870
|
+
"type",
|
871
|
+
"data"
|
872
|
+
],
|
873
|
+
"title": "ContentData",
|
874
|
+
"type": "object",
|
875
|
+
"additionalProperties": false
|
876
|
+
},
|
699
877
|
"ContentImage": {
|
700
878
|
"description": "Image content.",
|
701
879
|
"properties": {
|
@@ -829,13 +1007,47 @@
|
|
829
1007
|
],
|
830
1008
|
"default": null,
|
831
1009
|
"title": "Refusal"
|
1010
|
+
},
|
1011
|
+
"citations": {
|
1012
|
+
"anyOf": [
|
1013
|
+
{
|
1014
|
+
"items": {
|
1015
|
+
"discriminator": {
|
1016
|
+
"mapping": {
|
1017
|
+
"content": "#/$defs/ContentCitation",
|
1018
|
+
"document": "#/$defs/DocumentCitation",
|
1019
|
+
"url": "#/$defs/UrlCitation"
|
1020
|
+
},
|
1021
|
+
"propertyName": "type"
|
1022
|
+
},
|
1023
|
+
"oneOf": [
|
1024
|
+
{
|
1025
|
+
"$ref": "#/$defs/ContentCitation"
|
1026
|
+
},
|
1027
|
+
{
|
1028
|
+
"$ref": "#/$defs/DocumentCitation"
|
1029
|
+
},
|
1030
|
+
{
|
1031
|
+
"$ref": "#/$defs/UrlCitation"
|
1032
|
+
}
|
1033
|
+
]
|
1034
|
+
},
|
1035
|
+
"type": "array"
|
1036
|
+
},
|
1037
|
+
{
|
1038
|
+
"type": "null"
|
1039
|
+
}
|
1040
|
+
],
|
1041
|
+
"default": null,
|
1042
|
+
"title": "Citations"
|
832
1043
|
}
|
833
1044
|
},
|
834
1045
|
"required": [
|
835
1046
|
"internal",
|
836
1047
|
"type",
|
837
1048
|
"text",
|
838
|
-
"refusal"
|
1049
|
+
"refusal",
|
1050
|
+
"citations"
|
839
1051
|
],
|
840
1052
|
"title": "ContentText",
|
841
1053
|
"type": "object",
|
@@ -885,6 +1097,121 @@
|
|
885
1097
|
"type": "object",
|
886
1098
|
"additionalProperties": false
|
887
1099
|
},
|
1100
|
+
"DocumentCitation": {
|
1101
|
+
"description": "A citation that refers to a page range in a document.",
|
1102
|
+
"properties": {
|
1103
|
+
"cited_text": {
|
1104
|
+
"anyOf": [
|
1105
|
+
{
|
1106
|
+
"type": "string"
|
1107
|
+
},
|
1108
|
+
{
|
1109
|
+
"additionalItems": false,
|
1110
|
+
"items": [
|
1111
|
+
{
|
1112
|
+
"type": "integer"
|
1113
|
+
},
|
1114
|
+
{
|
1115
|
+
"type": "integer"
|
1116
|
+
}
|
1117
|
+
],
|
1118
|
+
"maxItems": 2,
|
1119
|
+
"minItems": 2,
|
1120
|
+
"type": "array"
|
1121
|
+
},
|
1122
|
+
{
|
1123
|
+
"type": "null"
|
1124
|
+
}
|
1125
|
+
],
|
1126
|
+
"default": null,
|
1127
|
+
"title": "Cited Text"
|
1128
|
+
},
|
1129
|
+
"title": {
|
1130
|
+
"anyOf": [
|
1131
|
+
{
|
1132
|
+
"type": "string"
|
1133
|
+
},
|
1134
|
+
{
|
1135
|
+
"type": "null"
|
1136
|
+
}
|
1137
|
+
],
|
1138
|
+
"default": null,
|
1139
|
+
"title": "Title"
|
1140
|
+
},
|
1141
|
+
"internal": {
|
1142
|
+
"anyOf": [
|
1143
|
+
{
|
1144
|
+
"additionalProperties": {
|
1145
|
+
"$ref": "#/$defs/JsonValue"
|
1146
|
+
},
|
1147
|
+
"type": "object"
|
1148
|
+
},
|
1149
|
+
{
|
1150
|
+
"type": "null"
|
1151
|
+
}
|
1152
|
+
],
|
1153
|
+
"default": null,
|
1154
|
+
"title": "Internal"
|
1155
|
+
},
|
1156
|
+
"type": {
|
1157
|
+
"const": "document",
|
1158
|
+
"default": "document",
|
1159
|
+
"title": "Type",
|
1160
|
+
"type": "string"
|
1161
|
+
},
|
1162
|
+
"range": {
|
1163
|
+
"anyOf": [
|
1164
|
+
{
|
1165
|
+
"$ref": "#/$defs/DocumentRange"
|
1166
|
+
},
|
1167
|
+
{
|
1168
|
+
"type": "null"
|
1169
|
+
}
|
1170
|
+
],
|
1171
|
+
"default": null
|
1172
|
+
}
|
1173
|
+
},
|
1174
|
+
"title": "DocumentCitation",
|
1175
|
+
"type": "object",
|
1176
|
+
"required": [
|
1177
|
+
"cited_text",
|
1178
|
+
"title",
|
1179
|
+
"internal",
|
1180
|
+
"type",
|
1181
|
+
"range"
|
1182
|
+
],
|
1183
|
+
"additionalProperties": false
|
1184
|
+
},
|
1185
|
+
"DocumentRange": {
|
1186
|
+
"description": "A range specifying a section of a document.",
|
1187
|
+
"properties": {
|
1188
|
+
"type": {
|
1189
|
+
"enum": [
|
1190
|
+
"block",
|
1191
|
+
"page",
|
1192
|
+
"char"
|
1193
|
+
],
|
1194
|
+
"title": "Type",
|
1195
|
+
"type": "string"
|
1196
|
+
},
|
1197
|
+
"start_index": {
|
1198
|
+
"title": "Start Index",
|
1199
|
+
"type": "integer"
|
1200
|
+
},
|
1201
|
+
"end_index": {
|
1202
|
+
"title": "End Index",
|
1203
|
+
"type": "integer"
|
1204
|
+
}
|
1205
|
+
},
|
1206
|
+
"required": [
|
1207
|
+
"type",
|
1208
|
+
"start_index",
|
1209
|
+
"end_index"
|
1210
|
+
],
|
1211
|
+
"title": "DocumentRange",
|
1212
|
+
"type": "object",
|
1213
|
+
"additionalProperties": false
|
1214
|
+
},
|
888
1215
|
"ErrorEvent": {
|
889
1216
|
"description": "Event with sample error.",
|
890
1217
|
"properties": {
|
@@ -2417,6 +2744,11 @@
|
|
2417
2744
|
"title": "Task Args",
|
2418
2745
|
"type": "object"
|
2419
2746
|
},
|
2747
|
+
"task_args_passed": {
|
2748
|
+
"additionalProperties": true,
|
2749
|
+
"title": "Task Args Passed",
|
2750
|
+
"type": "object"
|
2751
|
+
},
|
2420
2752
|
"solver": {
|
2421
2753
|
"anyOf": [
|
2422
2754
|
{
|
@@ -2595,6 +2927,7 @@
|
|
2595
2927
|
"task_registry_name",
|
2596
2928
|
"task_attribs",
|
2597
2929
|
"task_args",
|
2930
|
+
"task_args_passed",
|
2598
2931
|
"solver",
|
2599
2932
|
"solver_args",
|
2600
2933
|
"tags",
|
@@ -5473,6 +5806,9 @@
|
|
5473
5806
|
{
|
5474
5807
|
"$ref": "#/$defs/ContentVideo"
|
5475
5808
|
},
|
5809
|
+
{
|
5810
|
+
"$ref": "#/$defs/ContentData"
|
5811
|
+
},
|
5476
5812
|
{
|
5477
5813
|
"items": {
|
5478
5814
|
"anyOf": [
|
@@ -5490,6 +5826,9 @@
|
|
5490
5826
|
},
|
5491
5827
|
{
|
5492
5828
|
"$ref": "#/$defs/ContentVideo"
|
5829
|
+
},
|
5830
|
+
{
|
5831
|
+
"$ref": "#/$defs/ContentData"
|
5493
5832
|
}
|
5494
5833
|
]
|
5495
5834
|
},
|
@@ -5791,6 +6130,84 @@
|
|
5791
6130
|
"title": "TopLogprob",
|
5792
6131
|
"type": "object",
|
5793
6132
|
"additionalProperties": false
|
6133
|
+
},
|
6134
|
+
"UrlCitation": {
|
6135
|
+
"description": "A citation that refers to a URL.",
|
6136
|
+
"properties": {
|
6137
|
+
"cited_text": {
|
6138
|
+
"anyOf": [
|
6139
|
+
{
|
6140
|
+
"type": "string"
|
6141
|
+
},
|
6142
|
+
{
|
6143
|
+
"additionalItems": false,
|
6144
|
+
"items": [
|
6145
|
+
{
|
6146
|
+
"type": "integer"
|
6147
|
+
},
|
6148
|
+
{
|
6149
|
+
"type": "integer"
|
6150
|
+
}
|
6151
|
+
],
|
6152
|
+
"maxItems": 2,
|
6153
|
+
"minItems": 2,
|
6154
|
+
"type": "array"
|
6155
|
+
},
|
6156
|
+
{
|
6157
|
+
"type": "null"
|
6158
|
+
}
|
6159
|
+
],
|
6160
|
+
"default": null,
|
6161
|
+
"title": "Cited Text"
|
6162
|
+
},
|
6163
|
+
"title": {
|
6164
|
+
"anyOf": [
|
6165
|
+
{
|
6166
|
+
"type": "string"
|
6167
|
+
},
|
6168
|
+
{
|
6169
|
+
"type": "null"
|
6170
|
+
}
|
6171
|
+
],
|
6172
|
+
"default": null,
|
6173
|
+
"title": "Title"
|
6174
|
+
},
|
6175
|
+
"internal": {
|
6176
|
+
"anyOf": [
|
6177
|
+
{
|
6178
|
+
"additionalProperties": {
|
6179
|
+
"$ref": "#/$defs/JsonValue"
|
6180
|
+
},
|
6181
|
+
"type": "object"
|
6182
|
+
},
|
6183
|
+
{
|
6184
|
+
"type": "null"
|
6185
|
+
}
|
6186
|
+
],
|
6187
|
+
"default": null,
|
6188
|
+
"title": "Internal"
|
6189
|
+
},
|
6190
|
+
"type": {
|
6191
|
+
"const": "url",
|
6192
|
+
"default": "url",
|
6193
|
+
"title": "Type",
|
6194
|
+
"type": "string"
|
6195
|
+
},
|
6196
|
+
"url": {
|
6197
|
+
"title": "Url",
|
6198
|
+
"type": "string"
|
6199
|
+
}
|
6200
|
+
},
|
6201
|
+
"required": [
|
6202
|
+
"cited_text",
|
6203
|
+
"title",
|
6204
|
+
"internal",
|
6205
|
+
"type",
|
6206
|
+
"url"
|
6207
|
+
],
|
6208
|
+
"title": "UrlCitation",
|
6209
|
+
"type": "object",
|
6210
|
+
"additionalProperties": false
|
5794
6211
|
}
|
5795
6212
|
},
|
5796
6213
|
"description": "Evaluation log.",
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# ISC License
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2025, Andrea Giammarchi, @WebReflection
|
4
|
+
#
|
5
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
6
|
+
# purpose with or without fee is hereby granted, provided that the above
|
7
|
+
# copyright notice and this permission notice appear in all copies.
|
8
|
+
#
|
9
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
10
|
+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
11
|
+
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
12
|
+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
13
|
+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
14
|
+
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
15
|
+
# PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
|
17
|
+
import json as _json
|
18
|
+
|
19
|
+
class _Known:
|
20
|
+
def __init__(self):
|
21
|
+
self.key = []
|
22
|
+
self.value = []
|
23
|
+
|
24
|
+
class _String:
|
25
|
+
def __init__(self, value):
|
26
|
+
self.value = value
|
27
|
+
|
28
|
+
|
29
|
+
def _array_keys(value):
|
30
|
+
keys = []
|
31
|
+
i = 0
|
32
|
+
for _ in value:
|
33
|
+
keys.append(i)
|
34
|
+
i += 1
|
35
|
+
return keys
|
36
|
+
|
37
|
+
def _object_keys(value):
|
38
|
+
keys = []
|
39
|
+
for key in value:
|
40
|
+
keys.append(key)
|
41
|
+
return keys
|
42
|
+
|
43
|
+
def _is_array(value):
|
44
|
+
return isinstance(value, (list, tuple))
|
45
|
+
|
46
|
+
def _is_object(value):
|
47
|
+
return isinstance(value, dict)
|
48
|
+
|
49
|
+
def _is_string(value):
|
50
|
+
return isinstance(value, str)
|
51
|
+
|
52
|
+
def _index(known, input, value):
|
53
|
+
input.append(value)
|
54
|
+
index = str(len(input) - 1)
|
55
|
+
known.key.append(value)
|
56
|
+
known.value.append(index)
|
57
|
+
return index
|
58
|
+
|
59
|
+
def _loop(keys, input, known, output):
|
60
|
+
for key in keys:
|
61
|
+
value = output[key]
|
62
|
+
if isinstance(value, _String):
|
63
|
+
_ref(key, input[int(value.value)], input, known, output)
|
64
|
+
|
65
|
+
return output
|
66
|
+
|
67
|
+
def _ref(key, value, input, known, output):
|
68
|
+
if _is_array(value) and value not in known:
|
69
|
+
known.append(value)
|
70
|
+
value = _loop(_array_keys(value), input, known, value)
|
71
|
+
elif _is_object(value) and value not in known:
|
72
|
+
known.append(value)
|
73
|
+
value = _loop(_object_keys(value), input, known, value)
|
74
|
+
|
75
|
+
output[key] = value
|
76
|
+
|
77
|
+
def _relate(known, input, value):
|
78
|
+
if _is_string(value) or _is_array(value) or _is_object(value):
|
79
|
+
try:
|
80
|
+
return known.value[known.key.index(value)]
|
81
|
+
except:
|
82
|
+
return _index(known, input, value)
|
83
|
+
|
84
|
+
return value
|
85
|
+
|
86
|
+
def _transform(known, input, value):
|
87
|
+
if _is_array(value):
|
88
|
+
output = []
|
89
|
+
for val in value:
|
90
|
+
output.append(_relate(known, input, val))
|
91
|
+
return output
|
92
|
+
|
93
|
+
if _is_object(value):
|
94
|
+
obj = {}
|
95
|
+
for key in value:
|
96
|
+
obj[key] = _relate(known, input, value[key])
|
97
|
+
return obj
|
98
|
+
|
99
|
+
return value
|
100
|
+
|
101
|
+
def _wrap(value):
|
102
|
+
if _is_string(value):
|
103
|
+
return _String(value)
|
104
|
+
|
105
|
+
if _is_array(value):
|
106
|
+
i = 0
|
107
|
+
for val in value:
|
108
|
+
value[i] = _wrap(val)
|
109
|
+
i += 1
|
110
|
+
|
111
|
+
elif _is_object(value):
|
112
|
+
for key in value:
|
113
|
+
value[key] = _wrap(value[key])
|
114
|
+
|
115
|
+
return value
|
116
|
+
|
117
|
+
def parse(value, *args, **kwargs):
|
118
|
+
json = _json.loads(value, *args, **kwargs)
|
119
|
+
wrapped = []
|
120
|
+
for value in json:
|
121
|
+
wrapped.append(_wrap(value))
|
122
|
+
|
123
|
+
input = []
|
124
|
+
for value in wrapped:
|
125
|
+
if isinstance(value, _String):
|
126
|
+
input.append(value.value)
|
127
|
+
else:
|
128
|
+
input.append(value)
|
129
|
+
|
130
|
+
value = input[0]
|
131
|
+
|
132
|
+
if _is_array(value):
|
133
|
+
return _loop(_array_keys(value), input, [value], value)
|
134
|
+
|
135
|
+
if _is_object(value):
|
136
|
+
return _loop(_object_keys(value), input, [value], value)
|
137
|
+
|
138
|
+
return value
|
139
|
+
|
140
|
+
|
141
|
+
def stringify(value, *args, **kwargs):
|
142
|
+
known = _Known()
|
143
|
+
input = []
|
144
|
+
output = []
|
145
|
+
i = int(_index(known, input, value))
|
146
|
+
while i < len(input):
|
147
|
+
output.append(_transform(known, input, input[i]))
|
148
|
+
i += 1
|
149
|
+
return _json.dumps(output, *args, **kwargs)
|