llama-stack-api 0.4.4__py3-none-any.whl → 0.5.0rc1__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.
- llama_stack_api/__init__.py +175 -20
- llama_stack_api/agents/__init__.py +38 -0
- llama_stack_api/agents/api.py +52 -0
- llama_stack_api/agents/fastapi_routes.py +268 -0
- llama_stack_api/agents/models.py +181 -0
- llama_stack_api/common/errors.py +15 -0
- llama_stack_api/connectors/__init__.py +38 -0
- llama_stack_api/connectors/api.py +50 -0
- llama_stack_api/connectors/fastapi_routes.py +103 -0
- llama_stack_api/connectors/models.py +103 -0
- llama_stack_api/conversations/__init__.py +61 -0
- llama_stack_api/conversations/api.py +44 -0
- llama_stack_api/conversations/fastapi_routes.py +177 -0
- llama_stack_api/conversations/models.py +245 -0
- llama_stack_api/datasetio/__init__.py +34 -0
- llama_stack_api/datasetio/api.py +42 -0
- llama_stack_api/datasetio/fastapi_routes.py +94 -0
- llama_stack_api/datasetio/models.py +48 -0
- llama_stack_api/eval/__init__.py +55 -0
- llama_stack_api/eval/api.py +51 -0
- llama_stack_api/eval/compat.py +300 -0
- llama_stack_api/eval/fastapi_routes.py +126 -0
- llama_stack_api/eval/models.py +141 -0
- llama_stack_api/inference/__init__.py +207 -0
- llama_stack_api/inference/api.py +93 -0
- llama_stack_api/inference/fastapi_routes.py +243 -0
- llama_stack_api/inference/models.py +1035 -0
- llama_stack_api/models/__init__.py +47 -0
- llama_stack_api/models/api.py +38 -0
- llama_stack_api/models/fastapi_routes.py +104 -0
- llama_stack_api/{models.py → models/models.py} +65 -79
- llama_stack_api/openai_responses.py +32 -6
- llama_stack_api/post_training/__init__.py +73 -0
- llama_stack_api/post_training/api.py +36 -0
- llama_stack_api/post_training/fastapi_routes.py +116 -0
- llama_stack_api/{post_training.py → post_training/models.py} +55 -86
- llama_stack_api/prompts/__init__.py +47 -0
- llama_stack_api/prompts/api.py +44 -0
- llama_stack_api/prompts/fastapi_routes.py +163 -0
- llama_stack_api/prompts/models.py +177 -0
- llama_stack_api/resource.py +0 -1
- llama_stack_api/safety/__init__.py +37 -0
- llama_stack_api/safety/api.py +29 -0
- llama_stack_api/safety/datatypes.py +83 -0
- llama_stack_api/safety/fastapi_routes.py +55 -0
- llama_stack_api/safety/models.py +38 -0
- llama_stack_api/schema_utils.py +47 -4
- llama_stack_api/scoring/__init__.py +66 -0
- llama_stack_api/scoring/api.py +35 -0
- llama_stack_api/scoring/fastapi_routes.py +67 -0
- llama_stack_api/scoring/models.py +81 -0
- llama_stack_api/scoring_functions/__init__.py +50 -0
- llama_stack_api/scoring_functions/api.py +39 -0
- llama_stack_api/scoring_functions/fastapi_routes.py +108 -0
- llama_stack_api/{scoring_functions.py → scoring_functions/models.py} +67 -64
- llama_stack_api/shields/__init__.py +41 -0
- llama_stack_api/shields/api.py +39 -0
- llama_stack_api/shields/fastapi_routes.py +104 -0
- llama_stack_api/shields/models.py +74 -0
- llama_stack_api/validators.py +46 -0
- llama_stack_api/vector_io/__init__.py +88 -0
- llama_stack_api/vector_io/api.py +234 -0
- llama_stack_api/vector_io/fastapi_routes.py +447 -0
- llama_stack_api/{vector_io.py → vector_io/models.py} +99 -377
- {llama_stack_api-0.4.4.dist-info → llama_stack_api-0.5.0rc1.dist-info}/METADATA +1 -1
- llama_stack_api-0.5.0rc1.dist-info/RECORD +115 -0
- llama_stack_api/agents.py +0 -173
- llama_stack_api/connectors.py +0 -146
- llama_stack_api/conversations.py +0 -270
- llama_stack_api/datasetio.py +0 -55
- llama_stack_api/eval.py +0 -137
- llama_stack_api/inference.py +0 -1169
- llama_stack_api/prompts.py +0 -203
- llama_stack_api/safety.py +0 -132
- llama_stack_api/scoring.py +0 -93
- llama_stack_api/shields.py +0 -93
- llama_stack_api-0.4.4.dist-info/RECORD +0 -70
- {llama_stack_api-0.4.4.dist-info → llama_stack_api-0.5.0rc1.dist-info}/WHEEL +0 -0
- {llama_stack_api-0.4.4.dist-info → llama_stack_api-0.5.0rc1.dist-info}/top_level.txt +0 -0
llama_stack_api/__init__.py
CHANGED
|
@@ -22,7 +22,21 @@ and considered a code smell. All exported symbols are explicitly listed in __all
|
|
|
22
22
|
__version__ = "0.4.0.dev0"
|
|
23
23
|
|
|
24
24
|
# Import submodules for those who need them
|
|
25
|
-
from . import
|
|
25
|
+
from .schema_utils import ( # noqa: I001
|
|
26
|
+
CallableT,
|
|
27
|
+
ExtraBodyField,
|
|
28
|
+
SchemaInfo,
|
|
29
|
+
WebMethod,
|
|
30
|
+
clear_dynamic_schema_types,
|
|
31
|
+
get_registered_schema_info,
|
|
32
|
+
iter_dynamic_schema_types,
|
|
33
|
+
iter_json_schema_types,
|
|
34
|
+
iter_registered_schema_types,
|
|
35
|
+
json_schema_type,
|
|
36
|
+
register_dynamic_schema_type,
|
|
37
|
+
register_schema,
|
|
38
|
+
webmethod,
|
|
39
|
+
)
|
|
26
40
|
from .admin import (
|
|
27
41
|
Admin,
|
|
28
42
|
ApiFilter,
|
|
@@ -37,7 +51,17 @@ from .admin import (
|
|
|
37
51
|
)
|
|
38
52
|
|
|
39
53
|
# Import all public API symbols
|
|
40
|
-
from .agents import
|
|
54
|
+
from .agents import (
|
|
55
|
+
Agents,
|
|
56
|
+
CreateResponseRequest,
|
|
57
|
+
DeleteResponseRequest,
|
|
58
|
+
ListResponseInputItemsRequest,
|
|
59
|
+
ListResponsesRequest,
|
|
60
|
+
ResponseGuardrail,
|
|
61
|
+
ResponseGuardrailSpec,
|
|
62
|
+
ResponseItemInclude,
|
|
63
|
+
RetrieveResponseRequest,
|
|
64
|
+
)
|
|
41
65
|
from .batches import (
|
|
42
66
|
Batches,
|
|
43
67
|
BatchObject,
|
|
@@ -70,6 +94,8 @@ from .common.content_types import (
|
|
|
70
94
|
)
|
|
71
95
|
from .common.errors import (
|
|
72
96
|
ConflictError,
|
|
97
|
+
ConnectorNotFoundError,
|
|
98
|
+
ConnectorToolNotFoundError,
|
|
73
99
|
DatasetNotFoundError,
|
|
74
100
|
InvalidConversationIdError,
|
|
75
101
|
ModelNotFoundError,
|
|
@@ -97,8 +123,12 @@ from .connectors import (
|
|
|
97
123
|
ConnectorType,
|
|
98
124
|
ListConnectorsResponse,
|
|
99
125
|
ListToolsResponse,
|
|
126
|
+
GetConnectorRequest,
|
|
127
|
+
GetConnectorToolRequest,
|
|
128
|
+
ListConnectorToolsRequest,
|
|
100
129
|
)
|
|
101
130
|
from .conversations import (
|
|
131
|
+
AddItemsRequest,
|
|
102
132
|
Conversation,
|
|
103
133
|
ConversationDeletedResource,
|
|
104
134
|
ConversationItem,
|
|
@@ -108,9 +138,21 @@ from .conversations import (
|
|
|
108
138
|
ConversationItemList,
|
|
109
139
|
ConversationMessage,
|
|
110
140
|
Conversations,
|
|
141
|
+
CreateConversationRequest,
|
|
142
|
+
DeleteConversationRequest,
|
|
143
|
+
DeleteItemRequest,
|
|
144
|
+
GetConversationRequest,
|
|
145
|
+
ListItemsRequest,
|
|
111
146
|
Metadata,
|
|
147
|
+
RetrieveItemRequest,
|
|
148
|
+
UpdateConversationRequest,
|
|
149
|
+
)
|
|
150
|
+
from .datasetio import (
|
|
151
|
+
AppendRowsRequest,
|
|
152
|
+
DatasetIO,
|
|
153
|
+
DatasetStore,
|
|
154
|
+
IterRowsRequest,
|
|
112
155
|
)
|
|
113
|
-
from .datasetio import DatasetIO, DatasetStore
|
|
114
156
|
from .datasets import (
|
|
115
157
|
CommonDatasetFields,
|
|
116
158
|
Dataset,
|
|
@@ -143,7 +185,27 @@ from .datatypes import (
|
|
|
143
185
|
ToolGroupsProtocolPrivate,
|
|
144
186
|
VectorStoresProtocolPrivate,
|
|
145
187
|
)
|
|
146
|
-
from .eval import
|
|
188
|
+
from .eval import (
|
|
189
|
+
BenchmarkConfig,
|
|
190
|
+
BenchmarkIdRequest,
|
|
191
|
+
Eval,
|
|
192
|
+
EvalCandidate,
|
|
193
|
+
EvaluateResponse,
|
|
194
|
+
EvaluateRowsBodyRequest,
|
|
195
|
+
EvaluateRowsRequest,
|
|
196
|
+
JobCancelRequest,
|
|
197
|
+
JobResultRequest,
|
|
198
|
+
JobStatusRequest,
|
|
199
|
+
ModelCandidate,
|
|
200
|
+
RunEvalBodyRequest,
|
|
201
|
+
RunEvalRequest,
|
|
202
|
+
# Backward compatibility helpers
|
|
203
|
+
resolve_evaluate_rows_request,
|
|
204
|
+
resolve_job_cancel_request,
|
|
205
|
+
resolve_job_result_request,
|
|
206
|
+
resolve_job_status_request,
|
|
207
|
+
resolve_run_eval_request,
|
|
208
|
+
)
|
|
147
209
|
from .file_processors import FileProcessors, ProcessFileResponse
|
|
148
210
|
from .files import (
|
|
149
211
|
DeleteFileRequest,
|
|
@@ -165,12 +227,14 @@ from .inference import (
|
|
|
165
227
|
EmbeddingsResponse,
|
|
166
228
|
EmbeddingTaskType,
|
|
167
229
|
Fp8QuantizationConfig,
|
|
230
|
+
GetChatCompletionRequest,
|
|
168
231
|
GrammarResponseFormat,
|
|
169
232
|
GreedySamplingStrategy,
|
|
170
233
|
Inference,
|
|
171
234
|
InferenceProvider,
|
|
172
235
|
Int4QuantizationConfig,
|
|
173
236
|
JsonSchemaResponseFormat,
|
|
237
|
+
ListChatCompletionsRequest,
|
|
174
238
|
ListOpenAIChatCompletionResponse,
|
|
175
239
|
LogProbConfig,
|
|
176
240
|
ModelStore,
|
|
@@ -208,6 +272,7 @@ from .inference import (
|
|
|
208
272
|
OpenAIEmbeddingUsage,
|
|
209
273
|
OpenAIFile,
|
|
210
274
|
OpenAIFileFile,
|
|
275
|
+
OpenAIFinishReason,
|
|
211
276
|
OpenAIImageURL,
|
|
212
277
|
OpenAIJSONSchema,
|
|
213
278
|
OpenAIMessageParam,
|
|
@@ -241,6 +306,7 @@ from .inference import (
|
|
|
241
306
|
from .inspect_api import Inspect
|
|
242
307
|
from .models import (
|
|
243
308
|
CommonModelFields,
|
|
309
|
+
GetModelRequest,
|
|
244
310
|
ListModelsResponse,
|
|
245
311
|
Model,
|
|
246
312
|
ModelInput,
|
|
@@ -248,6 +314,8 @@ from .models import (
|
|
|
248
314
|
ModelType,
|
|
249
315
|
OpenAIListModelsResponse,
|
|
250
316
|
OpenAIModel,
|
|
317
|
+
RegisterModelRequest,
|
|
318
|
+
UnregisterModelRequest,
|
|
251
319
|
)
|
|
252
320
|
from .openai_responses import (
|
|
253
321
|
AllowedToolsFilter,
|
|
@@ -339,6 +407,7 @@ from .openai_responses import (
|
|
|
339
407
|
OpenAIResponseOutputMessageMCPListTools,
|
|
340
408
|
OpenAIResponseOutputMessageWebSearchToolCall,
|
|
341
409
|
OpenAIResponsePrompt,
|
|
410
|
+
OpenAIResponseReasoning,
|
|
342
411
|
OpenAIResponseText,
|
|
343
412
|
OpenAIResponseTextFormat,
|
|
344
413
|
OpenAIResponseTool,
|
|
@@ -350,11 +419,14 @@ from .openai_responses import (
|
|
|
350
419
|
)
|
|
351
420
|
from .post_training import (
|
|
352
421
|
AlgorithmConfig,
|
|
422
|
+
CancelTrainingJobRequest,
|
|
353
423
|
DataConfig,
|
|
354
424
|
DatasetFormat,
|
|
355
425
|
DPOAlignmentConfig,
|
|
356
426
|
DPOLossType,
|
|
357
427
|
EfficiencyConfig,
|
|
428
|
+
GetTrainingJobArtifactsRequest,
|
|
429
|
+
GetTrainingJobStatusRequest,
|
|
358
430
|
ListPostTrainingJobsResponse,
|
|
359
431
|
LoraFinetuningConfig,
|
|
360
432
|
OptimizerConfig,
|
|
@@ -365,11 +437,25 @@ from .post_training import (
|
|
|
365
437
|
PostTrainingJobLogStream,
|
|
366
438
|
PostTrainingJobStatusResponse,
|
|
367
439
|
PostTrainingRLHFRequest,
|
|
440
|
+
PreferenceOptimizeRequest,
|
|
368
441
|
QATFinetuningConfig,
|
|
369
442
|
RLHFAlgorithm,
|
|
443
|
+
SupervisedFineTuneRequest,
|
|
370
444
|
TrainingConfig,
|
|
371
445
|
)
|
|
372
|
-
from .prompts import
|
|
446
|
+
from .prompts import (
|
|
447
|
+
CreatePromptRequest,
|
|
448
|
+
DeletePromptRequest,
|
|
449
|
+
GetPromptRequest,
|
|
450
|
+
ListPromptsResponse,
|
|
451
|
+
ListPromptVersionsRequest,
|
|
452
|
+
Prompt,
|
|
453
|
+
Prompts,
|
|
454
|
+
SetDefaultVersionBodyRequest,
|
|
455
|
+
SetDefaultVersionRequest,
|
|
456
|
+
UpdatePromptBodyRequest,
|
|
457
|
+
UpdatePromptRequest,
|
|
458
|
+
)
|
|
373
459
|
from .providers import Providers
|
|
374
460
|
from .rag_tool import (
|
|
375
461
|
DefaultRAGQueryGeneratorConfig,
|
|
@@ -388,29 +474,19 @@ from .resource import Resource, ResourceType
|
|
|
388
474
|
from .safety import (
|
|
389
475
|
ModerationObject,
|
|
390
476
|
ModerationObjectResults,
|
|
477
|
+
RunModerationRequest,
|
|
478
|
+
RunShieldRequest,
|
|
391
479
|
RunShieldResponse,
|
|
392
480
|
Safety,
|
|
393
481
|
SafetyViolation,
|
|
394
482
|
ShieldStore,
|
|
395
483
|
ViolationLevel,
|
|
396
484
|
)
|
|
397
|
-
|
|
398
|
-
CallableT,
|
|
399
|
-
ExtraBodyField,
|
|
400
|
-
SchemaInfo,
|
|
401
|
-
WebMethod,
|
|
402
|
-
clear_dynamic_schema_types,
|
|
403
|
-
get_registered_schema_info,
|
|
404
|
-
iter_dynamic_schema_types,
|
|
405
|
-
iter_json_schema_types,
|
|
406
|
-
iter_registered_schema_types,
|
|
407
|
-
json_schema_type,
|
|
408
|
-
register_dynamic_schema_type,
|
|
409
|
-
register_schema,
|
|
410
|
-
webmethod,
|
|
411
|
-
)
|
|
485
|
+
|
|
412
486
|
from .scoring import (
|
|
487
|
+
ScoreBatchRequest,
|
|
413
488
|
ScoreBatchResponse,
|
|
489
|
+
ScoreRequest,
|
|
414
490
|
ScoreResponse,
|
|
415
491
|
Scoring,
|
|
416
492
|
ScoringFunctionStore,
|
|
@@ -421,21 +497,28 @@ from .scoring_functions import (
|
|
|
421
497
|
AggregationFunctionType,
|
|
422
498
|
BasicScoringFnParams,
|
|
423
499
|
CommonScoringFnFields,
|
|
500
|
+
GetScoringFunctionRequest,
|
|
501
|
+
ListScoringFunctionsRequest,
|
|
424
502
|
ListScoringFunctionsResponse,
|
|
425
503
|
LLMAsJudgeScoringFnParams,
|
|
426
504
|
RegexParserScoringFnParams,
|
|
505
|
+
RegisterScoringFunctionRequest,
|
|
427
506
|
ScoringFn,
|
|
428
507
|
ScoringFnInput,
|
|
429
508
|
ScoringFnParams,
|
|
430
509
|
ScoringFnParamsType,
|
|
431
510
|
ScoringFunctions,
|
|
511
|
+
UnregisterScoringFunctionRequest,
|
|
432
512
|
)
|
|
433
513
|
from .shields import (
|
|
434
514
|
CommonShieldFields,
|
|
515
|
+
GetShieldRequest,
|
|
435
516
|
ListShieldsResponse,
|
|
517
|
+
RegisterShieldRequest,
|
|
436
518
|
Shield,
|
|
437
519
|
ShieldInput,
|
|
438
520
|
Shields,
|
|
521
|
+
UnregisterShieldRequest,
|
|
439
522
|
)
|
|
440
523
|
from .tools import (
|
|
441
524
|
ListToolDefsResponse,
|
|
@@ -449,6 +532,7 @@ from .tools import (
|
|
|
449
532
|
ToolRuntime,
|
|
450
533
|
ToolStore,
|
|
451
534
|
)
|
|
535
|
+
from .validators import validate_embeddings_input_is_text
|
|
452
536
|
from .vector_io import (
|
|
453
537
|
Chunk,
|
|
454
538
|
ChunkMetadata,
|
|
@@ -488,9 +572,12 @@ from .version import (
|
|
|
488
572
|
LLAMA_STACK_API_V1ALPHA,
|
|
489
573
|
LLAMA_STACK_API_V1BETA,
|
|
490
574
|
)
|
|
575
|
+
from . import common # noqa: F401
|
|
576
|
+
|
|
491
577
|
|
|
492
578
|
__all__ = [
|
|
493
579
|
# Submodules
|
|
580
|
+
"schema_utils",
|
|
494
581
|
"common",
|
|
495
582
|
# Version constants
|
|
496
583
|
"LLAMA_STACK_API_V1",
|
|
@@ -499,6 +586,12 @@ __all__ = [
|
|
|
499
586
|
# API Symbols
|
|
500
587
|
"Agents",
|
|
501
588
|
"AggregationFunctionType",
|
|
589
|
+
# Agents Request Models
|
|
590
|
+
"CreateResponseRequest",
|
|
591
|
+
"DeleteResponseRequest",
|
|
592
|
+
"ListResponseInputItemsRequest",
|
|
593
|
+
"ListResponsesRequest",
|
|
594
|
+
"RetrieveResponseRequest",
|
|
502
595
|
"AlgorithmConfig",
|
|
503
596
|
"AllowedToolsFilter",
|
|
504
597
|
"Api",
|
|
@@ -508,6 +601,7 @@ __all__ = [
|
|
|
508
601
|
"Batches",
|
|
509
602
|
"BatchObject",
|
|
510
603
|
"CancelBatchRequest",
|
|
604
|
+
"CancelTrainingJobRequest",
|
|
511
605
|
"CreateBatchRequest",
|
|
512
606
|
"ListBatchesRequest",
|
|
513
607
|
"Benchmark",
|
|
@@ -532,9 +626,12 @@ __all__ = [
|
|
|
532
626
|
"CompletionInputType",
|
|
533
627
|
"CompletionRequest",
|
|
534
628
|
"Connector",
|
|
629
|
+
"ConnectorNotFoundError",
|
|
630
|
+
"ConnectorToolNotFoundError",
|
|
535
631
|
"ConnectorInput",
|
|
536
632
|
"Connectors",
|
|
537
633
|
"ConnectorType",
|
|
634
|
+
"AddItemsRequest",
|
|
538
635
|
"Conversation",
|
|
539
636
|
"ConversationDeletedResource",
|
|
540
637
|
"ConversationItem",
|
|
@@ -544,6 +641,13 @@ __all__ = [
|
|
|
544
641
|
"ConversationItemList",
|
|
545
642
|
"ConversationMessage",
|
|
546
643
|
"Conversations",
|
|
644
|
+
"CreateConversationRequest",
|
|
645
|
+
"DeleteConversationRequest",
|
|
646
|
+
"DeleteItemRequest",
|
|
647
|
+
"GetConversationRequest",
|
|
648
|
+
"ListItemsRequest",
|
|
649
|
+
"RetrieveItemRequest",
|
|
650
|
+
"UpdateConversationRequest",
|
|
547
651
|
"DPOAlignmentConfig",
|
|
548
652
|
"DPOLossType",
|
|
549
653
|
"DataConfig",
|
|
@@ -556,6 +660,8 @@ __all__ = [
|
|
|
556
660
|
"DatasetNotFoundError",
|
|
557
661
|
"DatasetStore",
|
|
558
662
|
"DatasetType",
|
|
663
|
+
"AppendRowsRequest",
|
|
664
|
+
"IterRowsRequest",
|
|
559
665
|
"Datasets",
|
|
560
666
|
"DatasetsProtocolPrivate",
|
|
561
667
|
"DefaultRAGQueryGeneratorConfig",
|
|
@@ -569,6 +675,20 @@ __all__ = [
|
|
|
569
675
|
"Eval",
|
|
570
676
|
"EvalCandidate",
|
|
571
677
|
"EvaluateResponse",
|
|
678
|
+
"EvaluateRowsBodyRequest",
|
|
679
|
+
"EvaluateRowsRequest",
|
|
680
|
+
"BenchmarkIdRequest",
|
|
681
|
+
"JobCancelRequest",
|
|
682
|
+
"JobResultRequest",
|
|
683
|
+
"JobStatusRequest",
|
|
684
|
+
"RunEvalBodyRequest",
|
|
685
|
+
"RunEvalRequest",
|
|
686
|
+
# Backward compatibility helpers
|
|
687
|
+
"resolve_run_eval_request",
|
|
688
|
+
"resolve_evaluate_rows_request",
|
|
689
|
+
"resolve_job_status_request",
|
|
690
|
+
"resolve_job_cancel_request",
|
|
691
|
+
"resolve_job_result_request",
|
|
572
692
|
"ExpiresAfter",
|
|
573
693
|
"ExternalApiSpec",
|
|
574
694
|
"ExtraBodyField",
|
|
@@ -618,10 +738,15 @@ __all__ = [
|
|
|
618
738
|
"ListBenchmarksResponse",
|
|
619
739
|
"RegisterBenchmarkRequest",
|
|
620
740
|
"UnregisterBenchmarkRequest",
|
|
741
|
+
"GetConnectorRequest",
|
|
742
|
+
"GetConnectorToolRequest",
|
|
743
|
+
"ListConnectorToolsRequest",
|
|
621
744
|
"ListConnectorsResponse",
|
|
622
745
|
"ListDatasetsResponse",
|
|
623
746
|
"ListFilesRequest",
|
|
624
747
|
"ListModelsResponse",
|
|
748
|
+
"GetChatCompletionRequest",
|
|
749
|
+
"ListChatCompletionsRequest",
|
|
625
750
|
"ListOpenAIChatCompletionResponse",
|
|
626
751
|
"ListOpenAIFileResponse",
|
|
627
752
|
"ListOpenAIResponseInputItem",
|
|
@@ -648,6 +773,11 @@ __all__ = [
|
|
|
648
773
|
"ModelType",
|
|
649
774
|
"ModelTypeError",
|
|
650
775
|
"Models",
|
|
776
|
+
"GetModelRequest",
|
|
777
|
+
"GetTrainingJobArtifactsRequest",
|
|
778
|
+
"GetTrainingJobStatusRequest",
|
|
779
|
+
"RegisterModelRequest",
|
|
780
|
+
"UnregisterModelRequest",
|
|
651
781
|
"ModelsProtocolPrivate",
|
|
652
782
|
"ModerationObject",
|
|
653
783
|
"ModerationObjectResults",
|
|
@@ -693,6 +823,7 @@ __all__ = [
|
|
|
693
823
|
"OpenAIFileFile",
|
|
694
824
|
"OpenAIFileObject",
|
|
695
825
|
"OpenAIFilePurpose",
|
|
826
|
+
"OpenAIFinishReason",
|
|
696
827
|
"OpenAIImageURL",
|
|
697
828
|
"OpenAIJSONSchema",
|
|
698
829
|
"OpenAIListModelsResponse",
|
|
@@ -786,6 +917,7 @@ __all__ = [
|
|
|
786
917
|
"OpenAIResponseOutputMessageMCPListTools",
|
|
787
918
|
"OpenAIResponseOutputMessageWebSearchToolCall",
|
|
788
919
|
"OpenAIResponsePrompt",
|
|
920
|
+
"OpenAIResponseReasoning",
|
|
789
921
|
"OpenAIResponseText",
|
|
790
922
|
"OpenAIResponseTextFormat",
|
|
791
923
|
"OpenAIResponseTool",
|
|
@@ -811,8 +943,17 @@ __all__ = [
|
|
|
811
943
|
"PostTrainingJobLogStream",
|
|
812
944
|
"PostTrainingJobStatusResponse",
|
|
813
945
|
"PostTrainingRLHFRequest",
|
|
946
|
+
"PreferenceOptimizeRequest",
|
|
814
947
|
"Prompt",
|
|
815
948
|
"Prompts",
|
|
949
|
+
"CreatePromptRequest",
|
|
950
|
+
"DeletePromptRequest",
|
|
951
|
+
"GetPromptRequest",
|
|
952
|
+
"ListPromptVersionsRequest",
|
|
953
|
+
"SetDefaultVersionBodyRequest",
|
|
954
|
+
"SetDefaultVersionRequest",
|
|
955
|
+
"UpdatePromptBodyRequest",
|
|
956
|
+
"UpdatePromptRequest",
|
|
816
957
|
"ProviderInfo",
|
|
817
958
|
"ProviderSpec",
|
|
818
959
|
"Providers",
|
|
@@ -850,12 +991,16 @@ __all__ = [
|
|
|
850
991
|
"RouteInfo",
|
|
851
992
|
"RoutingTable",
|
|
852
993
|
"RowsDataSource",
|
|
994
|
+
"RunModerationRequest",
|
|
995
|
+
"RunShieldRequest",
|
|
853
996
|
"RunShieldResponse",
|
|
854
997
|
"Safety",
|
|
855
998
|
"SafetyViolation",
|
|
856
999
|
"SamplingParams",
|
|
857
1000
|
"SamplingStrategy",
|
|
1001
|
+
"ScoreBatchRequest",
|
|
858
1002
|
"ScoreBatchResponse",
|
|
1003
|
+
"ScoreRequest",
|
|
859
1004
|
"ScoreResponse",
|
|
860
1005
|
"Scoring",
|
|
861
1006
|
"ScoringFn",
|
|
@@ -866,6 +1011,10 @@ __all__ = [
|
|
|
866
1011
|
"ScoringFunctions",
|
|
867
1012
|
"ScoringFunctionsProtocolPrivate",
|
|
868
1013
|
"ScoringResult",
|
|
1014
|
+
"GetScoringFunctionRequest",
|
|
1015
|
+
"ListScoringFunctionsRequest",
|
|
1016
|
+
"RegisterScoringFunctionRequest",
|
|
1017
|
+
"UnregisterScoringFunctionRequest",
|
|
869
1018
|
"ScoringResultRow",
|
|
870
1019
|
"Schema",
|
|
871
1020
|
"SchemaInfo",
|
|
@@ -876,9 +1025,13 @@ __all__ = [
|
|
|
876
1025
|
"ShieldStore",
|
|
877
1026
|
"Shields",
|
|
878
1027
|
"ShieldsProtocolPrivate",
|
|
1028
|
+
"GetShieldRequest",
|
|
1029
|
+
"RegisterShieldRequest",
|
|
1030
|
+
"UnregisterShieldRequest",
|
|
879
1031
|
"SpecialToolGroup",
|
|
880
1032
|
"StrictJsonType",
|
|
881
1033
|
"StringType",
|
|
1034
|
+
"SupervisedFineTuneRequest",
|
|
882
1035
|
"SystemMessage",
|
|
883
1036
|
"SystemMessageBehavior",
|
|
884
1037
|
"TextContentItem",
|
|
@@ -942,4 +1095,6 @@ __all__ = [
|
|
|
942
1095
|
"WebMethod",
|
|
943
1096
|
"WebSearchToolTypes",
|
|
944
1097
|
"WeightedRanker",
|
|
1098
|
+
# Validators
|
|
1099
|
+
"validate_embeddings_input_is_text",
|
|
945
1100
|
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the terms described in the LICENSE file in
|
|
5
|
+
# the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
"""Agents API protocol and models.
|
|
8
|
+
|
|
9
|
+
This module contains the Agents protocol definition for the OpenAI Responses API.
|
|
10
|
+
Pydantic models are defined in llama_stack_api.agents.models.
|
|
11
|
+
The FastAPI router is defined in llama_stack_api.agents.fastapi_routes.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from . import fastapi_routes
|
|
15
|
+
from .api import Agents
|
|
16
|
+
from .models import (
|
|
17
|
+
CreateResponseRequest,
|
|
18
|
+
DeleteResponseRequest,
|
|
19
|
+
ListResponseInputItemsRequest,
|
|
20
|
+
ListResponsesRequest,
|
|
21
|
+
ResponseGuardrail,
|
|
22
|
+
ResponseGuardrailSpec,
|
|
23
|
+
ResponseItemInclude,
|
|
24
|
+
RetrieveResponseRequest,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"Agents",
|
|
29
|
+
"CreateResponseRequest",
|
|
30
|
+
"DeleteResponseRequest",
|
|
31
|
+
"ListResponseInputItemsRequest",
|
|
32
|
+
"ListResponsesRequest",
|
|
33
|
+
"ResponseGuardrail",
|
|
34
|
+
"ResponseGuardrailSpec",
|
|
35
|
+
"ResponseItemInclude",
|
|
36
|
+
"RetrieveResponseRequest",
|
|
37
|
+
"fastapi_routes",
|
|
38
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the terms described in the LICENSE file in
|
|
5
|
+
# the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
from collections.abc import AsyncIterator
|
|
8
|
+
from typing import Protocol, runtime_checkable
|
|
9
|
+
|
|
10
|
+
from llama_stack_api.openai_responses import (
|
|
11
|
+
ListOpenAIResponseInputItem,
|
|
12
|
+
ListOpenAIResponseObject,
|
|
13
|
+
OpenAIDeleteResponseObject,
|
|
14
|
+
OpenAIResponseObject,
|
|
15
|
+
OpenAIResponseObjectStream,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
from .models import (
|
|
19
|
+
CreateResponseRequest,
|
|
20
|
+
DeleteResponseRequest,
|
|
21
|
+
ListResponseInputItemsRequest,
|
|
22
|
+
ListResponsesRequest,
|
|
23
|
+
RetrieveResponseRequest,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@runtime_checkable
|
|
28
|
+
class Agents(Protocol):
|
|
29
|
+
async def get_openai_response(
|
|
30
|
+
self,
|
|
31
|
+
request: RetrieveResponseRequest,
|
|
32
|
+
) -> OpenAIResponseObject: ...
|
|
33
|
+
|
|
34
|
+
async def create_openai_response(
|
|
35
|
+
self,
|
|
36
|
+
request: CreateResponseRequest,
|
|
37
|
+
) -> OpenAIResponseObject | AsyncIterator[OpenAIResponseObjectStream]: ...
|
|
38
|
+
|
|
39
|
+
async def list_openai_responses(
|
|
40
|
+
self,
|
|
41
|
+
request: ListResponsesRequest,
|
|
42
|
+
) -> ListOpenAIResponseObject: ...
|
|
43
|
+
|
|
44
|
+
async def list_openai_response_input_items(
|
|
45
|
+
self,
|
|
46
|
+
request: ListResponseInputItemsRequest,
|
|
47
|
+
) -> ListOpenAIResponseInputItem: ...
|
|
48
|
+
|
|
49
|
+
async def delete_openai_response(
|
|
50
|
+
self,
|
|
51
|
+
request: DeleteResponseRequest,
|
|
52
|
+
) -> OpenAIDeleteResponseObject: ...
|