Update OpenAPI

This commit is contained in:
Ashwin Bharambe 2024-12-16 14:41:11 -08:00
parent e0731ba353
commit d4935ca439
6 changed files with 440 additions and 1359 deletions

View file

@ -6,6 +6,7 @@
from typing import Literal, Union
from llama_models.schema_utils import register_schema
from pydantic import BaseModel, Field
from typing_extensions import Annotated
@ -53,21 +54,24 @@ class AgentTurnInputType(BaseModel):
type: Literal["agent_turn_input"] = "agent_turn_input"
ParamType = Annotated[
Union[
StringType,
NumberType,
BooleanType,
ArrayType,
ObjectType,
JsonType,
UnionType,
ChatCompletionInputType,
CompletionInputType,
AgentTurnInputType,
ParamType = register_schema(
Annotated[
Union[
StringType,
NumberType,
BooleanType,
ArrayType,
ObjectType,
JsonType,
UnionType,
ChatCompletionInputType,
CompletionInputType,
AgentTurnInputType,
],
Field(discriminator="type"),
],
Field(discriminator="type"),
]
name="ParamType",
)
# TODO: recursive definition of ParamType in these containers
# will cause infinite recursion in OpenAPI generation script