Skip to content

Commit d6f3ef2

Browse files
authored
Sync changes for the ParamType fix (#90)
# What does this PR do? Sync changes for the ParamType fix
1 parent 9bb9882 commit d6f3ef2

File tree

2 files changed

+124
-6
lines changed

2 files changed

+124
-6
lines changed

src/llama_stack_client/types/shared/param_type.py

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,70 @@
55

66
from ..._models import BaseModel
77

8-
__all__ = ["ParamType", "Type"]
8+
__all__ = [
9+
"ParamType",
10+
"StringType",
11+
"NumberType",
12+
"BooleanType",
13+
"ArrayType",
14+
"ObjectType",
15+
"JsonType",
16+
"UnionType",
17+
"ChatCompletionInputType",
18+
"CompletionInputType",
19+
"AgentTurnInputType",
20+
]
921

1022

11-
class Type(BaseModel):
23+
class StringType(BaseModel):
1224
type: Literal["string"]
1325

1426

15-
ParamType: TypeAlias = Union[Type, Type, Type, Type, Type, Type, Type, Type, Type, Type]
27+
class NumberType(BaseModel):
28+
type: Literal["number"]
29+
30+
31+
class BooleanType(BaseModel):
32+
type: Literal["boolean"]
33+
34+
35+
class ArrayType(BaseModel):
36+
type: Literal["array"]
37+
38+
39+
class ObjectType(BaseModel):
40+
type: Literal["object"]
41+
42+
43+
class JsonType(BaseModel):
44+
type: Literal["json"]
45+
46+
47+
class UnionType(BaseModel):
48+
type: Literal["union"]
49+
50+
51+
class ChatCompletionInputType(BaseModel):
52+
type: Literal["chat_completion_input"]
53+
54+
55+
class CompletionInputType(BaseModel):
56+
type: Literal["completion_input"]
57+
58+
59+
class AgentTurnInputType(BaseModel):
60+
type: Literal["agent_turn_input"]
61+
62+
63+
ParamType: TypeAlias = Union[
64+
StringType,
65+
NumberType,
66+
BooleanType,
67+
ArrayType,
68+
ObjectType,
69+
JsonType,
70+
UnionType,
71+
ChatCompletionInputType,
72+
CompletionInputType,
73+
AgentTurnInputType,
74+
]

src/llama_stack_client/types/shared_params/param_type.py

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,70 @@
55
from typing import Union
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8-
__all__ = ["ParamType", "Type"]
8+
__all__ = [
9+
"ParamType",
10+
"StringType",
11+
"NumberType",
12+
"BooleanType",
13+
"ArrayType",
14+
"ObjectType",
15+
"JsonType",
16+
"UnionType",
17+
"ChatCompletionInputType",
18+
"CompletionInputType",
19+
"AgentTurnInputType",
20+
]
921

1022

11-
class Type(TypedDict, total=False):
23+
class StringType(TypedDict, total=False):
1224
type: Required[Literal["string"]]
1325

1426

15-
ParamType: TypeAlias = Union[Type, Type, Type, Type, Type, Type, Type, Type, Type, Type]
27+
class NumberType(TypedDict, total=False):
28+
type: Required[Literal["number"]]
29+
30+
31+
class BooleanType(TypedDict, total=False):
32+
type: Required[Literal["boolean"]]
33+
34+
35+
class ArrayType(TypedDict, total=False):
36+
type: Required[Literal["array"]]
37+
38+
39+
class ObjectType(TypedDict, total=False):
40+
type: Required[Literal["object"]]
41+
42+
43+
class JsonType(TypedDict, total=False):
44+
type: Required[Literal["json"]]
45+
46+
47+
class UnionType(TypedDict, total=False):
48+
type: Required[Literal["union"]]
49+
50+
51+
class ChatCompletionInputType(TypedDict, total=False):
52+
type: Required[Literal["chat_completion_input"]]
53+
54+
55+
class CompletionInputType(TypedDict, total=False):
56+
type: Required[Literal["completion_input"]]
57+
58+
59+
class AgentTurnInputType(TypedDict, total=False):
60+
type: Required[Literal["agent_turn_input"]]
61+
62+
63+
ParamType: TypeAlias = Union[
64+
StringType,
65+
NumberType,
66+
BooleanType,
67+
ArrayType,
68+
ObjectType,
69+
JsonType,
70+
UnionType,
71+
ChatCompletionInputType,
72+
CompletionInputType,
73+
AgentTurnInputType,
74+
]

0 commit comments

Comments
 (0)