llama-stack-api 0.6.1__tar.gz → 0.7.1__tar.gz
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-0.6.1 → llama_stack_api-0.7.1}/PKG-INFO +17 -6
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/README.md +16 -5
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/__init__.py +34 -63
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/benchmarks/api.py +2 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/benchmarks/models.py +4 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/common/content_types.py +2 -2
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/common/job_types.py +1 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/connectors/fastapi_routes.py +2 -2
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/conversations/models.py +2 -2
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datasetio/__init__.py +2 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datasetio/api.py +4 -2
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datasetio/fastapi_routes.py +6 -5
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datasetio/models.py +8 -1
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datasets/models.py +0 -2
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datatypes.py +50 -17
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/files/fastapi_routes.py +2 -2
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/files/models.py +3 -1
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/inference/__init__.py +8 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/inference/api.py +22 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/inference/fastapi_routes.py +3 -3
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/inference/models.py +86 -9
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/internal/sqlstore.py +4 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/llama_stack_api.egg-info/PKG-INFO +17 -6
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/llama_stack_api.egg-info/SOURCES.txt +16 -20
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/models/fastapi_routes.py +1 -33
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/models/models.py +4 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/openai_responses.py +60 -1
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/providers/api.py +2 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/pyproject.toml +4 -4
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/resource.py +2 -0
- {llama_stack_api-0.6.1/agents → llama_stack_api-0.7.1/responses}/__init__.py +10 -6
- {llama_stack_api-0.6.1/agents → llama_stack_api-0.7.1/responses}/api.py +9 -1
- {llama_stack_api-0.6.1/agents → llama_stack_api-0.7.1/responses}/fastapi_routes.py +102 -15
- {llama_stack_api-0.6.1/agents → llama_stack_api-0.7.1/responses}/models.py +25 -2
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/router_utils.py +6 -6
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/schema_utils.py +11 -6
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/scoring_functions/api.py +2 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/scoring_functions/models.py +4 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/shields/api.py +2 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/shields/models.py +4 -0
- llama_stack_api-0.7.1/tools/__init__.py +46 -0
- llama_stack_api-0.7.1/tools/api.py +102 -0
- llama_stack_api-0.7.1/tools/fastapi_routes.py +58 -0
- llama_stack_api-0.7.1/tools/models.py +121 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/vector_io/api.py +4 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/vector_io/fastapi_routes.py +0 -2
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/vector_io/models.py +7 -5
- llama_stack_api-0.6.1/common/training_types.py +0 -47
- llama_stack_api-0.6.1/post_training/__init__.py +0 -73
- llama_stack_api-0.6.1/post_training/api.py +0 -36
- llama_stack_api-0.6.1/post_training/fastapi_routes.py +0 -116
- llama_stack_api-0.6.1/post_training/models.py +0 -339
- llama_stack_api-0.6.1/tools.py +0 -226
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/admin/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/admin/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/admin/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/admin/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/batches/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/batches/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/batches/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/batches/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/benchmarks/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/benchmarks/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/common/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/common/errors.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/common/responses.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/common/type_system.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/common/upload_safety.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/connectors/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/connectors/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/connectors/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/conversations/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/conversations/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/conversations/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datasets/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datasets/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/datasets/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/eval/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/eval/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/eval/compat.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/eval/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/eval/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/file_processors/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/file_processors/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/file_processors/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/file_processors/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/files/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/files/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/filters.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/inspect_api/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/inspect_api/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/inspect_api/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/inspect_api/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/internal/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/internal/kvstore.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/llama_stack_api.egg-info/dependency_links.txt +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/llama_stack_api.egg-info/requires.txt +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/llama_stack_api.egg-info/top_level.txt +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/models/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/models/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/prompts/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/prompts/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/prompts/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/prompts/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/providers/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/providers/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/providers/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/py.typed +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/rag_tool.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/safety/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/safety/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/safety/datatypes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/safety/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/safety/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/scoring/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/scoring/api.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/scoring/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/scoring/models.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/scoring_functions/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/scoring_functions/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/setup.cfg +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/shields/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/shields/fastapi_routes.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/uv.lock +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/validators.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/vector_io/__init__.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/vector_stores.py +0 -0
- {llama_stack_api-0.6.1 → llama_stack_api-0.7.1}/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: llama-stack-api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: API and Provider specifications for Llama Stack - lightweight package with protocol definitions and provider specs
|
|
5
5
|
Author-email: Meta Llama <llama-oss@meta.com>
|
|
6
6
|
License: MIT
|
|
@@ -66,8 +66,13 @@ uv pip install llama-stack-api
|
|
|
66
66
|
## Dependencies
|
|
67
67
|
|
|
68
68
|
Minimal dependencies:
|
|
69
|
+
|
|
70
|
+
- `openai>=2.5.0` - For OpenAI-compatible types
|
|
71
|
+
- `fastapi>=0.115.0,<1.0` - For FastAPI route definitions
|
|
69
72
|
- `pydantic>=2.11.9` - For data validation and serialization
|
|
70
73
|
- `jsonschema` - For JSON schema utilities
|
|
74
|
+
- `opentelemetry-sdk>=1.30.0` - For telemetry
|
|
75
|
+
- `opentelemetry-exporter-otlp-proto-http>=1.30.0` - For OTLP export
|
|
71
76
|
|
|
72
77
|
## Versioning
|
|
73
78
|
|
|
@@ -77,19 +82,24 @@ This package follows semantic versioning independently from the main `llama-stac
|
|
|
77
82
|
- **Minor versions** (0.x.0): New APIs, backward-compatible changes
|
|
78
83
|
- **Major versions** (x.0.0): Breaking changes to existing APIs
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
The version is determined dynamically via `setuptools-scm` at build time.
|
|
81
86
|
|
|
82
87
|
## Usage Example
|
|
83
88
|
|
|
84
89
|
```python
|
|
85
|
-
from llama_stack_api
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
from llama_stack_api import (
|
|
91
|
+
Api,
|
|
92
|
+
Inference,
|
|
93
|
+
InlineProviderSpec,
|
|
94
|
+
OpenAIChatCompletionRequestWithExtraBody,
|
|
95
|
+
)
|
|
88
96
|
|
|
89
97
|
|
|
90
98
|
# Use protocol definitions for type checking
|
|
91
99
|
class MyInferenceProvider(Inference):
|
|
92
|
-
async def
|
|
100
|
+
async def openai_chat_completion(
|
|
101
|
+
self, request: OpenAIChatCompletionRequestWithExtraBody
|
|
102
|
+
):
|
|
93
103
|
# Your implementation
|
|
94
104
|
pass
|
|
95
105
|
|
|
@@ -107,6 +117,7 @@ my_provider_spec = InlineProviderSpec(
|
|
|
107
117
|
## Relationship to llama-stack
|
|
108
118
|
|
|
109
119
|
The main `llama-stack` package depends on `llama-stack-api` and provides:
|
|
120
|
+
|
|
110
121
|
- Full server implementation
|
|
111
122
|
- Built-in provider implementations
|
|
112
123
|
- CLI tools for running and managing stacks
|
|
@@ -42,8 +42,13 @@ uv pip install llama-stack-api
|
|
|
42
42
|
## Dependencies
|
|
43
43
|
|
|
44
44
|
Minimal dependencies:
|
|
45
|
+
|
|
46
|
+
- `openai>=2.5.0` - For OpenAI-compatible types
|
|
47
|
+
- `fastapi>=0.115.0,<1.0` - For FastAPI route definitions
|
|
45
48
|
- `pydantic>=2.11.9` - For data validation and serialization
|
|
46
49
|
- `jsonschema` - For JSON schema utilities
|
|
50
|
+
- `opentelemetry-sdk>=1.30.0` - For telemetry
|
|
51
|
+
- `opentelemetry-exporter-otlp-proto-http>=1.30.0` - For OTLP export
|
|
47
52
|
|
|
48
53
|
## Versioning
|
|
49
54
|
|
|
@@ -53,19 +58,24 @@ This package follows semantic versioning independently from the main `llama-stac
|
|
|
53
58
|
- **Minor versions** (0.x.0): New APIs, backward-compatible changes
|
|
54
59
|
- **Major versions** (x.0.0): Breaking changes to existing APIs
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
The version is determined dynamically via `setuptools-scm` at build time.
|
|
57
62
|
|
|
58
63
|
## Usage Example
|
|
59
64
|
|
|
60
65
|
```python
|
|
61
|
-
from llama_stack_api
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
from llama_stack_api import (
|
|
67
|
+
Api,
|
|
68
|
+
Inference,
|
|
69
|
+
InlineProviderSpec,
|
|
70
|
+
OpenAIChatCompletionRequestWithExtraBody,
|
|
71
|
+
)
|
|
64
72
|
|
|
65
73
|
|
|
66
74
|
# Use protocol definitions for type checking
|
|
67
75
|
class MyInferenceProvider(Inference):
|
|
68
|
-
async def
|
|
76
|
+
async def openai_chat_completion(
|
|
77
|
+
self, request: OpenAIChatCompletionRequestWithExtraBody
|
|
78
|
+
):
|
|
69
79
|
# Your implementation
|
|
70
80
|
pass
|
|
71
81
|
|
|
@@ -83,6 +93,7 @@ my_provider_spec = InlineProviderSpec(
|
|
|
83
93
|
## Relationship to llama-stack
|
|
84
94
|
|
|
85
95
|
The main `llama-stack` package depends on `llama-stack-api` and provides:
|
|
96
|
+
|
|
86
97
|
- Full server implementation
|
|
87
98
|
- Built-in provider implementations
|
|
88
99
|
- CLI tools for running and managing stacks
|
|
@@ -15,18 +15,23 @@ server implementation.
|
|
|
15
15
|
All imports from this package MUST use the form:
|
|
16
16
|
from llama_stack_api import <symbol>
|
|
17
17
|
|
|
18
|
-
Sub-module imports (e.g., from llama_stack_api.
|
|
18
|
+
Sub-module imports (e.g., from llama_stack_api.responses import Responses) are NOT supported
|
|
19
19
|
and considered a code smell. All exported symbols are explicitly listed in __all__.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
try:
|
|
23
|
+
from importlib.metadata import PackageNotFoundError
|
|
24
|
+
from importlib.metadata import version as _metadata_version
|
|
25
|
+
|
|
26
|
+
__version__ = _metadata_version("llama-stack-api")
|
|
27
|
+
except PackageNotFoundError:
|
|
28
|
+
__version__ = "0.0.0.dev0"
|
|
23
29
|
|
|
24
30
|
# Import submodules for those who need them
|
|
25
31
|
from .schema_utils import ( # noqa: I001
|
|
26
32
|
CallableT,
|
|
27
33
|
ExtraBodyField,
|
|
28
34
|
SchemaInfo,
|
|
29
|
-
WebMethod,
|
|
30
35
|
clear_dynamic_schema_types,
|
|
31
36
|
get_registered_schema_info,
|
|
32
37
|
iter_dynamic_schema_types,
|
|
@@ -35,7 +40,6 @@ from .schema_utils import ( # noqa: I001
|
|
|
35
40
|
json_schema_type,
|
|
36
41
|
register_dynamic_schema_type,
|
|
37
42
|
register_schema,
|
|
38
|
-
webmethod,
|
|
39
43
|
)
|
|
40
44
|
from .admin import (
|
|
41
45
|
Admin,
|
|
@@ -51,8 +55,9 @@ from .admin import (
|
|
|
51
55
|
)
|
|
52
56
|
|
|
53
57
|
# Import all public API symbols
|
|
54
|
-
from .
|
|
55
|
-
|
|
58
|
+
from .responses import (
|
|
59
|
+
Responses,
|
|
60
|
+
CancelResponseRequest,
|
|
56
61
|
CreateResponseRequest,
|
|
57
62
|
DeleteResponseRequest,
|
|
58
63
|
ListResponseInputItemsRequest,
|
|
@@ -61,6 +66,7 @@ from .agents import (
|
|
|
61
66
|
ResponseGuardrailSpec,
|
|
62
67
|
ResponseItemInclude,
|
|
63
68
|
ResponseTruncation,
|
|
69
|
+
ResponseStreamOptions,
|
|
64
70
|
RetrieveResponseRequest,
|
|
65
71
|
)
|
|
66
72
|
from .batches import (
|
|
@@ -117,7 +123,6 @@ from .common.errors import (
|
|
|
117
123
|
)
|
|
118
124
|
from .common.job_types import Job, JobStatus
|
|
119
125
|
from .common.responses import Order, PaginatedResponse
|
|
120
|
-
from .common.training_types import Checkpoint, PostTrainingMetric
|
|
121
126
|
from .common.type_system import (
|
|
122
127
|
ChatCompletionInputType,
|
|
123
128
|
CompletionInputType,
|
|
@@ -157,6 +162,7 @@ from .conversations import (
|
|
|
157
162
|
UpdateConversationRequest,
|
|
158
163
|
)
|
|
159
164
|
from .datasetio import (
|
|
165
|
+
AppendRowsParams,
|
|
160
166
|
AppendRowsRequest,
|
|
161
167
|
DatasetIO,
|
|
162
168
|
DatasetStore,
|
|
@@ -250,6 +256,8 @@ from .inference import (
|
|
|
250
256
|
ModelStore,
|
|
251
257
|
OpenAIAssistantMessageParam,
|
|
252
258
|
OpenAIChatCompletion,
|
|
259
|
+
OpenAIChatCompletionChunkWithReasoning,
|
|
260
|
+
OpenAIChatCompletionWithReasoning,
|
|
253
261
|
OpenAIChatCompletionChunk,
|
|
254
262
|
OpenAIChatCompletionContentPartImageParam,
|
|
255
263
|
OpenAIChatCompletionContentPartParam,
|
|
@@ -257,6 +265,8 @@ from .inference import (
|
|
|
257
265
|
OpenAIChatCompletionMessageContent,
|
|
258
266
|
OpenAIChatCompletionRequestWithExtraBody,
|
|
259
267
|
OpenAIChatCompletionTextOnlyMessageContent,
|
|
268
|
+
OpenAIChatCompletionCustomToolCall,
|
|
269
|
+
OpenAIChatCompletionCustomToolCallFunction,
|
|
260
270
|
OpenAIChatCompletionToolCall,
|
|
261
271
|
OpenAIChatCompletionToolCallFunction,
|
|
262
272
|
OpenAIChatCompletionToolChoice,
|
|
@@ -417,6 +427,9 @@ from .openai_responses import (
|
|
|
417
427
|
OpenAIResponseOutputMessageFunctionToolCall,
|
|
418
428
|
OpenAIResponseOutputMessageMCPCall,
|
|
419
429
|
OpenAIResponseOutputMessageMCPListTools,
|
|
430
|
+
OpenAIResponseOutputMessageReasoningContent,
|
|
431
|
+
OpenAIResponseOutputMessageReasoningItem,
|
|
432
|
+
OpenAIResponseOutputMessageReasoningSummary,
|
|
420
433
|
OpenAIResponseOutputMessageWebSearchToolCall,
|
|
421
434
|
OpenAIResponsePrompt,
|
|
422
435
|
OpenAIResponseReasoning,
|
|
@@ -429,32 +442,6 @@ from .openai_responses import (
|
|
|
429
442
|
OpenAIResponseUsageOutputTokensDetails,
|
|
430
443
|
WebSearchToolTypes,
|
|
431
444
|
)
|
|
432
|
-
from .post_training import (
|
|
433
|
-
AlgorithmConfig,
|
|
434
|
-
CancelTrainingJobRequest,
|
|
435
|
-
DataConfig,
|
|
436
|
-
DatasetFormat,
|
|
437
|
-
DPOAlignmentConfig,
|
|
438
|
-
DPOLossType,
|
|
439
|
-
EfficiencyConfig,
|
|
440
|
-
GetTrainingJobArtifactsRequest,
|
|
441
|
-
GetTrainingJobStatusRequest,
|
|
442
|
-
ListPostTrainingJobsResponse,
|
|
443
|
-
LoraFinetuningConfig,
|
|
444
|
-
OptimizerConfig,
|
|
445
|
-
OptimizerType,
|
|
446
|
-
PostTraining,
|
|
447
|
-
PostTrainingJob,
|
|
448
|
-
PostTrainingJobArtifactsResponse,
|
|
449
|
-
PostTrainingJobLogStream,
|
|
450
|
-
PostTrainingJobStatusResponse,
|
|
451
|
-
PostTrainingRLHFRequest,
|
|
452
|
-
PreferenceOptimizeRequest,
|
|
453
|
-
QATFinetuningConfig,
|
|
454
|
-
RLHFAlgorithm,
|
|
455
|
-
SupervisedFineTuneRequest,
|
|
456
|
-
TrainingConfig,
|
|
457
|
-
)
|
|
458
445
|
from .prompts import (
|
|
459
446
|
CreatePromptRequest,
|
|
460
447
|
DeletePromptRequest,
|
|
@@ -535,6 +522,7 @@ from .shields import (
|
|
|
535
522
|
from .tools import (
|
|
536
523
|
ListToolDefsResponse,
|
|
537
524
|
ListToolGroupsResponse,
|
|
525
|
+
ListToolsRequest,
|
|
538
526
|
SpecialToolGroup,
|
|
539
527
|
ToolDef,
|
|
540
528
|
ToolGroup,
|
|
@@ -609,15 +597,15 @@ __all__ = [
|
|
|
609
597
|
"LLAMA_STACK_API_V1ALPHA",
|
|
610
598
|
"LLAMA_STACK_API_V1BETA",
|
|
611
599
|
# API Symbols
|
|
612
|
-
"
|
|
600
|
+
"Responses",
|
|
613
601
|
"AggregationFunctionType",
|
|
614
|
-
#
|
|
602
|
+
# Responses Request Models
|
|
603
|
+
"CancelResponseRequest",
|
|
615
604
|
"CreateResponseRequest",
|
|
616
605
|
"DeleteResponseRequest",
|
|
617
606
|
"ListResponseInputItemsRequest",
|
|
618
607
|
"ListResponsesRequest",
|
|
619
608
|
"RetrieveResponseRequest",
|
|
620
|
-
"AlgorithmConfig",
|
|
621
609
|
"AllowedToolsFilter",
|
|
622
610
|
"Api",
|
|
623
611
|
"ApiFilter",
|
|
@@ -627,7 +615,6 @@ __all__ = [
|
|
|
627
615
|
"BatchNotFoundError",
|
|
628
616
|
"BatchObject",
|
|
629
617
|
"CancelBatchRequest",
|
|
630
|
-
"CancelTrainingJobRequest",
|
|
631
618
|
"CreateBatchRequest",
|
|
632
619
|
"ListBatchesRequest",
|
|
633
620
|
"Benchmark",
|
|
@@ -639,7 +626,6 @@ __all__ = [
|
|
|
639
626
|
"CallableT",
|
|
640
627
|
"ChatCompletionInputType",
|
|
641
628
|
"ChatCompletionResponseEventType",
|
|
642
|
-
"Checkpoint",
|
|
643
629
|
"Chunk",
|
|
644
630
|
"ChunkForDeletion",
|
|
645
631
|
"ChunkMetadata",
|
|
@@ -680,18 +666,15 @@ __all__ = [
|
|
|
680
666
|
"ListItemsRequest",
|
|
681
667
|
"RetrieveItemRequest",
|
|
682
668
|
"UpdateConversationRequest",
|
|
683
|
-
"DPOAlignmentConfig",
|
|
684
|
-
"DPOLossType",
|
|
685
|
-
"DataConfig",
|
|
686
669
|
"DataSource",
|
|
687
670
|
"Dataset",
|
|
688
|
-
"DatasetFormat",
|
|
689
671
|
"DatasetIO",
|
|
690
672
|
"DatasetInput",
|
|
691
673
|
"DatasetPurpose",
|
|
692
674
|
"DatasetNotFoundError",
|
|
693
675
|
"DatasetStore",
|
|
694
676
|
"DatasetType",
|
|
677
|
+
"AppendRowsParams",
|
|
695
678
|
"AppendRowsRequest",
|
|
696
679
|
"IterRowsRequest",
|
|
697
680
|
"Datasets",
|
|
@@ -700,7 +683,6 @@ __all__ = [
|
|
|
700
683
|
"DeleteFileRequest",
|
|
701
684
|
"Docstring",
|
|
702
685
|
"DynamicApiMeta",
|
|
703
|
-
"EfficiencyConfig",
|
|
704
686
|
"EmbeddingTaskType",
|
|
705
687
|
"EmbeddingsResponse",
|
|
706
688
|
"Error",
|
|
@@ -790,7 +772,6 @@ __all__ = [
|
|
|
790
772
|
"ListOpenAIFileResponse",
|
|
791
773
|
"ListOpenAIResponseInputItem",
|
|
792
774
|
"ListOpenAIResponseObject",
|
|
793
|
-
"ListPostTrainingJobsResponse",
|
|
794
775
|
"ListPromptsResponse",
|
|
795
776
|
"ListProvidersResponse",
|
|
796
777
|
"ListRoutesRequest",
|
|
@@ -799,9 +780,9 @@ __all__ = [
|
|
|
799
780
|
"ListShieldsResponse",
|
|
800
781
|
"ListToolDefsResponse",
|
|
801
782
|
"ListToolGroupsResponse",
|
|
783
|
+
"ListToolsRequest",
|
|
802
784
|
"ListToolsResponse",
|
|
803
785
|
"LogProbConfig",
|
|
804
|
-
"LoraFinetuningConfig",
|
|
805
786
|
"MAX_PAGINATION_LIMIT",
|
|
806
787
|
"MCPListToolsTool",
|
|
807
788
|
"Metadata",
|
|
@@ -814,8 +795,6 @@ __all__ = [
|
|
|
814
795
|
"ModelTypeError",
|
|
815
796
|
"Models",
|
|
816
797
|
"GetModelRequest",
|
|
817
|
-
"GetTrainingJobArtifactsRequest",
|
|
818
|
-
"GetTrainingJobStatusRequest",
|
|
819
798
|
"RegisterModelRequest",
|
|
820
799
|
"UnregisterModelRequest",
|
|
821
800
|
"ModelsProtocolPrivate",
|
|
@@ -826,12 +805,16 @@ __all__ = [
|
|
|
826
805
|
"OpenAIAssistantMessageParam",
|
|
827
806
|
"OpenAIChatCompletion",
|
|
828
807
|
"OpenAIChatCompletionChunk",
|
|
808
|
+
"OpenAIChatCompletionChunkWithReasoning",
|
|
809
|
+
"OpenAIChatCompletionWithReasoning",
|
|
829
810
|
"OpenAIChatCompletionContentPartImageParam",
|
|
830
811
|
"OpenAIChatCompletionContentPartParam",
|
|
831
812
|
"OpenAIChatCompletionContentPartTextParam",
|
|
832
813
|
"OpenAIChatCompletionMessageContent",
|
|
833
814
|
"OpenAIChatCompletionRequestWithExtraBody",
|
|
834
815
|
"OpenAIChatCompletionTextOnlyMessageContent",
|
|
816
|
+
"OpenAIChatCompletionCustomToolCall",
|
|
817
|
+
"OpenAIChatCompletionCustomToolCallFunction",
|
|
835
818
|
"OpenAIChatCompletionToolCall",
|
|
836
819
|
"OpenAIChatCompletionToolCallFunction",
|
|
837
820
|
"OpenAIChatCompletionUsage",
|
|
@@ -962,6 +945,9 @@ __all__ = [
|
|
|
962
945
|
"OpenAIResponseOutputMessageFunctionToolCall",
|
|
963
946
|
"OpenAIResponseOutputMessageMCPCall",
|
|
964
947
|
"OpenAIResponseOutputMessageMCPListTools",
|
|
948
|
+
"OpenAIResponseOutputMessageReasoningContent",
|
|
949
|
+
"OpenAIResponseOutputMessageReasoningItem",
|
|
950
|
+
"OpenAIResponseOutputMessageReasoningSummary",
|
|
965
951
|
"OpenAIResponseOutputMessageWebSearchToolCall",
|
|
966
952
|
"OpenAIResponsePrompt",
|
|
967
953
|
"OpenAIResponseReasoning",
|
|
@@ -977,21 +963,11 @@ __all__ = [
|
|
|
977
963
|
"OpenAIToolMessageParam",
|
|
978
964
|
"OpenAITopLogProb",
|
|
979
965
|
"OpenAIUserMessageParam",
|
|
980
|
-
"OptimizerConfig",
|
|
981
|
-
"OptimizerType",
|
|
982
966
|
"PaginatedResponse",
|
|
983
967
|
"ParamType",
|
|
984
968
|
"parse_type",
|
|
985
|
-
"PostTraining",
|
|
986
969
|
"ProcessFileRequest",
|
|
987
970
|
"ProcessFileResponse",
|
|
988
|
-
"PostTrainingMetric",
|
|
989
|
-
"PostTrainingJob",
|
|
990
|
-
"PostTrainingJobArtifactsResponse",
|
|
991
|
-
"PostTrainingJobLogStream",
|
|
992
|
-
"PostTrainingJobStatusResponse",
|
|
993
|
-
"PostTrainingRLHFRequest",
|
|
994
|
-
"PreferenceOptimizeRequest",
|
|
995
971
|
"Prompt",
|
|
996
972
|
"Prompts",
|
|
997
973
|
"CreatePromptRequest",
|
|
@@ -1006,7 +982,6 @@ __all__ = [
|
|
|
1006
982
|
"ProviderSpec",
|
|
1007
983
|
"Providers",
|
|
1008
984
|
"python_type_to_name",
|
|
1009
|
-
"QATFinetuningConfig",
|
|
1010
985
|
"QuantizationConfig",
|
|
1011
986
|
"QuantizationType",
|
|
1012
987
|
"QueryChunksRequest",
|
|
@@ -1019,7 +994,6 @@ __all__ = [
|
|
|
1019
994
|
"RAGSearchMode",
|
|
1020
995
|
"register_dynamic_schema_type",
|
|
1021
996
|
"register_schema",
|
|
1022
|
-
"RLHFAlgorithm",
|
|
1023
997
|
"RRFRanker",
|
|
1024
998
|
"Ranker",
|
|
1025
999
|
"RegexParserScoringFnParams",
|
|
@@ -1039,6 +1013,7 @@ __all__ = [
|
|
|
1039
1013
|
"ResponseItemInclude",
|
|
1040
1014
|
"ResponseTruncation",
|
|
1041
1015
|
"ResponseNotFoundError",
|
|
1016
|
+
"ResponseStreamOptions",
|
|
1042
1017
|
"RetrieveFileContentRequest",
|
|
1043
1018
|
"RetrieveFileRequest",
|
|
1044
1019
|
"RouteInfo",
|
|
@@ -1085,7 +1060,6 @@ __all__ = [
|
|
|
1085
1060
|
"SpecialToolGroup",
|
|
1086
1061
|
"StrictJsonType",
|
|
1087
1062
|
"StringType",
|
|
1088
|
-
"SupervisedFineTuneRequest",
|
|
1089
1063
|
"SystemMessage",
|
|
1090
1064
|
"SystemMessageBehavior",
|
|
1091
1065
|
"TextContentItem",
|
|
@@ -1105,7 +1079,6 @@ __all__ = [
|
|
|
1105
1079
|
"ToolStore",
|
|
1106
1080
|
"TopKSamplingStrategy",
|
|
1107
1081
|
"TopPSamplingStrategy",
|
|
1108
|
-
"TrainingConfig",
|
|
1109
1082
|
"UnsupportedModelError",
|
|
1110
1083
|
"unwrap_generic_list",
|
|
1111
1084
|
"unwrap_optional_type",
|
|
@@ -1147,8 +1120,6 @@ __all__ = [
|
|
|
1147
1120
|
"VectorStoresProtocolPrivate",
|
|
1148
1121
|
"VersionInfo",
|
|
1149
1122
|
"ViolationLevel",
|
|
1150
|
-
"webmethod",
|
|
1151
|
-
"WebMethod",
|
|
1152
1123
|
"WebSearchToolTypes",
|
|
1153
1124
|
"WeightedRanker",
|
|
1154
1125
|
# Validators
|
|
@@ -54,6 +54,8 @@ class UnregisterBenchmarkRequest(BaseModel):
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
class CommonBenchmarkFields(BaseModel):
|
|
57
|
+
"""Common fields shared across benchmark creation and retrieval."""
|
|
58
|
+
|
|
57
59
|
dataset_id: str = Field(..., description="Identifier of the dataset to use for the benchmark evaluation.")
|
|
58
60
|
scoring_functions: list[str] = Field(
|
|
59
61
|
..., description="List of scoring function identifiers to apply during evaluation."
|
|
@@ -83,6 +85,8 @@ class Benchmark(CommonBenchmarkFields, Resource):
|
|
|
83
85
|
|
|
84
86
|
|
|
85
87
|
class BenchmarkInput(CommonBenchmarkFields, BaseModel):
|
|
88
|
+
"""Input model for registering a new benchmark."""
|
|
89
|
+
|
|
86
90
|
benchmark_id: str = Field(..., description="The ID of the benchmark.")
|
|
87
91
|
provider_id: str | None = Field(default=None, description="The ID of the provider to use for the benchmark.")
|
|
88
92
|
provider_benchmark_id: str | None = Field(
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# This source code is licensed under the terms described in the LICENSE file in
|
|
5
5
|
# the root directory of this source tree.
|
|
6
6
|
|
|
7
|
-
from typing import Annotated, Literal
|
|
7
|
+
from typing import Annotated, Any, Literal
|
|
8
8
|
|
|
9
9
|
from pydantic import BaseModel, Field, model_validator
|
|
10
10
|
|
|
@@ -35,7 +35,7 @@ class _URLOrData(BaseModel):
|
|
|
35
35
|
|
|
36
36
|
@model_validator(mode="before")
|
|
37
37
|
@classmethod
|
|
38
|
-
def validator(cls, values):
|
|
38
|
+
def validator(cls, values: Any) -> dict[str, Any]:
|
|
39
39
|
if isinstance(values, dict):
|
|
40
40
|
return values
|
|
41
41
|
return {"url": values}
|
|
@@ -16,7 +16,7 @@ from fastapi import APIRouter, Depends, Path, Query
|
|
|
16
16
|
|
|
17
17
|
from llama_stack_api.router_utils import create_path_dependency, standard_responses
|
|
18
18
|
from llama_stack_api.tools import ToolDef
|
|
19
|
-
from llama_stack_api.version import
|
|
19
|
+
from llama_stack_api.version import LLAMA_STACK_API_V1BETA
|
|
20
20
|
|
|
21
21
|
from .api import Connectors
|
|
22
22
|
from .models import (
|
|
@@ -43,7 +43,7 @@ def create_router(impl: Connectors) -> APIRouter:
|
|
|
43
43
|
APIRouter configured for the Connectors API
|
|
44
44
|
"""
|
|
45
45
|
router = APIRouter(
|
|
46
|
-
prefix=f"/{
|
|
46
|
+
prefix=f"/{LLAMA_STACK_API_V1BETA}",
|
|
47
47
|
tags=["Connectors"],
|
|
48
48
|
responses=standard_responses,
|
|
49
49
|
)
|
|
@@ -24,6 +24,7 @@ from llama_stack_api.openai_responses import (
|
|
|
24
24
|
OpenAIResponseOutputMessageFunctionToolCall,
|
|
25
25
|
OpenAIResponseOutputMessageMCPCall,
|
|
26
26
|
OpenAIResponseOutputMessageMCPListTools,
|
|
27
|
+
OpenAIResponseOutputMessageReasoningItem,
|
|
27
28
|
OpenAIResponseOutputMessageWebSearchToolCall,
|
|
28
29
|
)
|
|
29
30
|
from llama_stack_api.schema_utils import json_schema_type, register_schema
|
|
@@ -74,8 +75,7 @@ ConversationItem = Annotated[
|
|
|
74
75
|
| OpenAIResponseMCPApprovalResponse
|
|
75
76
|
| OpenAIResponseOutputMessageMCPCall
|
|
76
77
|
| OpenAIResponseOutputMessageMCPListTools
|
|
77
|
-
|
|
|
78
|
-
| OpenAIResponseOutputMessageMCPListTools,
|
|
78
|
+
| OpenAIResponseOutputMessageReasoningItem,
|
|
79
79
|
Field(discriminator="type"),
|
|
80
80
|
]
|
|
81
81
|
register_schema(ConversationItem, name="ConversationItem")
|
|
@@ -19,6 +19,7 @@ from .api import DatasetIO, DatasetStore
|
|
|
19
19
|
|
|
20
20
|
# Import models for re-export
|
|
21
21
|
from .models import (
|
|
22
|
+
AppendRowsParams,
|
|
22
23
|
AppendRowsRequest,
|
|
23
24
|
IterRowsRequest,
|
|
24
25
|
PaginatedResponse,
|
|
@@ -27,6 +28,7 @@ from .models import (
|
|
|
27
28
|
__all__ = [
|
|
28
29
|
"DatasetIO",
|
|
29
30
|
"DatasetStore",
|
|
31
|
+
"AppendRowsParams",
|
|
30
32
|
"AppendRowsRequest",
|
|
31
33
|
"IterRowsRequest",
|
|
32
34
|
"PaginatedResponse",
|
|
@@ -16,13 +16,15 @@ from typing import Protocol, runtime_checkable
|
|
|
16
16
|
from llama_stack_api.datasets import Dataset
|
|
17
17
|
|
|
18
18
|
from .models import (
|
|
19
|
-
|
|
19
|
+
AppendRowsParams,
|
|
20
20
|
IterRowsRequest,
|
|
21
21
|
PaginatedResponse,
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class DatasetStore(Protocol):
|
|
26
|
+
"""Protocol for storing and retrieving dataset definitions."""
|
|
27
|
+
|
|
26
28
|
def get_dataset(self, dataset_id: str) -> Dataset: ...
|
|
27
29
|
|
|
28
30
|
|
|
@@ -39,4 +41,4 @@ class DatasetIO(Protocol):
|
|
|
39
41
|
|
|
40
42
|
async def iterrows(self, request: IterRowsRequest) -> PaginatedResponse: ...
|
|
41
43
|
|
|
42
|
-
async def append_rows(self,
|
|
44
|
+
async def append_rows(self, params: AppendRowsParams) -> None: ...
|
|
@@ -20,6 +20,7 @@ from llama_stack_api.version import LLAMA_STACK_API_V1BETA
|
|
|
20
20
|
|
|
21
21
|
from .api import DatasetIO
|
|
22
22
|
from .models import (
|
|
23
|
+
AppendRowsParams,
|
|
23
24
|
AppendRowsRequest,
|
|
24
25
|
IterRowsRequest,
|
|
25
26
|
)
|
|
@@ -82,13 +83,13 @@ The response includes:
|
|
|
82
83
|
)
|
|
83
84
|
async def append_rows(
|
|
84
85
|
dataset_id: Annotated[str, Path(description="The ID of the dataset to append the rows to.")],
|
|
85
|
-
|
|
86
|
+
body: Annotated[AppendRowsRequest, Body(...)],
|
|
86
87
|
) -> None:
|
|
87
|
-
#
|
|
88
|
-
|
|
88
|
+
# Combine path parameter with request body
|
|
89
|
+
params = AppendRowsParams(
|
|
89
90
|
dataset_id=dataset_id,
|
|
90
|
-
rows=
|
|
91
|
+
rows=body.rows,
|
|
91
92
|
)
|
|
92
|
-
return await impl.append_rows(
|
|
93
|
+
return await impl.append_rows(params)
|
|
93
94
|
|
|
94
95
|
return router
|
|
@@ -35,7 +35,13 @@ class IterRowsRequest(BaseModel):
|
|
|
35
35
|
|
|
36
36
|
@json_schema_type
|
|
37
37
|
class AppendRowsRequest(BaseModel):
|
|
38
|
-
"""Request
|
|
38
|
+
"""Request body for appending rows to a dataset."""
|
|
39
|
+
|
|
40
|
+
rows: list[dict[str, Any]] = Field(..., description="The rows to append to the dataset.")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class AppendRowsParams(BaseModel):
|
|
44
|
+
"""Internal parameters for appending rows to a dataset (includes dataset_id)."""
|
|
39
45
|
|
|
40
46
|
dataset_id: str = Field(..., description="The ID of the dataset to append the rows to.")
|
|
41
47
|
rows: list[dict[str, Any]] = Field(..., description="The rows to append to the dataset.")
|
|
@@ -43,6 +49,7 @@ class AppendRowsRequest(BaseModel):
|
|
|
43
49
|
|
|
44
50
|
__all__ = [
|
|
45
51
|
"AppendRowsRequest",
|
|
52
|
+
"AppendRowsParams",
|
|
46
53
|
"IterRowsRequest",
|
|
47
54
|
"PaginatedResponse",
|
|
48
55
|
]
|
|
@@ -22,8 +22,6 @@ from llama_stack_api.schema_utils import json_schema_type, register_schema
|
|
|
22
22
|
class DatasetPurpose(StrEnum):
|
|
23
23
|
"""Purpose of the dataset. Each purpose has a required input data schema."""
|
|
24
24
|
|
|
25
|
-
post_training_messages = "post-training/messages"
|
|
26
|
-
"""The dataset contains messages used for post-training."""
|
|
27
25
|
eval_question_answer = "eval/question-answer"
|
|
28
26
|
"""The dataset contains a question column and an answer column."""
|
|
29
27
|
eval_messages_answer = "eval/messages-answer"
|