diff --git a/rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.html b/rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.html index a3f11370d..a05dc34fa 100644 --- a/rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.html +++ b/rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.html @@ -21,7 +21,7 @@ "info": { "title": "[DRAFT] Llama Stack Specification", "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-09 11:14:56.584501" + "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-09 11:19:39.855375" }, "servers": [ { @@ -277,7 +277,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAgenticSystemTurnRequestWrapper" + "$ref": "#/components/schemas/AgenticSystemTurnCreateRequestWrapper" } } }, @@ -1024,7 +1024,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetLogsRequestWrapper" + "$ref": "#/components/schemas/LogSearchRequestWrapper" } } }, @@ -1365,7 +1365,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PreferenceOptimizeRequestWrapper" + "$ref": "#/components/schemas/PostTrainingRLHFRequestWrapper" } } }, @@ -1425,7 +1425,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RewardScoreRequestWrapper" + "$ref": "#/components/schemas/RewardScoringRequestWrapper" } } }, @@ -1455,7 +1455,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SupervisedFineTuneRequestWrapper" + "$ref": "#/components/schemas/PostTrainingSFTRequestWrapper" } } }, @@ -1485,7 +1485,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SyntheticDataGenerateRequestWrapper" + "$ref": "#/components/schemas/SyntheticDataGenerationRequestWrapper" } } }, @@ -3229,7 +3229,7 @@ "mime_type" ] }, - "CreateAgenticSystemTurnRequestWrapper": { + "AgenticSystemTurnCreateRequestWrapper": { "type": "object", "properties": { "request": { @@ -4775,7 +4775,7 @@ "query" ] }, - "GetLogsRequestWrapper": { + "LogSearchRequestWrapper": { "type": "object", "properties": { "request": { @@ -5277,7 +5277,7 @@ "fsdp_cpu_offload" ] }, - "PreferenceOptimizeRequestWrapper": { + "PostTrainingRLHFRequestWrapper": { "type": "object", "properties": { "request": { @@ -5457,7 +5457,7 @@ ], "title": "Request to score a reward function. A list of prompts and a list of responses per prompt." }, - "RewardScoreRequestWrapper": { + "RewardScoringRequestWrapper": { "type": "object", "properties": { "request": { @@ -5754,7 +5754,7 @@ "alpha" ] }, - "SupervisedFineTuneRequestWrapper": { + "PostTrainingSFTRequestWrapper": { "type": "object", "properties": { "request": { @@ -5811,7 +5811,7 @@ ], "title": "Request to generate synthetic data. A small batch of prompts and a filtering function" }, - "SyntheticDataGenerateRequestWrapper": { + "SyntheticDataGenerationRequestWrapper": { "type": "object", "properties": { "request": { @@ -6063,34 +6063,34 @@ ], "tags": [ { - "name": "Memory" + "name": "Inference" }, { - "name": "Telemetry" - }, - { - "name": "PostTraining" - }, - { - "name": "BatchInference" - }, - { - "name": "AgenticSystem" - }, - { - "name": "RewardScoring" - }, - { - "name": "SyntheticDataGeneration" + "name": "Datasets" }, { "name": "Evaluations" }, { - "name": "Inference" + "name": "Memory" }, { - "name": "Datasets" + "name": "SyntheticDataGeneration" + }, + { + "name": "PostTraining" + }, + { + "name": "RewardScoring" + }, + { + "name": "BatchInference" + }, + { + "name": "Telemetry" + }, + { + "name": "AgenticSystem" }, { "name": "BatchChatCompletionRequest", @@ -6293,8 +6293,8 @@ "description": "" }, { - "name": "CreateAgenticSystemTurnRequestWrapper", - "description": "" + "name": "AgenticSystemTurnCreateRequestWrapper", + "description": "" }, { "name": "AgenticSystemTurnResponseEvent", @@ -6509,8 +6509,8 @@ "description": "" }, { - "name": "GetLogsRequestWrapper", - "description": "" + "name": "LogSearchRequestWrapper", + "description": "" }, { "name": "Log", @@ -6585,8 +6585,8 @@ "description": "" }, { - "name": "PreferenceOptimizeRequestWrapper", - "description": "" + "name": "PostTrainingRLHFRequestWrapper", + "description": "" }, { "name": "QueryDocumentsRequest", @@ -6605,8 +6605,8 @@ "description": "Request to score a reward function. A list of prompts and a list of responses per prompt.\n\n" }, { - "name": "RewardScoreRequestWrapper", - "description": "" + "name": "RewardScoringRequestWrapper", + "description": "" }, { "name": "RewardScoringResponse", @@ -6641,16 +6641,16 @@ "description": "" }, { - "name": "SupervisedFineTuneRequestWrapper", - "description": "" + "name": "PostTrainingSFTRequestWrapper", + "description": "" }, { "name": "SyntheticDataGenerationRequest", "description": "Request to generate synthetic data. A small batch of prompts and a filtering function\n\n" }, { - "name": "SyntheticDataGenerateRequestWrapper", - "description": "" + "name": "SyntheticDataGenerationRequestWrapper", + "description": "" }, { "name": "SyntheticDataGenerationResponse", @@ -6709,6 +6709,7 @@ "AgenticSystemSessionCreateResponse", "AgenticSystemStepResponse", "AgenticSystemTurnCreateRequest", + "AgenticSystemTurnCreateRequestWrapper", "AgenticSystemTurnResponseEvent", "AgenticSystemTurnResponseStepCompletePayload", "AgenticSystemTurnResponseStepProgressPayload", @@ -6743,7 +6744,6 @@ "CompletionResponseStreamChunk", "CreateAgenticSystemRequest", "CreateAgenticSystemSessionRequest", - "CreateAgenticSystemTurnRequestWrapper", "CreateDatasetRequest", "CreateDatasetRequestWrapper", "CreateExperimentRequest", @@ -6777,7 +6777,6 @@ "FunctionCallToolDefinition", "GetAgenticSystemSessionRequest", "GetDocumentsRequest", - "GetLogsRequestWrapper", "InferenceStep", "InsertDocumentsRequest", "ListArtifactsRequest", @@ -6787,6 +6786,7 @@ "LogMetricsRequest", "LogMetricsRequestWrapper", "LogSearchRequest", + "LogSearchRequestWrapper", "LoraFinetuningConfig", "MemoryBank", "MemoryBankDocument", @@ -6801,16 +6801,17 @@ "PostTrainingJobStatus", "PostTrainingJobStatusResponse", "PostTrainingRLHFRequest", + "PostTrainingRLHFRequestWrapper", "PostTrainingSFTRequest", - "PreferenceOptimizeRequestWrapper", + "PostTrainingSFTRequestWrapper", "QLoraFinetuningConfig", "QueryDocumentsRequest", "QueryDocumentsResponse", "RLHFAlgorithm", "RestAPIExecutionConfig", "RestAPIMethod", - "RewardScoreRequestWrapper", "RewardScoringRequest", + "RewardScoringRequestWrapper", "RewardScoringResponse", "Run", "SamplingParams", @@ -6822,9 +6823,8 @@ "ShieldDefinition", "ShieldResponse", "StopReason", - "SupervisedFineTuneRequestWrapper", - "SyntheticDataGenerateRequestWrapper", "SyntheticDataGenerationRequest", + "SyntheticDataGenerationRequestWrapper", "SyntheticDataGenerationResponse", "SystemMessage", "TokenLogProbs", diff --git a/rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.yaml b/rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.yaml index a1125b921..cfd01b291 100644 --- a/rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.yaml +++ b/rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.yaml @@ -346,6 +346,14 @@ components: - session_id - messages type: object + AgenticSystemTurnCreateRequestWrapper: + additionalProperties: false + properties: + request: + $ref: '#/components/schemas/AgenticSystemTurnCreateRequest' + required: + - request + type: object AgenticSystemTurnResponseEvent: additionalProperties: false properties: @@ -870,14 +878,6 @@ components: - agent_id - session_name type: object - CreateAgenticSystemTurnRequestWrapper: - additionalProperties: false - properties: - request: - $ref: '#/components/schemas/AgenticSystemTurnCreateRequest' - required: - - request - type: object CreateDatasetRequest: additionalProperties: false properties: @@ -1373,14 +1373,6 @@ components: required: - document_ids type: object - GetLogsRequestWrapper: - additionalProperties: false - properties: - request: - $ref: '#/components/schemas/LogSearchRequest' - required: - - request - type: object InferenceStep: additionalProperties: false properties: @@ -1513,6 +1505,14 @@ components: required: - query type: object + LogSearchRequestWrapper: + additionalProperties: false + properties: + request: + $ref: '#/components/schemas/LogSearchRequest' + required: + - request + type: object LoraFinetuningConfig: additionalProperties: false properties: @@ -1853,6 +1853,14 @@ components: - logger_config title: Request to finetune a model. type: object + PostTrainingRLHFRequestWrapper: + additionalProperties: false + properties: + request: + $ref: '#/components/schemas/PostTrainingRLHFRequest' + required: + - request + type: object PostTrainingSFTRequest: additionalProperties: false properties: @@ -1908,11 +1916,11 @@ components: - logger_config title: Request to finetune a model. type: object - PreferenceOptimizeRequestWrapper: + PostTrainingSFTRequestWrapper: additionalProperties: false properties: request: - $ref: '#/components/schemas/PostTrainingRLHFRequest' + $ref: '#/components/schemas/PostTrainingSFTRequest' required: - request type: object @@ -2028,14 +2036,6 @@ components: - PUT - DELETE type: string - RewardScoreRequestWrapper: - additionalProperties: false - properties: - request: - $ref: '#/components/schemas/RewardScoringRequest' - required: - - request - type: object RewardScoringRequest: additionalProperties: false properties: @@ -2051,6 +2051,14 @@ components: title: Request to score a reward function. A list of prompts and a list of responses per prompt. type: object + RewardScoringRequestWrapper: + additionalProperties: false + properties: + request: + $ref: '#/components/schemas/RewardScoringRequest' + required: + - request + type: object RewardScoringResponse: additionalProperties: false properties: @@ -2244,22 +2252,6 @@ components: - end_of_message - out_of_tokens type: string - SupervisedFineTuneRequestWrapper: - additionalProperties: false - properties: - request: - $ref: '#/components/schemas/PostTrainingSFTRequest' - required: - - request - type: object - SyntheticDataGenerateRequestWrapper: - additionalProperties: false - properties: - request: - $ref: '#/components/schemas/SyntheticDataGenerationRequest' - required: - - request - type: object SyntheticDataGenerationRequest: additionalProperties: false properties: @@ -2289,6 +2281,14 @@ components: title: Request to generate synthetic data. A small batch of prompts and a filtering function type: object + SyntheticDataGenerationRequestWrapper: + additionalProperties: false + properties: + request: + $ref: '#/components/schemas/SyntheticDataGenerationRequest' + required: + - request + type: object SyntheticDataGenerationResponse: additionalProperties: false properties: @@ -2777,7 +2777,7 @@ info: 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-09 11:14:56.584501" + \ draft and subject to change.\n Generated at 2024-09-09 11:19:39.855375" title: '[DRAFT] Llama Stack Specification' version: 0.0.1 jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema @@ -2909,7 +2909,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateAgenticSystemTurnRequestWrapper' + $ref: '#/components/schemas/AgenticSystemTurnCreateRequestWrapper' required: true responses: '200': @@ -3351,7 +3351,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GetLogsRequestWrapper' + $ref: '#/components/schemas/LogSearchRequestWrapper' required: true responses: '200': @@ -3610,7 +3610,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PreferenceOptimizeRequestWrapper' + $ref: '#/components/schemas/PostTrainingRLHFRequestWrapper' required: true responses: '200': @@ -3628,7 +3628,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SupervisedFineTuneRequestWrapper' + $ref: '#/components/schemas/PostTrainingSFTRequestWrapper' required: true responses: '200': @@ -3646,7 +3646,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RewardScoreRequestWrapper' + $ref: '#/components/schemas/RewardScoringRequestWrapper' required: true responses: '200': @@ -3713,7 +3713,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SyntheticDataGenerateRequestWrapper' + $ref: '#/components/schemas/SyntheticDataGenerationRequestWrapper' required: true responses: '200': @@ -3729,16 +3729,16 @@ security: servers: - url: http://any-hosted-llama-stack.com tags: -- name: Memory -- name: Telemetry -- name: PostTraining -- name: BatchInference -- name: AgenticSystem -- name: RewardScoring -- name: SyntheticDataGeneration -- name: Evaluations - name: Inference - name: Datasets +- name: Evaluations +- name: Memory +- name: SyntheticDataGeneration +- name: PostTraining +- name: RewardScoring +- name: BatchInference +- name: Telemetry +- name: AgenticSystem - description: name: BatchChatCompletionRequest @@ -3891,9 +3891,9 @@ tags: name: AgenticSystemTurnCreateRequest - description: name: Attachment -- description: - name: CreateAgenticSystemTurnRequestWrapper + name: AgenticSystemTurnCreateRequestWrapper - description: 'Streamed agent execution response. @@ -4068,9 +4068,9 @@ tags: - description: name: LogSearchRequest -- description: - name: GetLogsRequestWrapper + name: LogSearchRequestWrapper - description: name: Log - description: @@ -4131,9 +4131,9 @@ tags: name: RLHFAlgorithm - description: name: TrainingConfig -- description: - name: PreferenceOptimizeRequestWrapper + name: PostTrainingRLHFRequestWrapper - description: name: QueryDocumentsRequest @@ -4149,9 +4149,9 @@ tags: ' name: RewardScoringRequest -- description: - name: RewardScoreRequestWrapper + name: RewardScoringRequestWrapper - description: 'Response from the reward scoring. Batch of (prompt, response, score) tuples that pass the threshold. @@ -4180,9 +4180,9 @@ tags: - description: name: QLoraFinetuningConfig -- description: - name: SupervisedFineTuneRequestWrapper + name: PostTrainingSFTRequestWrapper - description: 'Request to generate synthetic data. A small batch of prompts and a filtering function @@ -4190,9 +4190,9 @@ tags: ' name: SyntheticDataGenerationRequest -- description: - name: SyntheticDataGenerateRequestWrapper + name: SyntheticDataGenerationRequestWrapper - description: 'Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold. @@ -4241,6 +4241,7 @@ x-tagGroups: - AgenticSystemSessionCreateResponse - AgenticSystemStepResponse - AgenticSystemTurnCreateRequest + - AgenticSystemTurnCreateRequestWrapper - AgenticSystemTurnResponseEvent - AgenticSystemTurnResponseStepCompletePayload - AgenticSystemTurnResponseStepProgressPayload @@ -4275,7 +4276,6 @@ x-tagGroups: - CompletionResponseStreamChunk - CreateAgenticSystemRequest - CreateAgenticSystemSessionRequest - - CreateAgenticSystemTurnRequestWrapper - CreateDatasetRequest - CreateDatasetRequestWrapper - CreateExperimentRequest @@ -4309,7 +4309,6 @@ x-tagGroups: - FunctionCallToolDefinition - GetAgenticSystemSessionRequest - GetDocumentsRequest - - GetLogsRequestWrapper - InferenceStep - InsertDocumentsRequest - ListArtifactsRequest @@ -4319,6 +4318,7 @@ x-tagGroups: - LogMetricsRequest - LogMetricsRequestWrapper - LogSearchRequest + - LogSearchRequestWrapper - LoraFinetuningConfig - MemoryBank - MemoryBankDocument @@ -4333,16 +4333,17 @@ x-tagGroups: - PostTrainingJobStatus - PostTrainingJobStatusResponse - PostTrainingRLHFRequest + - PostTrainingRLHFRequestWrapper - PostTrainingSFTRequest - - PreferenceOptimizeRequestWrapper + - PostTrainingSFTRequestWrapper - QLoraFinetuningConfig - QueryDocumentsRequest - QueryDocumentsResponse - RLHFAlgorithm - RestAPIExecutionConfig - RestAPIMethod - - RewardScoreRequestWrapper - RewardScoringRequest + - RewardScoringRequestWrapper - RewardScoringResponse - Run - SamplingParams @@ -4354,9 +4355,8 @@ x-tagGroups: - ShieldDefinition - ShieldResponse - StopReason - - SupervisedFineTuneRequestWrapper - - SyntheticDataGenerateRequestWrapper - SyntheticDataGenerationRequest + - SyntheticDataGenerationRequestWrapper - SyntheticDataGenerationResponse - SystemMessage - TokenLogProbs diff --git a/rfcs/openapi_generator/pyopenapi/generator.py b/rfcs/openapi_generator/pyopenapi/generator.py index 4acc0e863..a711d9f68 100644 --- a/rfcs/openapi_generator/pyopenapi/generator.py +++ b/rfcs/openapi_generator/pyopenapi/generator.py @@ -473,8 +473,7 @@ class Generator: if len(op.request_params) == 1 and "Request" in first[1].__name__: # TODO(ashwin): Undo the "Request" hack and this entire block eventually - op_name = "".join(word.capitalize() for word in op.name.split("_")) - request_name = f"{op_name}RequestWrapper" + request_name = first[1].__name__ + "Wrapper" request_type = make_dataclass(request_name, op.request_params) else: op_name = "".join(word.capitalize() for word in op.name.split("_"))