mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-12 04:00:42 +00:00
72 lines
15 KiB
Text
72 lines
15 KiB
Text
---
|
|
id: register-a-new-dataset
|
|
title: "Register a new dataset."
|
|
description: "Register a new dataset."
|
|
sidebar_label: "Register a new dataset."
|
|
hide_title: true
|
|
hide_table_of_contents: true
|
|
api: eJztWt2O27gVfpVT3qQNNPZskO12XRTBbGYWO4ukGUwmKIqxMTiWjiVuKFIhKTuC4Wfofa/6GH2evkBfoTik5JF/ZjJJFt0EsG9kUYfk+efhRy6FJVcZ7ciJ0VI8OT7mR0YutbLy0mgxEidwih4d+YFIRGq0J+2ZCqtKyRSZaviLY9KlcGlBJfI/31QkRsJMf6HUi0RU1lRkvYwTyYy0lzNJtkfrvJU6F6tAPJcZ2RtLztQ2pRuZ3U94x/fYsP0hEaTrUoyuRWkyUiIRrpCkMpGIOaXe2BvnjSWRiCxKzhSp4b43s1qnQTGJmJJOixLtW5EIb4xqHze5NXUVRS4rLyZBa86LUW+4jGZYq+22vtqvmorAzKBTQQKoFtg4eNT2eAQzY6F9cUEbta2Mu1fgyjh/5C1KLXU+LMk5zMkxwRzV8F1Njqc/Qu0WZLvmjqxrnmzzehEnZnZ9QR1PIHUWHETnIL0Dya6TUQa1I2Y3ysXcGk2vZmJ0/SG3ucucnX5rKzd0y++rJDz29NrSd4/xFDVMCczUo9SUwcyaEhDeXJ4P4GyQD+AIxqLwvnKj4bBsFjR10tMgNeWwbHiQAQeEGotAqNws0u184YZR6uZ/nqKjPz5NlvF500bZaizEapUIzDLJXKK66KljhspRIiy9q6WljK0bJIzyThLhpVcs8JvLc47g11Hd23KfrKX2Bd4rulgln2sgaxZuw0KhYZXE521HtBYbkQjpqXT70sl+lezxJF0r1Wd8aowi1P0mXZdTsv2WdQLZYmhXAasJG+huT5IOQi7JQGpgIdcOdA3LsegiayxGcL0cC2sU8f+xqB3ZsUhg3KXc2PwTKWUSWBirst+NxSqBjV7onHQemfqDXScrmHySewVb9fzr0iz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MouQQM+hIFVBY2rwJsPm2e64d/DGlnjkOt5iv8m2+rsJ2QKbp3j7Qc0OnNuOtjPtaksRSvZbtDGNsHJSU1boJa88wVT+nvg9i5nUcQSzcTiztPJaGcUNf0YPheRXDxhoP2T/kJ4fhvQfNExR57nU+QxTGg2HSmGJzmP6dugka+MdPnOVkv4vIePsHZOx1Tho/Bdc+cvIShNYieRwPPy1HPocTnsOpz2H4+FDpjgcDx8Sxm91PNw/mmxH+HpPftn0dx35stGD7Zfjfq9onJdNRzYWqxBw7evem5L7pj0/3Smwz2eMyEF7YJwlvEc6P4WFVIpDPSdNDJUHuO4j3GDnrLnvCy1Q0UIZ3WlYsPTtGN7WFHRXWUqZg9gUzF6YTIzCfj6gG74QIzGcfzNcX5xMRATnXTB1bRll4ZQ8Gg5RN0eFcZ6yo1BYH4XKmtNzWJwcpbWVvgkdT7scdD3hb5ydL2+xk7NblGeNfdwNcdzuqVo7xfUoLD+92609p94ycI+IYbMwUqvRFywIvGZB4HULnkVQ7QhO1wpk4MqF+7DWRZ+Yf7PHTRh9dBs4HPaRwf5cYVFoXceNNWz9EDiizQxIZ5WR2sdduC9I8g7cRmgtC3dJGWbm/Y6Lg6KlMW/wVcgG3uwOPuWjUkVzsph3XL3kq79uMNZj/fjxf/75r//++x9wenZxefb85Ors9PHjEbygHNMmaCJOVGLDfm6pNPOYd2a1501sqyU3gDcu3nUoZd5eQ7E0oxaW1KoJoch2LzEAZjqWMXfjcRsa7+Fv93RpfcbTez+sFEodS5cAAccAuG6t2cMH2c35wzKUDm+sWq24+V1NtolIYACZp+xD15yoCsKMr29fL8VbasRIPI+sHV3FrM5ISch22zAhJ77Y4yRNqfL30k56MXzx6vUVX7tuoUi+u80rPi54DcGFGAneKwZVhfwd2pZCoc5rzJk2jsm//wHdUjU1
|
|
sidebar_class_name: "post api-method"
|
|
info_path: docs/api-deprecated/llama-stack-specification-deprecated-apis
|
|
custom_edit_url: null
|
|
---
|
|
|
|
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
|
|
import ParamsDetails from "@theme/ParamsDetails";
|
|
import RequestSchema from "@theme/RequestSchema";
|
|
import StatusCodes from "@theme/StatusCodes";
|
|
import OperationTabs from "@theme/OperationTabs";
|
|
import TabItem from "@theme/TabItem";
|
|
import Heading from "@theme/Heading";
|
|
|
|
<Heading
|
|
as={"h1"}
|
|
className={"openapi__heading"}
|
|
children={"Register a new dataset."}
|
|
>
|
|
</Heading>
|
|
|
|
<MethodEndpoint
|
|
method={"post"}
|
|
path={"/v1/datasets"}
|
|
context={"endpoint"}
|
|
>
|
|
|
|
</MethodEndpoint>
|
|
|
|
:::caution deprecated
|
|
|
|
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
|
|
|
:::
|
|
|
|
Register a new dataset.
|
|
|
|
<Heading
|
|
id={"request"}
|
|
as={"h2"}
|
|
className={"openapi-tabs__heading"}
|
|
children={"Request"}
|
|
>
|
|
</Heading>
|
|
|
|
<ParamsDetails
|
|
parameters={[]}
|
|
>
|
|
|
|
</ParamsDetails>
|
|
|
|
<RequestSchema
|
|
title={"Body"}
|
|
body={{"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","enum":["post-training/messages","eval/question-answer","eval/messages-answer"],"description":"The purpose of the dataset. One of: - \"post-training/messages\": The dataset contains a messages column with list of messages for post-training. { \"messages\": [ {\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}, ] } - \"eval/question-answer\": The dataset contains a question column and an answer column for evaluation. { \"question\": \"What is the capital of France?\", \"answer\": \"Paris\" } - \"eval/messages-answer\": The dataset contains a messages column with list of messages and an answer column for evaluation. { \"messages\": [ {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"}, {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"}, {\"role\": \"user\", \"content\": \"What's my name?\"}, ], \"answer\": \"John Doe\" }"},"source":{"description":"The data source of the dataset. Ensure that the data source schema is compatible with the purpose of the dataset. Examples: - { \"type\": \"uri\", \"uri\": \"https://mywebsite.com/mydata.jsonl\" } - { \"type\": \"uri\", \"uri\": \"lsfs://mydata.jsonl\" } - { \"type\": \"uri\", \"uri\": \"data:csv;base64,{base64_content}\" } - { \"type\": \"uri\", \"uri\": \"huggingface://llamastack/simpleqa?split=train\" } - { \"type\": \"rows\", \"rows\": [ { \"messages\": [ {\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}, ] } ] }","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"uri","default":"uri"},"uri":{"type":"string","description":"The dataset can be obtained from a URI. E.g. - \"https://mywebsite.com/mydata.jsonl\" - \"lsfs://mydata.jsonl\" - \"data:csv;base64,{base64_content}\""}},"additionalProperties":false,"required":["type","uri"],"title":"URIDataSource","description":"A dataset that can be obtained from a URI."},{"type":"object","properties":{"type":{"type":"string","const":"rows","default":"rows"},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"oneOf":[{"type":"null"},{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array"},{"type":"object"}]}},"description":"The dataset is stored in rows. E.g. - [ {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]} ]"}},"additionalProperties":false,"required":["type","rows"],"title":"RowsDataSource","description":"A dataset stored in rows."}],"discriminator":{"propertyName":"type","mapping":{"uri":{"type":"object","properties":{"type":{"type":"string","const":"uri","default":"uri"},"uri":{"type":"string","description":"The dataset can be obtained from a URI. E.g. - \"https://mywebsite.com/mydata.jsonl\" - \"lsfs://mydata.jsonl\" - \"data:csv;base64,{base64_content}\""}},"additionalProperties":false,"required":["type","uri"],"title":"URIDataSource","description":"A dataset that can be obtained from a URI."},"rows":{"type":"object","properties":{"type":{"type":"string","const":"rows","default":"rows"},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"oneOf":[{"type":"null"},{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array"},{"type":"object"}]}},"description":"The dataset is stored in rows. E.g. - [ {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]} ]"}},"additionalProperties":false,"required":["type","rows"],"title":"RowsDataSource","description":"A dataset stored in rows."}}},"title":"DataSource"},"metadata":{"type":"object","additionalProperties":{"oneOf":[{"type":"null"},{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array"},{"type":"object"}]},"description":"The metadata for the dataset. - E.g. {\"description\": \"My dataset\"}."},"dataset_id":{"type":"string","description":"The ID of the dataset. If not provided, an ID will be generated."}},"additionalProperties":false,"required":["purpose","source"],"title":"RegisterDatasetRequest"}}},"required":true}}
|
|
>
|
|
|
|
</RequestSchema>
|
|
|
|
<StatusCodes
|
|
id={undefined}
|
|
label={undefined}
|
|
responses={{"200":{"description":"A Dataset.","content":{"application/json":{"schema":{"type":"object","properties":{"identifier":{"type":"string"},"provider_resource_id":{"type":"string"},"provider_id":{"type":"string"},"type":{"type":"string","enum":["model","shield","vector_store","dataset","scoring_function","benchmark","tool","tool_group","prompt"],"const":"dataset","default":"dataset","description":"Type of resource, always 'dataset' for datasets"},"purpose":{"type":"string","enum":["post-training/messages","eval/question-answer","eval/messages-answer"],"description":"Purpose of the dataset indicating its intended use"},"source":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"uri","default":"uri"},"uri":{"type":"string","description":"The dataset can be obtained from a URI. E.g. - \"https://mywebsite.com/mydata.jsonl\" - \"lsfs://mydata.jsonl\" - \"data:csv;base64,{base64_content}\""}},"additionalProperties":false,"required":["type","uri"],"title":"URIDataSource","description":"A dataset that can be obtained from a URI."},{"type":"object","properties":{"type":{"type":"string","const":"rows","default":"rows"},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"oneOf":[{"type":"null"},{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array"},{"type":"object"}]}},"description":"The dataset is stored in rows. E.g. - [ {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]} ]"}},"additionalProperties":false,"required":["type","rows"],"title":"RowsDataSource","description":"A dataset stored in rows."}],"discriminator":{"propertyName":"type","mapping":{"uri":{"type":"object","properties":{"type":{"type":"string","const":"uri","default":"uri"},"uri":{"type":"string","description":"The dataset can be obtained from a URI. E.g. - \"https://mywebsite.com/mydata.jsonl\" - \"lsfs://mydata.jsonl\" - \"data:csv;base64,{base64_content}\""}},"additionalProperties":false,"required":["type","uri"],"title":"URIDataSource","description":"A dataset that can be obtained from a URI."},"rows":{"type":"object","properties":{"type":{"type":"string","const":"rows","default":"rows"},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"oneOf":[{"type":"null"},{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array"},{"type":"object"}]}},"description":"The dataset is stored in rows. E.g. - [ {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]} ]"}},"additionalProperties":false,"required":["type","rows"],"title":"RowsDataSource","description":"A dataset stored in rows."}}},"description":"Data source configuration for the dataset"},"metadata":{"type":"object","additionalProperties":{"oneOf":[{"type":"null"},{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array"},{"type":"object"}]},"description":"Additional metadata for the dataset"}},"additionalProperties":false,"required":["identifier","provider_id","type","purpose","source","metadata"],"title":"Dataset","description":"Dataset resource for storing and accessing training or evaluation data."}}}},"400":{"description":"The request was invalid or malformed","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code"},"title":{"type":"string","description":"Error title, a short summary of the error which is invariant for an error type"},"detail":{"type":"string","description":"Error detail, a longer human-readable description of the error"},"instance":{"type":"string","description":"(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error"}},"additionalProperties":false,"required":["status","title","detail"],"title":"Error","description":"Error response from the API. Roughly follows RFC 7807."},"example":{"status":400,"title":"Bad Request","detail":"The request was invalid or malformed"}}}},"429":{"description":"The client has sent too many requests in a given amount of time","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code"},"title":{"type":"string","description":"Error title, a short summary of the error which is invariant for an error type"},"detail":{"type":"string","description":"Error detail, a longer human-readable description of the error"},"instance":{"type":"string","description":"(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error"}},"additionalProperties":false,"required":["status","title","detail"],"title":"Error","description":"Error response from the API. Roughly follows RFC 7807."},"example":{"status":429,"title":"Too Many Requests","detail":"You have exceeded the rate limit. Please try again later."}}}},"500":{"description":"The server encountered an unexpected error","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code"},"title":{"type":"string","description":"Error title, a short summary of the error which is invariant for an error type"},"detail":{"type":"string","description":"Error detail, a longer human-readable description of the error"},"instance":{"type":"string","description":"(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error"}},"additionalProperties":false,"required":["status","title","detail"],"title":"Error","description":"Error response from the API. Roughly follows RFC 7807."},"example":{"status":500,"title":"Internal Server Error","detail":"An unexpected error occurred. Our team has been notified."}}}},"default":{"description":"An unexpected error occurred","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code"},"title":{"type":"string","description":"Error title, a short summary of the error which is invariant for an error type"},"detail":{"type":"string","description":"Error detail, a longer human-readable description of the error"},"instance":{"type":"string","description":"(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error"}},"additionalProperties":false,"required":["status","title","detail"],"title":"Error","description":"Error response from the API. Roughly follows RFC 7807."},"example":{"status":0,"title":"Error","detail":"An unexpected error occurred"}}}}}}
|
|
>
|
|
|
|
</StatusCodes>
|