mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-21 03:59:42 +00:00
Update OpenAPI generator to output discriminator (#848)
oneOf should have discriminators so Stainless can generate better code ## Test Plan Going to generate the SDK now and check.
This commit is contained in:
parent
65f07c3d63
commit
35c71d5bbe
7 changed files with 159 additions and 35 deletions
|
@ -76,6 +76,8 @@ components:
|
|||
additionalProperties: false
|
||||
properties:
|
||||
step:
|
||||
discriminator:
|
||||
propertyName: step_type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/InferenceStep'
|
||||
- $ref: '#/components/schemas/ToolExecutionStep'
|
||||
|
@ -119,6 +121,8 @@ components:
|
|||
additionalProperties: false
|
||||
properties:
|
||||
payload:
|
||||
discriminator:
|
||||
propertyName: event_type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/AgentTurnResponseStepStartPayload'
|
||||
- $ref: '#/components/schemas/AgentTurnResponseStepProgressPayload'
|
||||
|
@ -137,6 +141,8 @@ components:
|
|||
default: step_complete
|
||||
type: string
|
||||
step_details:
|
||||
discriminator:
|
||||
propertyName: step_type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/InferenceStep'
|
||||
- $ref: '#/components/schemas/ToolExecutionStep'
|
||||
|
@ -258,6 +264,8 @@ components:
|
|||
additionalProperties: false
|
||||
properties:
|
||||
eval_candidate:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ModelCandidate'
|
||||
- $ref: '#/components/schemas/AgentCandidate'
|
||||
|
@ -265,6 +273,8 @@ components:
|
|||
type: integer
|
||||
scoring_params:
|
||||
additionalProperties:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/LLMAsJudgeScoringFnParams'
|
||||
- $ref: '#/components/schemas/RegexParserScoringFnParams'
|
||||
|
@ -402,6 +412,8 @@ components:
|
|||
additionalProperties: false
|
||||
properties:
|
||||
eval_candidate:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ModelCandidate'
|
||||
- $ref: '#/components/schemas/AgentCandidate'
|
||||
|
@ -619,6 +631,8 @@ components:
|
|||
title: streamed completion response.
|
||||
type: object
|
||||
ContentDelta:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/TextDelta'
|
||||
- $ref: '#/components/schemas/ImageDelta'
|
||||
|
@ -897,6 +911,8 @@ components:
|
|||
type: string
|
||||
type: array
|
||||
task_config:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/BenchmarkEvalTaskConfig'
|
||||
- $ref: '#/components/schemas/AppEvalTaskConfig'
|
||||
|
@ -1038,6 +1054,8 @@ components:
|
|||
$ref: '#/components/schemas/InterleavedContentItem'
|
||||
type: array
|
||||
InterleavedContentItem:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ImageContentItem'
|
||||
- $ref: '#/components/schemas/TextContentItem'
|
||||
|
@ -1244,6 +1262,8 @@ components:
|
|||
additionalProperties: false
|
||||
properties:
|
||||
event:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/UnstructuredLogEvent'
|
||||
- $ref: '#/components/schemas/MetricEvent'
|
||||
|
@ -1325,6 +1345,8 @@ components:
|
|||
- inserted_context
|
||||
type: object
|
||||
Message:
|
||||
discriminator:
|
||||
propertyName: role
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/UserMessage'
|
||||
- $ref: '#/components/schemas/SystemMessage'
|
||||
|
@ -1495,6 +1517,8 @@ components:
|
|||
- total_count
|
||||
type: object
|
||||
ParamType:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/StringType'
|
||||
- $ref: '#/components/schemas/NumberType'
|
||||
|
@ -1805,6 +1829,8 @@ components:
|
|||
- max_chunks
|
||||
type: object
|
||||
RAGQueryGeneratorConfig:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig'
|
||||
- $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig'
|
||||
|
@ -1922,6 +1948,8 @@ components:
|
|||
description:
|
||||
type: string
|
||||
params:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/LLMAsJudgeScoringFnParams'
|
||||
- $ref: '#/components/schemas/RegexParserScoringFnParams'
|
||||
|
@ -2002,6 +2030,8 @@ components:
|
|||
- embedding_model
|
||||
type: object
|
||||
ResponseFormat:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- additionalProperties: false
|
||||
properties:
|
||||
|
@ -2063,6 +2093,8 @@ components:
|
|||
additionalProperties: false
|
||||
properties:
|
||||
task_config:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/BenchmarkEvalTaskConfig'
|
||||
- $ref: '#/components/schemas/AppEvalTaskConfig'
|
||||
|
@ -2130,6 +2162,8 @@ components:
|
|||
default: 1.0
|
||||
type: number
|
||||
strategy:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/GreedySamplingStrategy'
|
||||
- $ref: '#/components/schemas/TopPSamplingStrategy'
|
||||
|
@ -2167,7 +2201,9 @@ components:
|
|||
scoring_functions:
|
||||
additionalProperties:
|
||||
oneOf:
|
||||
- oneOf:
|
||||
- discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/LLMAsJudgeScoringFnParams'
|
||||
- $ref: '#/components/schemas/RegexParserScoringFnParams'
|
||||
- $ref: '#/components/schemas/BasicScoringFnParams'
|
||||
|
@ -2208,7 +2244,9 @@ components:
|
|||
scoring_functions:
|
||||
additionalProperties:
|
||||
oneOf:
|
||||
- oneOf:
|
||||
- discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/LLMAsJudgeScoringFnParams'
|
||||
- $ref: '#/components/schemas/RegexParserScoringFnParams'
|
||||
- $ref: '#/components/schemas/BasicScoringFnParams'
|
||||
|
@ -2246,6 +2284,8 @@ components:
|
|||
- type: object
|
||||
type: object
|
||||
params:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/LLMAsJudgeScoringFnParams'
|
||||
- $ref: '#/components/schemas/RegexParserScoringFnParams'
|
||||
|
@ -2503,6 +2543,8 @@ components:
|
|||
- type: object
|
||||
type: object
|
||||
payload:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/SpanStartPayload'
|
||||
- $ref: '#/components/schemas/SpanEndPayload'
|
||||
|
@ -2528,6 +2570,8 @@ components:
|
|||
additionalProperties: false
|
||||
properties:
|
||||
algorithm_config:
|
||||
discriminator:
|
||||
propertyName: type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/LoraFinetuningConfig'
|
||||
- $ref: '#/components/schemas/QATFinetuningConfig'
|
||||
|
@ -3115,6 +3159,8 @@ components:
|
|||
type: string
|
||||
steps:
|
||||
items:
|
||||
discriminator:
|
||||
propertyName: step_type
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/InferenceStep'
|
||||
- $ref: '#/components/schemas/ToolExecutionStep'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue