update doc

This commit is contained in:
Xi Yan 2025-03-12 23:30:47 -07:00
parent 772339bebf
commit b4d118fc5c
3 changed files with 32 additions and 14 deletions

View file

@ -6850,10 +6850,10 @@
"type": "string", "type": "string",
"enum": [ "enum": [
"post-training/messages", "post-training/messages",
"eval/question-answer" "eval/messages-answer"
], ],
"title": "DatasetPurpose", "title": "DatasetPurpose",
"description": "Purpose of the dataset. Each type has a different column format." "description": "Purpose of the dataset. Each purpose has a required input data schema."
}, },
"source": { "source": {
"$ref": "#/components/schemas/DataSource" "$ref": "#/components/schemas/DataSource"
@ -9442,9 +9442,9 @@
"type": "string", "type": "string",
"enum": [ "enum": [
"post-training/messages", "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. - \"eval/question-answer\": The dataset contains a question and answer column." "description": "The purpose of the dataset. One of - \"post-training/messages\": The dataset contains a messages column with list of messages for post-training. - Example data rows: { \"messages\": [ {\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}, ] } - \"eval/messages-answer\": The dataset contains a messages column with list of messages and an answer column. - Example data rows: { \"messages\": [ {\"role\": \"user\", \"content\": \"What is the capital of France?\"}, ], \"answer\": \"Paris\" }"
}, },
"source": { "source": {
"$ref": "#/components/schemas/DataSource", "$ref": "#/components/schemas/DataSource",

View file

@ -4742,10 +4742,10 @@ components:
type: string type: string
enum: enum:
- post-training/messages - post-training/messages
- eval/question-answer - eval/messages-answer
title: DatasetPurpose title: DatasetPurpose
description: >- description: >-
Purpose of the dataset. Each type has a different column format. Purpose of the dataset. Each purpose has a required input data schema.
source: source:
$ref: '#/components/schemas/DataSource' $ref: '#/components/schemas/DataSource'
metadata: metadata:
@ -6394,11 +6394,15 @@ components:
type: string type: string
enum: enum:
- post-training/messages - post-training/messages
- eval/question-answer - eval/messages-answer
description: >- description: >-
The purpose of the dataset. One of - "post-training/messages": The dataset The purpose of the dataset. One of - "post-training/messages": The dataset
contains a messages column with list of messages for post-training. - contains a messages column with list of messages for post-training. -
"eval/question-answer": The dataset contains a question and answer column. Example data rows: { "messages": [ {"role": "user", "content": "Hello,
world!"}, {"role": "assistant", "content": "Hello, world!"}, ] } - "eval/messages-answer":
The dataset contains a messages column with list of messages and an answer
column. - Example data rows: { "messages": [ {"role": "user", "content":
"What is the capital of France?"}, ], "answer": "Paris" }
source: source:
$ref: '#/components/schemas/DataSource' $ref: '#/components/schemas/DataSource'
description: >- description: >-

View file

@ -16,17 +16,17 @@ from llama_stack.schema_utils import json_schema_type, register_schema, webmetho
class DatasetPurpose(Enum): class DatasetPurpose(Enum):
""" """
Purpose of the dataset. Each purpose has a required input data schema. Purpose of the dataset. Each purpose has a required input data schema.
:cvar post-training/messages: The dataset contains messages used for post-training. Examples: :cvar post-training/messages: The dataset contains messages used for post-training.
{ {
"messages": [ "messages": [
{"role": "user", "content": "Hello, world!"}, {"role": "user", "content": "Hello, world!"},
{"role": "assistant", "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"},
] ]
} }
:cvar eval/question-answer: The dataset contains a question and answer column. :cvar eval/messages-answer: The dataset contains a messages column with list of messages and an answer column.
{ {
"question": [ "messages": [
{"role": "user", "content": "What is the capital of France?"}, {"role": "user", "content": "What is the capital of France?"},
], ],
"answer": "Paris" "answer": "Paris"
@ -34,7 +34,7 @@ class DatasetPurpose(Enum):
""" """
post_training_messages = "post-training/messages" post_training_messages = "post-training/messages"
eval_question_answer = "eval/question-answer" eval_messages_answer = "eval/messages-answer"
# TODO: add more schemas here # TODO: add more schemas here
@ -153,7 +153,21 @@ class Datasets(Protocol):
:param purpose: The purpose of the dataset. One of :param purpose: The purpose of the dataset. One of
- "post-training/messages": The dataset contains a messages column with list of messages for post-training. - "post-training/messages": The dataset contains a messages column with list of messages for post-training.
- "eval/question-answer": The dataset contains a question and answer column. - Example data rows:
{
"messages": [
{"role": "user", "content": "Hello, world!"},
{"role": "assistant", "content": "Hello, world!"},
]
}
- "eval/messages-answer": The dataset contains a messages column with list of messages and an answer column.
- Example data rows:
{
"messages": [
{"role": "user", "content": "What is the capital of France?"},
],
"answer": "Paris"
}
:param source: The data source of the dataset. Examples: :param source: The data source of the dataset. Examples:
- { - {
"type": "uri", "type": "uri",