remove hack from openapi generator

This commit is contained in:
Xi Yan 2024-09-11 14:20:52 -07:00
parent 75ac0b2db1
commit 96f3058145
3 changed files with 25 additions and 30 deletions

View file

@ -21,7 +21,7 @@
"info": { "info": {
"title": "[DRAFT] Llama Stack Specification", "title": "[DRAFT] Llama Stack Specification",
"version": "0.0.1", "version": "0.0.1",
"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-09-11 14:17:44.361462" "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-09-11 14:20:37.290525"
}, },
"servers": [ "servers": [
{ {
@ -5677,6 +5677,12 @@
} }
], ],
"tags": [ "tags": [
{
"name": "RewardScoring"
},
{
"name": "Inference"
},
{ {
"name": "Telemetry" "name": "Telemetry"
}, },
@ -5684,31 +5690,25 @@
"name": "Evaluations" "name": "Evaluations"
}, },
{ {
"name": "PostTraining" "name": "Safety"
},
{
"name": "Datasets"
}, },
{ {
"name": "SyntheticDataGeneration" "name": "SyntheticDataGeneration"
}, },
{ {
"name": "BatchInference" "name": "Datasets"
}, },
{ {
"name": "Inference" "name": "PostTraining"
},
{
"name": "AgenticSystem"
},
{
"name": "Safety"
}, },
{ {
"name": "Memory" "name": "Memory"
}, },
{ {
"name": "RewardScoring" "name": "BatchInference"
},
{
"name": "AgenticSystem"
}, },
{ {
"name": "BuiltinTool", "name": "BuiltinTool",

View file

@ -2470,7 +2470,7 @@ 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\ \ a set of endpoints and their corresponding interfaces that are tailored\
\ to\n best leverage Llama Models. The specification is still in\ \ to\n best leverage Llama Models. The specification is still in\
\ draft and subject to change.\n Generated at 2024-09-11 14:17:44.361462" \ draft and subject to change.\n Generated at 2024-09-11 14:20:37.290525"
title: '[DRAFT] Llama Stack Specification' title: '[DRAFT] Llama Stack Specification'
version: 0.0.1 version: 0.0.1
jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
@ -3445,17 +3445,17 @@ security:
servers: servers:
- url: http://any-hosted-llama-stack.com - url: http://any-hosted-llama-stack.com
tags: tags:
- name: RewardScoring
- name: Inference
- name: Telemetry - name: Telemetry
- name: Evaluations - name: Evaluations
- name: PostTraining
- name: Datasets
- name: SyntheticDataGeneration
- name: BatchInference
- name: Inference
- name: AgenticSystem
- name: Safety - name: Safety
- name: SyntheticDataGeneration
- name: Datasets
- name: PostTraining
- name: Memory - name: Memory
- name: RewardScoring - name: BatchInference
- name: AgenticSystem
- description: <SchemaDefinition schemaRef="#/components/schemas/BuiltinTool" /> - description: <SchemaDefinition schemaRef="#/components/schemas/BuiltinTool" />
name: BuiltinTool name: BuiltinTool
- description: <SchemaDefinition schemaRef="#/components/schemas/CompletionMessage" - description: <SchemaDefinition schemaRef="#/components/schemas/CompletionMessage"

View file

@ -471,14 +471,9 @@ class Generator:
from dataclasses import make_dataclass from dataclasses import make_dataclass
if len(op.request_params) == 1 and "Request" in first[1].__name__: op_name = "".join(word.capitalize() for word in op.name.split("_"))
# TODO(ashwin): Undo the "Request" hack and this entire block eventually request_name = f"{op_name}Request"
request_name = first[1].__name__ + "Wrapper" request_type = make_dataclass(request_name, op.request_params)
request_type = make_dataclass(request_name, op.request_params)
else:
op_name = "".join(word.capitalize() for word in op.name.split("_"))
request_name = f"{op_name}Request"
request_type = make_dataclass(request_name, op.request_params)
requestBody = RequestBody( requestBody = RequestBody(
content={ content={