Skip to content

Commit ad5015b

Browse files
Stainless Botstainless-app[bot]
authored andcommitted
feat(api): update via SDK Studio (#152)
1 parent 67b1f3f commit ad5015b

File tree

9 files changed

+1319
-2285
lines changed

9 files changed

+1319
-2285
lines changed

src/prompt_foundry_python_sdk/types/evaluation.py

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
4-
from typing_extensions import Literal
3+
from typing import Dict, List, Union, Optional
4+
from typing_extensions import Literal, Annotated
55

66
from pydantic import Field as FieldInfo
77

8+
from .._utils import PropertyInfo
89
from .._models import BaseModel
910

10-
__all__ = ["Evaluation", "AppendedMessage", "AppendedMessageToolCall", "AppendedMessageToolCallFunction"]
11+
__all__ = [
12+
"Evaluation",
13+
"AppendedMessage",
14+
"AppendedMessageContent",
15+
"AppendedMessageContentTextContentBlockSchema",
16+
"AppendedMessageContentImageBase64ContentBlock",
17+
"AppendedMessageContentToolCallContentBlock",
18+
"AppendedMessageContentToolCallContentBlockToolCall",
19+
"AppendedMessageContentToolCallContentBlockToolCallFunction",
20+
"AppendedMessageContentToolResultContentBlock",
21+
]
1122

1223

13-
class AppendedMessageToolCallFunction(BaseModel):
24+
class AppendedMessageContentTextContentBlockSchema(BaseModel):
25+
text: str
26+
27+
type: Literal["TEXT"]
28+
29+
30+
class AppendedMessageContentImageBase64ContentBlock(BaseModel):
31+
image_base64: str = FieldInfo(alias="imageBase64")
32+
33+
media_type: str = FieldInfo(alias="mediaType")
34+
35+
type: Literal["IMAGE_BASE64"]
36+
37+
38+
class AppendedMessageContentToolCallContentBlockToolCallFunction(BaseModel):
1439
arguments: str
1540
"""
1641
The arguments to call the function with, as generated by the model in JSON
@@ -23,8 +48,8 @@ class AppendedMessageToolCallFunction(BaseModel):
2348
"""The name of the function to call."""
2449

2550

26-
class AppendedMessageToolCall(BaseModel):
27-
function: AppendedMessageToolCallFunction
51+
class AppendedMessageContentToolCallContentBlockToolCall(BaseModel):
52+
function: AppendedMessageContentToolCallContentBlockToolCallFunction
2853

2954
tool_call_id: str = FieldInfo(alias="toolCallId")
3055
"""TOOL_CALL_1"""
@@ -33,15 +58,35 @@ class AppendedMessageToolCall(BaseModel):
3358
"""The type of the tool. Currently, only `function` is supported."""
3459

3560

36-
class AppendedMessage(BaseModel):
37-
content: Optional[str] = None
38-
"""Example: "Hello, {{city}}!" """
61+
class AppendedMessageContentToolCallContentBlock(BaseModel):
62+
tool_call: AppendedMessageContentToolCallContentBlockToolCall = FieldInfo(alias="toolCall")
63+
64+
type: Literal["TOOL_CALL"]
3965

40-
role: Literal["assistant", "system", "tool", "user"]
4166

42-
tool_call_id: Optional[str] = FieldInfo(alias="toolCallId", default=None)
67+
class AppendedMessageContentToolResultContentBlock(BaseModel):
68+
result: str
4369

44-
tool_calls: Optional[List[AppendedMessageToolCall]] = FieldInfo(alias="toolCalls", default=None)
70+
tool_call_id: str = FieldInfo(alias="toolCallId")
71+
72+
type: Literal["TOOL_RESULT"]
73+
74+
75+
AppendedMessageContent = Annotated[
76+
Union[
77+
AppendedMessageContentTextContentBlockSchema,
78+
AppendedMessageContentImageBase64ContentBlock,
79+
AppendedMessageContentToolCallContentBlock,
80+
AppendedMessageContentToolResultContentBlock,
81+
],
82+
PropertyInfo(discriminator="type"),
83+
]
84+
85+
86+
class AppendedMessage(BaseModel):
87+
content: List[AppendedMessageContent]
88+
89+
role: Literal["assistant", "system", "tool", "user"]
4590

4691

4792
class Evaluation(BaseModel):

src/prompt_foundry_python_sdk/types/evaluation_create_params.py

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Iterable, Optional
5+
from typing import Dict, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, Annotated, TypedDict
77

88
from .._utils import PropertyInfo
99

10-
__all__ = ["EvaluationCreateParams", "AppendedMessage", "AppendedMessageToolCall", "AppendedMessageToolCallFunction"]
10+
__all__ = [
11+
"EvaluationCreateParams",
12+
"AppendedMessage",
13+
"AppendedMessageContent",
14+
"AppendedMessageContentTextContentBlockSchema",
15+
"AppendedMessageContentImageBase64ContentBlock",
16+
"AppendedMessageContentToolCallContentBlock",
17+
"AppendedMessageContentToolCallContentBlockToolCall",
18+
"AppendedMessageContentToolCallContentBlockToolCallFunction",
19+
"AppendedMessageContentToolResultContentBlock",
20+
]
1121

1222

1323
class EvaluationCreateParams(TypedDict, total=False):
@@ -20,7 +30,21 @@ class EvaluationCreateParams(TypedDict, total=False):
2030
"""The template variables added to the prompt when executing the prompt."""
2131

2232

23-
class AppendedMessageToolCallFunction(TypedDict, total=False):
33+
class AppendedMessageContentTextContentBlockSchema(TypedDict, total=False):
34+
text: Required[str]
35+
36+
type: Required[Literal["TEXT"]]
37+
38+
39+
class AppendedMessageContentImageBase64ContentBlock(TypedDict, total=False):
40+
image_base64: Required[Annotated[str, PropertyInfo(alias="imageBase64")]]
41+
42+
media_type: Required[Annotated[str, PropertyInfo(alias="mediaType")]]
43+
44+
type: Required[Literal["IMAGE_BASE64"]]
45+
46+
47+
class AppendedMessageContentToolCallContentBlockToolCallFunction(TypedDict, total=False):
2448
arguments: Required[str]
2549
"""
2650
The arguments to call the function with, as generated by the model in JSON
@@ -33,8 +57,8 @@ class AppendedMessageToolCallFunction(TypedDict, total=False):
3357
"""The name of the function to call."""
3458

3559

36-
class AppendedMessageToolCall(TypedDict, total=False):
37-
function: Required[AppendedMessageToolCallFunction]
60+
class AppendedMessageContentToolCallContentBlockToolCall(TypedDict, total=False):
61+
function: Required[AppendedMessageContentToolCallContentBlockToolCallFunction]
3862

3963
tool_call_id: Required[Annotated[str, PropertyInfo(alias="toolCallId")]]
4064
"""TOOL_CALL_1"""
@@ -43,12 +67,29 @@ class AppendedMessageToolCall(TypedDict, total=False):
4367
"""The type of the tool. Currently, only `function` is supported."""
4468

4569

46-
class AppendedMessage(TypedDict, total=False):
47-
content: Required[Optional[str]]
48-
"""Example: "Hello, {{city}}!" """
70+
class AppendedMessageContentToolCallContentBlock(TypedDict, total=False):
71+
tool_call: Required[Annotated[AppendedMessageContentToolCallContentBlockToolCall, PropertyInfo(alias="toolCall")]]
72+
73+
type: Required[Literal["TOOL_CALL"]]
4974

50-
role: Required[Literal["assistant", "system", "tool", "user"]]
5175

52-
tool_call_id: Required[Annotated[Optional[str], PropertyInfo(alias="toolCallId")]]
76+
class AppendedMessageContentToolResultContentBlock(TypedDict, total=False):
77+
result: Required[str]
5378

54-
tool_calls: Required[Annotated[Optional[Iterable[AppendedMessageToolCall]], PropertyInfo(alias="toolCalls")]]
79+
tool_call_id: Required[Annotated[str, PropertyInfo(alias="toolCallId")]]
80+
81+
type: Required[Literal["TOOL_RESULT"]]
82+
83+
84+
AppendedMessageContent = Union[
85+
AppendedMessageContentTextContentBlockSchema,
86+
AppendedMessageContentImageBase64ContentBlock,
87+
AppendedMessageContentToolCallContentBlock,
88+
AppendedMessageContentToolResultContentBlock,
89+
]
90+
91+
92+
class AppendedMessage(TypedDict, total=False):
93+
content: Required[Iterable[AppendedMessageContent]]
94+
95+
role: Required[Literal["assistant", "system", "tool", "user"]]

src/prompt_foundry_python_sdk/types/evaluation_update_params.py

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Iterable, Optional
5+
from typing import Dict, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, Annotated, TypedDict
77

88
from .._utils import PropertyInfo
99

10-
__all__ = ["EvaluationUpdateParams", "AppendedMessage", "AppendedMessageToolCall", "AppendedMessageToolCallFunction"]
10+
__all__ = [
11+
"EvaluationUpdateParams",
12+
"AppendedMessage",
13+
"AppendedMessageContent",
14+
"AppendedMessageContentTextContentBlockSchema",
15+
"AppendedMessageContentImageBase64ContentBlock",
16+
"AppendedMessageContentToolCallContentBlock",
17+
"AppendedMessageContentToolCallContentBlockToolCall",
18+
"AppendedMessageContentToolCallContentBlockToolCallFunction",
19+
"AppendedMessageContentToolResultContentBlock",
20+
]
1121

1222

1323
class EvaluationUpdateParams(TypedDict, total=False):
@@ -20,7 +30,21 @@ class EvaluationUpdateParams(TypedDict, total=False):
2030
"""The template variables added to the prompt when executing the prompt."""
2131

2232

23-
class AppendedMessageToolCallFunction(TypedDict, total=False):
33+
class AppendedMessageContentTextContentBlockSchema(TypedDict, total=False):
34+
text: Required[str]
35+
36+
type: Required[Literal["TEXT"]]
37+
38+
39+
class AppendedMessageContentImageBase64ContentBlock(TypedDict, total=False):
40+
image_base64: Required[Annotated[str, PropertyInfo(alias="imageBase64")]]
41+
42+
media_type: Required[Annotated[str, PropertyInfo(alias="mediaType")]]
43+
44+
type: Required[Literal["IMAGE_BASE64"]]
45+
46+
47+
class AppendedMessageContentToolCallContentBlockToolCallFunction(TypedDict, total=False):
2448
arguments: Required[str]
2549
"""
2650
The arguments to call the function with, as generated by the model in JSON
@@ -33,8 +57,8 @@ class AppendedMessageToolCallFunction(TypedDict, total=False):
3357
"""The name of the function to call."""
3458

3559

36-
class AppendedMessageToolCall(TypedDict, total=False):
37-
function: Required[AppendedMessageToolCallFunction]
60+
class AppendedMessageContentToolCallContentBlockToolCall(TypedDict, total=False):
61+
function: Required[AppendedMessageContentToolCallContentBlockToolCallFunction]
3862

3963
tool_call_id: Required[Annotated[str, PropertyInfo(alias="toolCallId")]]
4064
"""TOOL_CALL_1"""
@@ -43,12 +67,29 @@ class AppendedMessageToolCall(TypedDict, total=False):
4367
"""The type of the tool. Currently, only `function` is supported."""
4468

4569

46-
class AppendedMessage(TypedDict, total=False):
47-
content: Required[Optional[str]]
48-
"""Example: "Hello, {{city}}!" """
70+
class AppendedMessageContentToolCallContentBlock(TypedDict, total=False):
71+
tool_call: Required[Annotated[AppendedMessageContentToolCallContentBlockToolCall, PropertyInfo(alias="toolCall")]]
72+
73+
type: Required[Literal["TOOL_CALL"]]
4974

50-
role: Required[Literal["assistant", "system", "tool", "user"]]
5175

52-
tool_call_id: Required[Annotated[Optional[str], PropertyInfo(alias="toolCallId")]]
76+
class AppendedMessageContentToolResultContentBlock(TypedDict, total=False):
77+
result: Required[str]
5378

54-
tool_calls: Required[Annotated[Optional[Iterable[AppendedMessageToolCall]], PropertyInfo(alias="toolCalls")]]
79+
tool_call_id: Required[Annotated[str, PropertyInfo(alias="toolCallId")]]
80+
81+
type: Required[Literal["TOOL_RESULT"]]
82+
83+
84+
AppendedMessageContent = Union[
85+
AppendedMessageContentTextContentBlockSchema,
86+
AppendedMessageContentImageBase64ContentBlock,
87+
AppendedMessageContentToolCallContentBlock,
88+
AppendedMessageContentToolResultContentBlock,
89+
]
90+
91+
92+
class AppendedMessage(TypedDict, total=False):
93+
content: Required[Iterable[AppendedMessageContent]]
94+
95+
role: Required[Literal["assistant", "system", "tool", "user"]]

src/prompt_foundry_python_sdk/types/prompt_configuration.py

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
4-
from typing_extensions import Literal
3+
from typing import Dict, List, Union, Optional
4+
from typing_extensions import Literal, Annotated
55

66
from pydantic import Field as FieldInfo
77

8+
from .._utils import PropertyInfo
89
from .._models import BaseModel
910

10-
__all__ = ["PromptConfiguration", "Message", "MessageToolCall", "MessageToolCallFunction", "Parameters", "Tool"]
11+
__all__ = [
12+
"PromptConfiguration",
13+
"Message",
14+
"MessageContent",
15+
"MessageContentTextContentBlockSchema",
16+
"MessageContentImageBase64ContentBlock",
17+
"MessageContentToolCallContentBlock",
18+
"MessageContentToolCallContentBlockToolCall",
19+
"MessageContentToolCallContentBlockToolCallFunction",
20+
"MessageContentToolResultContentBlock",
21+
"Parameters",
22+
"Tool",
23+
]
1124

1225

13-
class MessageToolCallFunction(BaseModel):
26+
class MessageContentTextContentBlockSchema(BaseModel):
27+
text: str
28+
29+
type: Literal["TEXT"]
30+
31+
32+
class MessageContentImageBase64ContentBlock(BaseModel):
33+
image_base64: str = FieldInfo(alias="imageBase64")
34+
35+
media_type: str = FieldInfo(alias="mediaType")
36+
37+
type: Literal["IMAGE_BASE64"]
38+
39+
40+
class MessageContentToolCallContentBlockToolCallFunction(BaseModel):
1441
arguments: str
1542
"""
1643
The arguments to call the function with, as generated by the model in JSON
@@ -23,8 +50,8 @@ class MessageToolCallFunction(BaseModel):
2350
"""The name of the function to call."""
2451

2552

26-
class MessageToolCall(BaseModel):
27-
function: MessageToolCallFunction
53+
class MessageContentToolCallContentBlockToolCall(BaseModel):
54+
function: MessageContentToolCallContentBlockToolCallFunction
2855

2956
tool_call_id: str = FieldInfo(alias="toolCallId")
3057
"""TOOL_CALL_1"""
@@ -33,15 +60,35 @@ class MessageToolCall(BaseModel):
3360
"""The type of the tool. Currently, only `function` is supported."""
3461

3562

36-
class Message(BaseModel):
37-
content: Optional[str] = None
38-
"""Example: "Hello, {{city}}!" """
63+
class MessageContentToolCallContentBlock(BaseModel):
64+
tool_call: MessageContentToolCallContentBlockToolCall = FieldInfo(alias="toolCall")
65+
66+
type: Literal["TOOL_CALL"]
3967

40-
role: Literal["assistant", "system", "tool", "user"]
4168

42-
tool_call_id: Optional[str] = FieldInfo(alias="toolCallId", default=None)
69+
class MessageContentToolResultContentBlock(BaseModel):
70+
result: str
4371

44-
tool_calls: Optional[List[MessageToolCall]] = FieldInfo(alias="toolCalls", default=None)
72+
tool_call_id: str = FieldInfo(alias="toolCallId")
73+
74+
type: Literal["TOOL_RESULT"]
75+
76+
77+
MessageContent = Annotated[
78+
Union[
79+
MessageContentTextContentBlockSchema,
80+
MessageContentImageBase64ContentBlock,
81+
MessageContentToolCallContentBlock,
82+
MessageContentToolResultContentBlock,
83+
],
84+
PropertyInfo(discriminator="type"),
85+
]
86+
87+
88+
class Message(BaseModel):
89+
content: List[MessageContent]
90+
91+
role: Literal["assistant", "system", "tool", "user"]
4592

4693

4794
class Parameters(BaseModel):

0 commit comments

Comments
 (0)