From dbd4b9eccec106364fdc72d75b54b60fcc408c89 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Fri, 22 Nov 2024 17:22:45 -0800 Subject: [PATCH] openapi in readthedocs --- docs/openapi_generator/generate.py | 7 ++- docs/openapi_generator/pyopenapi/generator.py | 8 +++ docs/resources/llama-stack-spec.html | 51 ++++++++++--------- docs/resources/llama-stack-spec.yaml | 40 +++++++-------- 4 files changed, 57 insertions(+), 49 deletions(-) diff --git a/docs/openapi_generator/generate.py b/docs/openapi_generator/generate.py index 3aa7ea6dc..cfa9259d1 100644 --- a/docs/openapi_generator/generate.py +++ b/docs/openapi_generator/generate.py @@ -52,12 +52,11 @@ def main(output_dir: str): Options( server=Server(url="http://any-hosted-llama-stack.com"), info=Info( - title="[DRAFT] Llama Stack Specification", + title="Llama Stack Specification", version=LLAMA_STACK_API_VERSION, - description="""This is the specification of the llama stack that provides + description="""This is the specification of the Llama Stack that provides a set of endpoints and their corresponding interfaces that are tailored to - best leverage Llama Models. The specification is still in draft and subject to change. - Generated at """ + best leverage Llama Models. Generated at """ + now, ), ), diff --git a/docs/openapi_generator/pyopenapi/generator.py b/docs/openapi_generator/pyopenapi/generator.py index 2e1fbb856..03b6c87b4 100644 --- a/docs/openapi_generator/pyopenapi/generator.py +++ b/docs/openapi_generator/pyopenapi/generator.py @@ -438,6 +438,14 @@ class Generator: return extra_tags def _build_operation(self, op: EndpointOperation) -> Operation: + if op.defining_class.__name__ in [ + "SyntheticDataGeneration", + "PostTraining", + "BatchInference", + ]: + op.defining_class.__name__ = f"(Coming Soon) {op.defining_class.__name__}" + print(op.defining_class.__name__) + doc_string = parse_type(op.func_ref) doc_params = dict( (param.name, param.description) for param in doc_string.params.values() diff --git a/docs/resources/llama-stack-spec.html b/docs/resources/llama-stack-spec.html index cf4bf5125..831fec434 100644 --- a/docs/resources/llama-stack-spec.html +++ b/docs/resources/llama-stack-spec.html @@ -19,9 +19,9 @@ spec = { "openapi": "3.1.0", "info": { - "title": "[DRAFT] Llama Stack Specification", + "title": "Llama Stack Specification", "version": "alpha", - "description": "This is the specification of the llama stack that provides\n a set of endpoints and their corresponding interfaces that are tailored to\n best leverage Llama Models. The specification is still in draft and subject to change.\n Generated at 2024-11-19 09:14:01.145131" + "description": "This is the specification of the Llama Stack that provides\n a set of endpoints and their corresponding interfaces that are tailored to\n best leverage Llama Models. Generated at 2024-11-22 17:22:31.150049" }, "servers": [ { @@ -44,7 +44,7 @@ } }, "tags": [ - "BatchInference" + "(Coming Soon) BatchInference" ], "parameters": [ { @@ -84,7 +84,7 @@ } }, "tags": [ - "BatchInference" + "(Coming Soon) BatchInference" ], "parameters": [ { @@ -117,7 +117,7 @@ } }, "tags": [ - "PostTraining" + "(Coming Soon) PostTraining" ], "parameters": [ { @@ -1079,7 +1079,7 @@ } }, "tags": [ - "PostTraining" + "(Coming Soon) PostTraining" ], "parameters": [ { @@ -1117,7 +1117,7 @@ } }, "tags": [ - "PostTraining" + "(Coming Soon) PostTraining" ], "parameters": [ { @@ -1155,7 +1155,7 @@ } }, "tags": [ - "PostTraining" + "(Coming Soon) PostTraining" ], "parameters": [ { @@ -1193,7 +1193,7 @@ } }, "tags": [ - "PostTraining" + "(Coming Soon) PostTraining" ], "parameters": [ { @@ -1713,7 +1713,7 @@ } }, "tags": [ - "PostTraining" + "(Coming Soon) PostTraining" ], "parameters": [ { @@ -2161,7 +2161,7 @@ } }, "tags": [ - "PostTraining" + "(Coming Soon) PostTraining" ], "parameters": [ { @@ -2201,7 +2201,7 @@ } }, "tags": [ - "SyntheticDataGeneration" + "(Coming Soon) SyntheticDataGeneration" ], "parameters": [ { @@ -3861,7 +3861,8 @@ "type": "string", "enum": [ "bing", - "brave" + "brave", + "tavily" ], "default": "brave" }, @@ -7926,6 +7927,15 @@ } ], "tags": [ + { + "name": "(Coming Soon) BatchInference" + }, + { + "name": "(Coming Soon) PostTraining" + }, + { + "name": "(Coming Soon) SyntheticDataGeneration" + }, { "name": "AgentCandidate", "description": "" @@ -8001,9 +8011,6 @@ "name": "BatchCompletionResponse", "description": "" }, - { - "name": "BatchInference" - }, { "name": "BenchmarkEvalTaskConfig", "description": "" @@ -8255,9 +8262,6 @@ "name": "PhotogenToolDefinition", "description": "" }, - { - "name": "PostTraining" - }, { "name": "PostTrainingJob", "description": "" @@ -8446,9 +8450,6 @@ "name": "SyntheticDataGenerateRequest", "description": "" }, - { - "name": "SyntheticDataGeneration" - }, { "name": "SyntheticDataGenerationResponse", "description": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold.\n\n" @@ -8557,8 +8558,10 @@ { "name": "Operations", "tags": [ + "(Coming Soon) BatchInference", + "(Coming Soon) PostTraining", + "(Coming Soon) SyntheticDataGeneration", "Agents", - "BatchInference", "DatasetIO", "Datasets", "Eval", @@ -8568,12 +8571,10 @@ "Memory", "MemoryBanks", "Models", - "PostTraining", "Safety", "Scoring", "ScoringFunctions", "Shields", - "SyntheticDataGeneration", "Telemetry" ] }, diff --git a/docs/resources/llama-stack-spec.yaml b/docs/resources/llama-stack-spec.yaml index e84f11bdd..e258ef615 100644 --- a/docs/resources/llama-stack-spec.yaml +++ b/docs/resources/llama-stack-spec.yaml @@ -2629,6 +2629,7 @@ components: enum: - bing - brave + - tavily type: string input_shields: items: @@ -3397,11 +3398,10 @@ components: - api_key type: object info: - description: "This is the specification of the llama stack that provides\n \ + description: "This is the specification of the Llama Stack that provides\n \ \ a set of endpoints and their corresponding interfaces that are tailored\ - \ to\n best leverage Llama Models. The specification is still in\ - \ draft and subject to change.\n Generated at 2024-11-19 09:14:01.145131" - title: '[DRAFT] Llama Stack Specification' + \ to\n best leverage Llama Models. Generated at 2024-11-22 17:22:31.150049" + title: Llama Stack Specification version: alpha jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema openapi: 3.1.0 @@ -3658,7 +3658,7 @@ paths: $ref: '#/components/schemas/BatchChatCompletionResponse' description: OK tags: - - BatchInference + - (Coming Soon) BatchInference /alpha/batch-inference/completion: post: parameters: @@ -3683,7 +3683,7 @@ paths: $ref: '#/components/schemas/BatchCompletionResponse' description: OK tags: - - BatchInference + - (Coming Soon) BatchInference /alpha/datasetio/get-rows-paginated: get: parameters: @@ -4337,7 +4337,7 @@ paths: $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' description: OK tags: - - PostTraining + - (Coming Soon) PostTraining /alpha/post-training/job/cancel: post: parameters: @@ -4358,7 +4358,7 @@ paths: '200': description: OK tags: - - PostTraining + - (Coming Soon) PostTraining /alpha/post-training/job/logs: get: parameters: @@ -4382,7 +4382,7 @@ paths: $ref: '#/components/schemas/PostTrainingJobLogStream' description: OK tags: - - PostTraining + - (Coming Soon) PostTraining /alpha/post-training/job/status: get: parameters: @@ -4406,7 +4406,7 @@ paths: $ref: '#/components/schemas/PostTrainingJobStatusResponse' description: OK tags: - - PostTraining + - (Coming Soon) PostTraining /alpha/post-training/jobs: get: parameters: @@ -4425,7 +4425,7 @@ paths: $ref: '#/components/schemas/PostTrainingJob' description: OK tags: - - PostTraining + - (Coming Soon) PostTraining /alpha/post-training/preference-optimize: post: parameters: @@ -4450,7 +4450,7 @@ paths: $ref: '#/components/schemas/PostTrainingJob' description: OK tags: - - PostTraining + - (Coming Soon) PostTraining /alpha/post-training/supervised-fine-tune: post: parameters: @@ -4475,7 +4475,7 @@ paths: $ref: '#/components/schemas/PostTrainingJob' description: OK tags: - - PostTraining + - (Coming Soon) PostTraining /alpha/providers/list: get: parameters: @@ -4755,7 +4755,7 @@ paths: $ref: '#/components/schemas/SyntheticDataGenerationResponse' description: OK tags: - - SyntheticDataGeneration + - (Coming Soon) SyntheticDataGeneration /alpha/telemetry/get-trace: get: parameters: @@ -4806,6 +4806,9 @@ security: servers: - url: http://any-hosted-llama-stack.com tags: +- name: (Coming Soon) BatchInference +- name: (Coming Soon) PostTraining +- name: (Coming Soon) SyntheticDataGeneration - description: name: AgentCandidate - description: @@ -4863,7 +4866,6 @@ tags: - description: name: BatchCompletionResponse -- name: BatchInference - description: name: BenchmarkEvalTaskConfig @@ -5044,7 +5046,6 @@ tags: - description: name: PhotogenToolDefinition -- name: PostTraining - description: name: PostTrainingJob @@ -5179,7 +5180,6 @@ tags: - description: name: SyntheticDataGenerateRequest -- name: SyntheticDataGeneration - description: 'Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold. @@ -5261,8 +5261,10 @@ tags: x-tagGroups: - name: Operations tags: + - (Coming Soon) BatchInference + - (Coming Soon) PostTraining + - (Coming Soon) SyntheticDataGeneration - Agents - - BatchInference - DatasetIO - Datasets - Eval @@ -5272,12 +5274,10 @@ x-tagGroups: - Memory - MemoryBanks - Models - - PostTraining - Safety - Scoring - ScoringFunctions - Shields - - SyntheticDataGeneration - Telemetry - name: Types tags: