From 8b80a77faed2b24549241061bef83bf23b26967c Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Wed, 12 Mar 2025 23:50:52 -0700 Subject: [PATCH] docs --- docs/_static/llama-stack-spec.html | 2 +- docs/_static/llama-stack-spec.yaml | 14 ++++++++++---- llama_stack/apis/datasets/datasets.py | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html index d6ee9334e..4c7bebd8f 100644 --- a/docs/_static/llama-stack-spec.html +++ b/docs/_static/llama-stack-spec.html @@ -9446,7 +9446,7 @@ "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 column and an answer column for evaluation. - \"eval/messages-answer\": The dataset contains a messages column with list of messages and an answer column for evaluation." + "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": { "$ref": "#/components/schemas/DataSource", diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml index 4a204f44d..4d2398a28 100644 --- a/docs/_static/llama-stack-spec.yaml +++ b/docs/_static/llama-stack-spec.yaml @@ -6399,10 +6399,16 @@ components: - 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 column and an - answer column for evaluation. - "eval/messages-answer": The dataset contains - a messages column with list of messages and an answer column for evaluation. + 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: $ref: '#/components/schemas/DataSource' description: >- diff --git a/llama_stack/apis/datasets/datasets.py b/llama_stack/apis/datasets/datasets.py index 711e3289c..e1285ef9a 100644 --- a/llama_stack/apis/datasets/datasets.py +++ b/llama_stack/apis/datasets/datasets.py @@ -160,8 +160,26 @@ class Datasets(Protocol): :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. + { + "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" + } :param source: The data source of the dataset. Examples: - { "type": "uri",