diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html
index 7c28fd8e5..d2a745655 100644
--- a/docs/_static/llama-stack-spec.html
+++ b/docs/_static/llama-stack-spec.html
@@ -7496,44 +7496,55 @@
"type": {
"type": "string",
"const": "huggingface",
- "default": "huggingface"
+ "default": "huggingface",
+ "description": "The type of the data source."
},
- "path": {
- "type": "string",
- "description": "The path to the dataset in Huggingface. E.g. - \"llamastack/simpleqa\""
- },
- "params": {
+ "huggingface": {
"type": "object",
- "additionalProperties": {
- "oneOf": [
- {
- "type": "null"
+ "properties": {
+ "path": {
+ "type": "string",
+ "description": "The path to the dataset in Huggingface. E.g. - \"llamastack/simpleqa\""
+ },
+ "params": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "array"
+ },
+ {
+ "type": "object"
+ }
+ ]
},
- {
- "type": "boolean"
- },
- {
- "type": "number"
- },
- {
- "type": "string"
- },
- {
- "type": "array"
- },
- {
- "type": "object"
- }
- ]
+ "description": "The parameters for the dataset."
+ }
},
- "description": "The parameters for the dataset."
+ "additionalProperties": false,
+ "required": [
+ "path",
+ "params"
+ ],
+ "description": "The fields for a Huggingface dataset."
}
},
"additionalProperties": false,
"required": [
"type",
- "path",
- "params"
+ "huggingface"
],
"title": "HuggingfaceDataSource",
"description": "A dataset stored in Huggingface."
diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml
index a21860766..5b99ba5aa 100644
--- a/docs/_static/llama-stack-spec.yaml
+++ b/docs/_static/llama-stack-spec.yaml
@@ -5246,26 +5246,34 @@ components:
type: string
const: huggingface
default: huggingface
- path:
- type: string
- description: >-
- The path to the dataset in Huggingface. E.g. - "llamastack/simpleqa"
- params:
+ description: The type of the data source.
+ huggingface:
type: object
- additionalProperties:
- oneOf:
- - type: 'null'
- - type: boolean
- - type: number
- - type: string
- - type: array
- - type: object
- description: The parameters for the dataset.
+ properties:
+ path:
+ type: string
+ description: >-
+ The path to the dataset in Huggingface. E.g. - "llamastack/simpleqa"
+ params:
+ type: object
+ additionalProperties:
+ oneOf:
+ - type: 'null'
+ - type: boolean
+ - type: number
+ - type: string
+ - type: array
+ - type: object
+ description: The parameters for the dataset.
+ additionalProperties: false
+ required:
+ - path
+ - params
+ description: The fields for a Huggingface dataset.
additionalProperties: false
required:
- type
- - path
- - params
+ - huggingface
title: HuggingfaceDataSource
description: A dataset stored in Huggingface.
RowsDataSource:
diff --git a/llama_stack/apis/datasets/datasets.py b/llama_stack/apis/datasets/datasets.py
index 36f75d7b3..20587a29e 100644
--- a/llama_stack/apis/datasets/datasets.py
+++ b/llama_stack/apis/datasets/datasets.py
@@ -55,18 +55,26 @@ class URIDataSource(BaseModel):
uri: str
-@json_schema_type
-class HuggingfaceDataSource(BaseModel):
- """A dataset stored in Huggingface.
+class HuggingfaceDataSourceFields(BaseModel):
+ """The fields for a Huggingface dataset.
:param path: The path to the dataset in Huggingface. E.g.
- "llamastack/simpleqa"
:param params: The parameters for the dataset.
"""
- type: Literal["huggingface"] = "huggingface"
path: str
params: Dict[str, Any]
+@json_schema_type
+class HuggingfaceDataSource(BaseModel):
+ """A dataset stored in Huggingface.
+ :param type: The type of the data source.
+ :param huggingface: The fields for a Huggingface dataset.
+ """
+ type: Literal["huggingface"] = "huggingface"
+ huggingface: HuggingfaceDataSourceFields
+
+
@json_schema_type
class RowsDataSource(BaseModel):
"""A dataset stored in rows.