agentlin-client 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of agentlin-client might be problematic. Click here for more details.

Files changed (123) hide show
  1. agentlin_client/__init__.py +90 -0
  2. agentlin_client/_base_client.py +1995 -0
  3. agentlin_client/_client.py +403 -0
  4. agentlin_client/_compat.py +219 -0
  5. agentlin_client/_constants.py +14 -0
  6. agentlin_client/_exceptions.py +108 -0
  7. agentlin_client/_files.py +123 -0
  8. agentlin_client/_models.py +835 -0
  9. agentlin_client/_qs.py +150 -0
  10. agentlin_client/_resource.py +43 -0
  11. agentlin_client/_response.py +832 -0
  12. agentlin_client/_streaming.py +333 -0
  13. agentlin_client/_types.py +260 -0
  14. agentlin_client/_utils/__init__.py +64 -0
  15. agentlin_client/_utils/_compat.py +45 -0
  16. agentlin_client/_utils/_datetime_parse.py +136 -0
  17. agentlin_client/_utils/_logs.py +25 -0
  18. agentlin_client/_utils/_proxy.py +65 -0
  19. agentlin_client/_utils/_reflection.py +42 -0
  20. agentlin_client/_utils/_resources_proxy.py +24 -0
  21. agentlin_client/_utils/_streams.py +12 -0
  22. agentlin_client/_utils/_sync.py +86 -0
  23. agentlin_client/_utils/_transform.py +457 -0
  24. agentlin_client/_utils/_typing.py +156 -0
  25. agentlin_client/_utils/_utils.py +421 -0
  26. agentlin_client/_version.py +4 -0
  27. agentlin_client/lib/.keep +4 -0
  28. agentlin_client/py.typed +0 -0
  29. agentlin_client/resources/__init__.py +33 -0
  30. agentlin_client/resources/conversations/__init__.py +33 -0
  31. agentlin_client/resources/conversations/conversations.py +489 -0
  32. agentlin_client/resources/conversations/items.py +558 -0
  33. agentlin_client/resources/responses.py +1136 -0
  34. agentlin_client/types/__init__.py +22 -0
  35. agentlin_client/types/conversation_create_params.py +28 -0
  36. agentlin_client/types/conversation_delete_response.py +15 -0
  37. agentlin_client/types/conversation_update_params.py +20 -0
  38. agentlin_client/types/conversations/__init__.py +74 -0
  39. agentlin_client/types/conversations/code_interpreter_tool_call.py +55 -0
  40. agentlin_client/types/conversations/code_interpreter_tool_call_param.py +54 -0
  41. agentlin_client/types/conversations/computer_screenshot_image.py +22 -0
  42. agentlin_client/types/conversations/computer_screenshot_image_param.py +21 -0
  43. agentlin_client/types/conversations/computer_tool_call.py +201 -0
  44. agentlin_client/types/conversations/computer_tool_call_output_resource.py +37 -0
  45. agentlin_client/types/conversations/computer_tool_call_param.py +199 -0
  46. agentlin_client/types/conversations/computer_tool_call_safety_check.py +16 -0
  47. agentlin_client/types/conversations/computer_tool_call_safety_check_param.py +18 -0
  48. agentlin_client/types/conversations/conversation_item.py +133 -0
  49. agentlin_client/types/conversations/conversation_item_list.py +26 -0
  50. agentlin_client/types/conversations/conversation_resource.py +32 -0
  51. agentlin_client/types/conversations/custom_tool_call.py +25 -0
  52. agentlin_client/types/conversations/custom_tool_call_output.py +26 -0
  53. agentlin_client/types/conversations/custom_tool_call_output_param.py +27 -0
  54. agentlin_client/types/conversations/custom_tool_call_param.py +24 -0
  55. agentlin_client/types/conversations/easy_input_message.py +26 -0
  56. agentlin_client/types/conversations/easy_input_message_param.py +27 -0
  57. agentlin_client/types/conversations/file_search_tool_call.py +42 -0
  58. agentlin_client/types/conversations/file_search_tool_call_param.py +44 -0
  59. agentlin_client/types/conversations/function_and_custom_tool_call_output.py +15 -0
  60. agentlin_client/types/conversations/function_and_custom_tool_call_output_param.py +16 -0
  61. agentlin_client/types/conversations/function_call_item_status.py +7 -0
  62. agentlin_client/types/conversations/function_tool_call.py +32 -0
  63. agentlin_client/types/conversations/function_tool_call_output_resource.py +33 -0
  64. agentlin_client/types/conversations/function_tool_call_param.py +31 -0
  65. agentlin_client/types/conversations/function_tool_call_resource.py +10 -0
  66. agentlin_client/types/conversations/image_gen_tool_call.py +22 -0
  67. agentlin_client/types/conversations/image_gen_tool_call_param.py +22 -0
  68. agentlin_client/types/conversations/includable.py +14 -0
  69. agentlin_client/types/conversations/input_content.py +32 -0
  70. agentlin_client/types/conversations/input_content_param.py +30 -0
  71. agentlin_client/types/conversations/input_file_content.py +25 -0
  72. agentlin_client/types/conversations/input_file_content_param.py +25 -0
  73. agentlin_client/types/conversations/input_image_content.py +28 -0
  74. agentlin_client/types/conversations/input_image_content_param.py +28 -0
  75. agentlin_client/types/conversations/input_item.py +209 -0
  76. agentlin_client/types/conversations/input_item_param.py +203 -0
  77. agentlin_client/types/conversations/input_message.py +30 -0
  78. agentlin_client/types/conversations/input_message_param.py +31 -0
  79. agentlin_client/types/conversations/input_text_content.py +15 -0
  80. agentlin_client/types/conversations/input_text_content_param.py +15 -0
  81. agentlin_client/types/conversations/item_create_params.py +24 -0
  82. agentlin_client/types/conversations/item_list_params.py +50 -0
  83. agentlin_client/types/conversations/item_retrieve_params.py +22 -0
  84. agentlin_client/types/conversations/local_shell_tool_call.py +45 -0
  85. agentlin_client/types/conversations/local_shell_tool_call_output.py +22 -0
  86. agentlin_client/types/conversations/local_shell_tool_call_output_param.py +22 -0
  87. agentlin_client/types/conversations/local_shell_tool_call_param.py +47 -0
  88. agentlin_client/types/conversations/mcp_approval_request.py +24 -0
  89. agentlin_client/types/conversations/mcp_approval_request_param.py +24 -0
  90. agentlin_client/types/conversations/mcp_approval_response_resource.py +25 -0
  91. agentlin_client/types/conversations/mcp_list_tools.py +39 -0
  92. agentlin_client/types/conversations/mcp_list_tools_param.py +39 -0
  93. agentlin_client/types/conversations/mcp_tool_call.py +44 -0
  94. agentlin_client/types/conversations/mcp_tool_call_param.py +44 -0
  95. agentlin_client/types/conversations/output_message.py +34 -0
  96. agentlin_client/types/conversations/output_message_param.py +34 -0
  97. agentlin_client/types/conversations/output_text_content.py +117 -0
  98. agentlin_client/types/conversations/output_text_content_param.py +115 -0
  99. agentlin_client/types/conversations/reasoning_item.py +44 -0
  100. agentlin_client/types/conversations/reasoning_item_param.py +45 -0
  101. agentlin_client/types/conversations/reasoning_text_content.py +15 -0
  102. agentlin_client/types/conversations/reasoning_text_content_param.py +15 -0
  103. agentlin_client/types/conversations/refusal_content.py +15 -0
  104. agentlin_client/types/conversations/refusal_content_param.py +15 -0
  105. agentlin_client/types/conversations/web_search_tool_call.py +67 -0
  106. agentlin_client/types/conversations/web_search_tool_call_param.py +66 -0
  107. agentlin_client/types/mcp_tool_filter.py +20 -0
  108. agentlin_client/types/mcp_tool_filter_param.py +22 -0
  109. agentlin_client/types/model_response_properties_standard.py +87 -0
  110. agentlin_client/types/response.py +166 -0
  111. agentlin_client/types/response_create_params.py +497 -0
  112. agentlin_client/types/response_list_input_items_params.py +34 -0
  113. agentlin_client/types/response_list_input_items_response.py +70 -0
  114. agentlin_client/types/response_properties.py +328 -0
  115. agentlin_client/types/response_retrieve_params.py +42 -0
  116. agentlin_client/types/response_tool.py +495 -0
  117. agentlin_client/types/response_tool_param.py +491 -0
  118. agentlin_client/types/text_response_format_configuration.py +59 -0
  119. agentlin_client/types/text_response_format_configuration_param.py +54 -0
  120. agentlin_client-0.1.0.dist-info/METADATA +429 -0
  121. agentlin_client-0.1.0.dist-info/RECORD +123 -0
  122. agentlin_client-0.1.0.dist-info/WHEEL +4 -0
  123. agentlin_client-0.1.0.dist-info/licenses/LICENSE +7 -0
@@ -0,0 +1,22 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .response import Response as Response
6
+ from .response_tool import ResponseTool as ResponseTool
7
+ from .mcp_tool_filter import McpToolFilter as McpToolFilter
8
+ from .response_properties import ResponseProperties as ResponseProperties
9
+ from .response_tool_param import ResponseToolParam as ResponseToolParam
10
+ from .mcp_tool_filter_param import McpToolFilterParam as McpToolFilterParam
11
+ from .response_create_params import ResponseCreateParams as ResponseCreateParams
12
+ from .response_retrieve_params import ResponseRetrieveParams as ResponseRetrieveParams
13
+ from .conversation_create_params import ConversationCreateParams as ConversationCreateParams
14
+ from .conversation_update_params import ConversationUpdateParams as ConversationUpdateParams
15
+ from .conversation_delete_response import ConversationDeleteResponse as ConversationDeleteResponse
16
+ from .response_list_input_items_params import ResponseListInputItemsParams as ResponseListInputItemsParams
17
+ from .model_response_properties_standard import ModelResponsePropertiesStandard as ModelResponsePropertiesStandard
18
+ from .response_list_input_items_response import ResponseListInputItemsResponse as ResponseListInputItemsResponse
19
+ from .text_response_format_configuration import TextResponseFormatConfiguration as TextResponseFormatConfiguration
20
+ from .text_response_format_configuration_param import (
21
+ TextResponseFormatConfigurationParam as TextResponseFormatConfigurationParam,
22
+ )
@@ -0,0 +1,28 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Iterable, Optional
6
+ from typing_extensions import TypedDict
7
+
8
+ from .conversations.input_item_param import InputItemParam
9
+
10
+ __all__ = ["ConversationCreateParams"]
11
+
12
+
13
+ class ConversationCreateParams(TypedDict, total=False):
14
+ items: Optional[Iterable[InputItemParam]]
15
+ """Initial items to include in the conversation context.
16
+
17
+ You may add up to 20 items at a time.
18
+ """
19
+
20
+ metadata: Optional[Dict[str, str]]
21
+ """Set of 16 key-value pairs that can be attached to an object.
22
+
23
+ This can be useful for storing additional information about the object in a
24
+ structured format, and querying for objects via API or the dashboard.
25
+
26
+ Keys are strings with a maximum length of 64 characters. Values are strings with
27
+ a maximum length of 512 characters.
28
+ """
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing_extensions import Literal
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["ConversationDeleteResponse"]
8
+
9
+
10
+ class ConversationDeleteResponse(BaseModel):
11
+ id: str
12
+
13
+ deleted: bool
14
+
15
+ object: Literal["conversation.deleted"]
@@ -0,0 +1,20 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Optional
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ __all__ = ["ConversationUpdateParams"]
9
+
10
+
11
+ class ConversationUpdateParams(TypedDict, total=False):
12
+ metadata: Required[Optional[Dict[str, str]]]
13
+ """Set of 16 key-value pairs that can be attached to an object.
14
+
15
+ This can be useful for storing additional information about the object in a
16
+ structured format, and querying for objects via API or the dashboard.
17
+
18
+ Keys are strings with a maximum length of 64 characters. Values are strings with
19
+ a maximum length of 512 characters.
20
+ """
@@ -0,0 +1,74 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .includable import Includable as Includable
6
+ from .input_item import InputItem as InputItem
7
+ from .input_content import InputContent as InputContent
8
+ from .input_message import InputMessage as InputMessage
9
+ from .mcp_tool_call import McpToolCall as McpToolCall
10
+ from .mcp_list_tools import McpListTools as McpListTools
11
+ from .output_message import OutputMessage as OutputMessage
12
+ from .reasoning_item import ReasoningItem as ReasoningItem
13
+ from .refusal_content import RefusalContent as RefusalContent
14
+ from .custom_tool_call import CustomToolCall as CustomToolCall
15
+ from .input_item_param import InputItemParam as InputItemParam
16
+ from .item_list_params import ItemListParams as ItemListParams
17
+ from .conversation_item import ConversationItem as ConversationItem
18
+ from .computer_tool_call import ComputerToolCall as ComputerToolCall
19
+ from .easy_input_message import EasyInputMessage as EasyInputMessage
20
+ from .function_tool_call import FunctionToolCall as FunctionToolCall
21
+ from .input_file_content import InputFileContent as InputFileContent
22
+ from .input_text_content import InputTextContent as InputTextContent
23
+ from .item_create_params import ItemCreateParams as ItemCreateParams
24
+ from .image_gen_tool_call import ImageGenToolCall as ImageGenToolCall
25
+ from .input_content_param import InputContentParam as InputContentParam
26
+ from .input_image_content import InputImageContent as InputImageContent
27
+ from .input_message_param import InputMessageParam as InputMessageParam
28
+ from .mcp_tool_call_param import McpToolCallParam as McpToolCallParam
29
+ from .output_text_content import OutputTextContent as OutputTextContent
30
+ from .item_retrieve_params import ItemRetrieveParams as ItemRetrieveParams
31
+ from .mcp_approval_request import McpApprovalRequest as McpApprovalRequest
32
+ from .mcp_list_tools_param import McpListToolsParam as McpListToolsParam
33
+ from .output_message_param import OutputMessageParam as OutputMessageParam
34
+ from .reasoning_item_param import ReasoningItemParam as ReasoningItemParam
35
+ from .web_search_tool_call import WebSearchToolCall as WebSearchToolCall
36
+ from .conversation_resource import ConversationResource as ConversationResource
37
+ from .file_search_tool_call import FileSearchToolCall as FileSearchToolCall
38
+ from .local_shell_tool_call import LocalShellToolCall as LocalShellToolCall
39
+ from .refusal_content_param import RefusalContentParam as RefusalContentParam
40
+ from .conversation_item_list import ConversationItemList as ConversationItemList
41
+ from .custom_tool_call_param import CustomToolCallParam as CustomToolCallParam
42
+ from .reasoning_text_content import ReasoningTextContent as ReasoningTextContent
43
+ from .custom_tool_call_output import CustomToolCallOutput as CustomToolCallOutput
44
+ from .computer_tool_call_param import ComputerToolCallParam as ComputerToolCallParam
45
+ from .easy_input_message_param import EasyInputMessageParam as EasyInputMessageParam
46
+ from .function_tool_call_param import FunctionToolCallParam as FunctionToolCallParam
47
+ from .input_file_content_param import InputFileContentParam as InputFileContentParam
48
+ from .input_text_content_param import InputTextContentParam as InputTextContentParam
49
+ from .computer_screenshot_image import ComputerScreenshotImage as ComputerScreenshotImage
50
+ from .function_call_item_status import FunctionCallItemStatus as FunctionCallItemStatus
51
+ from .image_gen_tool_call_param import ImageGenToolCallParam as ImageGenToolCallParam
52
+ from .input_image_content_param import InputImageContentParam as InputImageContentParam
53
+ from .output_text_content_param import OutputTextContentParam as OutputTextContentParam
54
+ from .code_interpreter_tool_call import CodeInterpreterToolCall as CodeInterpreterToolCall
55
+ from .mcp_approval_request_param import McpApprovalRequestParam as McpApprovalRequestParam
56
+ from .web_search_tool_call_param import WebSearchToolCallParam as WebSearchToolCallParam
57
+ from .file_search_tool_call_param import FileSearchToolCallParam as FileSearchToolCallParam
58
+ from .function_tool_call_resource import FunctionToolCallResource as FunctionToolCallResource
59
+ from .local_shell_tool_call_param import LocalShellToolCallParam as LocalShellToolCallParam
60
+ from .local_shell_tool_call_output import LocalShellToolCallOutput as LocalShellToolCallOutput
61
+ from .reasoning_text_content_param import ReasoningTextContentParam as ReasoningTextContentParam
62
+ from .custom_tool_call_output_param import CustomToolCallOutputParam as CustomToolCallOutputParam
63
+ from .mcp_approval_response_resource import McpApprovalResponseResource as McpApprovalResponseResource
64
+ from .computer_screenshot_image_param import ComputerScreenshotImageParam as ComputerScreenshotImageParam
65
+ from .computer_tool_call_safety_check import ComputerToolCallSafetyCheck as ComputerToolCallSafetyCheck
66
+ from .code_interpreter_tool_call_param import CodeInterpreterToolCallParam as CodeInterpreterToolCallParam
67
+ from .computer_tool_call_output_resource import ComputerToolCallOutputResource as ComputerToolCallOutputResource
68
+ from .function_tool_call_output_resource import FunctionToolCallOutputResource as FunctionToolCallOutputResource
69
+ from .local_shell_tool_call_output_param import LocalShellToolCallOutputParam as LocalShellToolCallOutputParam
70
+ from .function_and_custom_tool_call_output import FunctionAndCustomToolCallOutput as FunctionAndCustomToolCallOutput
71
+ from .computer_tool_call_safety_check_param import ComputerToolCallSafetyCheckParam as ComputerToolCallSafetyCheckParam
72
+ from .function_and_custom_tool_call_output_param import (
73
+ FunctionAndCustomToolCallOutputParam as FunctionAndCustomToolCallOutputParam,
74
+ )
@@ -0,0 +1,55 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Union, Optional
4
+ from typing_extensions import Literal, Annotated, TypeAlias
5
+
6
+ from ..._utils import PropertyInfo
7
+ from ..._models import BaseModel
8
+
9
+ __all__ = ["CodeInterpreterToolCall", "Output", "OutputLogs", "OutputImage"]
10
+
11
+
12
+ class OutputLogs(BaseModel):
13
+ logs: str
14
+ """The logs output from the code interpreter."""
15
+
16
+ type: Literal["logs"]
17
+ """The type of the output. Always 'logs'."""
18
+
19
+
20
+ class OutputImage(BaseModel):
21
+ type: Literal["image"]
22
+ """The type of the output. Always 'image'."""
23
+
24
+ url: str
25
+ """The URL of the image output from the code interpreter."""
26
+
27
+
28
+ Output: TypeAlias = Annotated[Union[OutputLogs, OutputImage], PropertyInfo(discriminator="type")]
29
+
30
+
31
+ class CodeInterpreterToolCall(BaseModel):
32
+ id: str
33
+ """The unique ID of the code interpreter tool call."""
34
+
35
+ code: Optional[str] = None
36
+ """The code to run, or null if not available."""
37
+
38
+ container_id: str
39
+ """The ID of the container used to run the code."""
40
+
41
+ outputs: Optional[List[Output]] = None
42
+ """
43
+ The outputs generated by the code interpreter, such as logs or images. Can be
44
+ null if no outputs are available.
45
+ """
46
+
47
+ status: Literal["in_progress", "completed", "incomplete", "interpreting", "failed"]
48
+ """The status of the code interpreter tool call.
49
+
50
+ Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and
51
+ `failed`.
52
+ """
53
+
54
+ type: Literal["code_interpreter_call"]
55
+ """The type of the code interpreter tool call. Always `code_interpreter_call`."""
@@ -0,0 +1,54 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union, Iterable, Optional
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
+
8
+ __all__ = ["CodeInterpreterToolCallParam", "Output", "OutputLogs", "OutputImage"]
9
+
10
+
11
+ class OutputLogs(TypedDict, total=False):
12
+ logs: Required[str]
13
+ """The logs output from the code interpreter."""
14
+
15
+ type: Required[Literal["logs"]]
16
+ """The type of the output. Always 'logs'."""
17
+
18
+
19
+ class OutputImage(TypedDict, total=False):
20
+ type: Required[Literal["image"]]
21
+ """The type of the output. Always 'image'."""
22
+
23
+ url: Required[str]
24
+ """The URL of the image output from the code interpreter."""
25
+
26
+
27
+ Output: TypeAlias = Union[OutputLogs, OutputImage]
28
+
29
+
30
+ class CodeInterpreterToolCallParam(TypedDict, total=False):
31
+ id: Required[str]
32
+ """The unique ID of the code interpreter tool call."""
33
+
34
+ code: Required[Optional[str]]
35
+ """The code to run, or null if not available."""
36
+
37
+ container_id: Required[str]
38
+ """The ID of the container used to run the code."""
39
+
40
+ outputs: Required[Optional[Iterable[Output]]]
41
+ """
42
+ The outputs generated by the code interpreter, such as logs or images. Can be
43
+ null if no outputs are available.
44
+ """
45
+
46
+ status: Required[Literal["in_progress", "completed", "incomplete", "interpreting", "failed"]]
47
+ """The status of the code interpreter tool call.
48
+
49
+ Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and
50
+ `failed`.
51
+ """
52
+
53
+ type: Required[Literal["code_interpreter_call"]]
54
+ """The type of the code interpreter tool call. Always `code_interpreter_call`."""
@@ -0,0 +1,22 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from ..._models import BaseModel
7
+
8
+ __all__ = ["ComputerScreenshotImage"]
9
+
10
+
11
+ class ComputerScreenshotImage(BaseModel):
12
+ type: Literal["computer_screenshot"]
13
+ """Specifies the event type.
14
+
15
+ For a computer screenshot, this property is always set to `computer_screenshot`.
16
+ """
17
+
18
+ file_id: Optional[str] = None
19
+ """The identifier of an uploaded file that contains the screenshot."""
20
+
21
+ image_url: Optional[str] = None
22
+ """The URL of the screenshot image."""
@@ -0,0 +1,21 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, TypedDict
6
+
7
+ __all__ = ["ComputerScreenshotImageParam"]
8
+
9
+
10
+ class ComputerScreenshotImageParam(TypedDict, total=False):
11
+ type: Required[Literal["computer_screenshot"]]
12
+ """Specifies the event type.
13
+
14
+ For a computer screenshot, this property is always set to `computer_screenshot`.
15
+ """
16
+
17
+ file_id: str
18
+ """The identifier of an uploaded file that contains the screenshot."""
19
+
20
+ image_url: str
21
+ """The URL of the screenshot image."""
@@ -0,0 +1,201 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Union
4
+ from typing_extensions import Literal, Annotated, TypeAlias
5
+
6
+ from ..._utils import PropertyInfo
7
+ from ..._models import BaseModel
8
+ from .computer_tool_call_safety_check import ComputerToolCallSafetyCheck
9
+
10
+ __all__ = [
11
+ "ComputerToolCall",
12
+ "Action",
13
+ "ActionClick",
14
+ "ActionDoubleClick",
15
+ "ActionDrag",
16
+ "ActionDragPath",
17
+ "ActionKeypress",
18
+ "ActionMove",
19
+ "ActionScreenshot",
20
+ "ActionScroll",
21
+ "ActionType",
22
+ "ActionWait",
23
+ ]
24
+
25
+
26
+ class ActionClick(BaseModel):
27
+ button: Literal["left", "right", "wheel", "back", "forward"]
28
+ """Indicates which mouse button was pressed during the click.
29
+
30
+ One of `left`, `right`, `wheel`, `back`, or `forward`.
31
+ """
32
+
33
+ type: Literal["click"]
34
+ """Specifies the event type.
35
+
36
+ For a click action, this property is always set to `click`.
37
+ """
38
+
39
+ x: int
40
+ """The x-coordinate where the click occurred."""
41
+
42
+ y: int
43
+ """The y-coordinate where the click occurred."""
44
+
45
+
46
+ class ActionDoubleClick(BaseModel):
47
+ type: Literal["double_click"]
48
+ """Specifies the event type.
49
+
50
+ For a double click action, this property is always set to `double_click`.
51
+ """
52
+
53
+ x: int
54
+ """The x-coordinate where the double click occurred."""
55
+
56
+ y: int
57
+ """The y-coordinate where the double click occurred."""
58
+
59
+
60
+ class ActionDragPath(BaseModel):
61
+ x: int
62
+ """The x-coordinate."""
63
+
64
+ y: int
65
+ """The y-coordinate."""
66
+
67
+
68
+ class ActionDrag(BaseModel):
69
+ path: List[ActionDragPath]
70
+ """An array of coordinates representing the path of the drag action.
71
+
72
+ Coordinates will appear as an array of objects, eg
73
+
74
+ ```
75
+ [
76
+ { x: 100, y: 200 },
77
+ { x: 200, y: 300 }
78
+ ]
79
+ ```
80
+ """
81
+
82
+ type: Literal["drag"]
83
+ """Specifies the event type.
84
+
85
+ For a drag action, this property is always set to `drag`.
86
+ """
87
+
88
+
89
+ class ActionKeypress(BaseModel):
90
+ keys: List[str]
91
+ """The combination of keys the model is requesting to be pressed.
92
+
93
+ This is an array of strings, each representing a key.
94
+ """
95
+
96
+ type: Literal["keypress"]
97
+ """Specifies the event type.
98
+
99
+ For a keypress action, this property is always set to `keypress`.
100
+ """
101
+
102
+
103
+ class ActionMove(BaseModel):
104
+ type: Literal["move"]
105
+ """Specifies the event type.
106
+
107
+ For a move action, this property is always set to `move`.
108
+ """
109
+
110
+ x: int
111
+ """The x-coordinate to move to."""
112
+
113
+ y: int
114
+ """The y-coordinate to move to."""
115
+
116
+
117
+ class ActionScreenshot(BaseModel):
118
+ type: Literal["screenshot"]
119
+ """Specifies the event type.
120
+
121
+ For a screenshot action, this property is always set to `screenshot`.
122
+ """
123
+
124
+
125
+ class ActionScroll(BaseModel):
126
+ scroll_x: int
127
+ """The horizontal scroll distance."""
128
+
129
+ scroll_y: int
130
+ """The vertical scroll distance."""
131
+
132
+ type: Literal["scroll"]
133
+ """Specifies the event type.
134
+
135
+ For a scroll action, this property is always set to `scroll`.
136
+ """
137
+
138
+ x: int
139
+ """The x-coordinate where the scroll occurred."""
140
+
141
+ y: int
142
+ """The y-coordinate where the scroll occurred."""
143
+
144
+
145
+ class ActionType(BaseModel):
146
+ text: str
147
+ """The text to type."""
148
+
149
+ type: Literal["type"]
150
+ """Specifies the event type.
151
+
152
+ For a type action, this property is always set to `type`.
153
+ """
154
+
155
+
156
+ class ActionWait(BaseModel):
157
+ type: Literal["wait"]
158
+ """Specifies the event type.
159
+
160
+ For a wait action, this property is always set to `wait`.
161
+ """
162
+
163
+
164
+ Action: TypeAlias = Annotated[
165
+ Union[
166
+ ActionClick,
167
+ ActionDoubleClick,
168
+ ActionDrag,
169
+ ActionKeypress,
170
+ ActionMove,
171
+ ActionScreenshot,
172
+ ActionScroll,
173
+ ActionType,
174
+ ActionWait,
175
+ ],
176
+ PropertyInfo(discriminator="type"),
177
+ ]
178
+
179
+
180
+ class ComputerToolCall(BaseModel):
181
+ id: str
182
+ """The unique ID of the computer call."""
183
+
184
+ action: Action
185
+ """A click action."""
186
+
187
+ call_id: str
188
+ """An identifier used when responding to the tool call with output."""
189
+
190
+ pending_safety_checks: List[ComputerToolCallSafetyCheck]
191
+ """The pending safety checks for the computer call."""
192
+
193
+ status: Literal["in_progress", "completed", "incomplete"]
194
+ """The status of the item.
195
+
196
+ One of `in_progress`, `completed`, or `incomplete`. Populated when items are
197
+ returned via API.
198
+ """
199
+
200
+ type: Literal["computer_call"]
201
+ """The type of the computer call. Always `computer_call`."""
@@ -0,0 +1,37 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from ..._models import BaseModel
7
+ from .computer_screenshot_image import ComputerScreenshotImage
8
+ from .computer_tool_call_safety_check import ComputerToolCallSafetyCheck
9
+
10
+ __all__ = ["ComputerToolCallOutputResource"]
11
+
12
+
13
+ class ComputerToolCallOutputResource(BaseModel):
14
+ id: str
15
+ """The unique ID of the computer call tool output."""
16
+
17
+ call_id: str
18
+ """The ID of the computer tool call that produced the output."""
19
+
20
+ output: ComputerScreenshotImage
21
+ """A computer screenshot image used with the computer use tool."""
22
+
23
+ type: Literal["computer_call_output"]
24
+ """The type of the computer tool call output. Always `computer_call_output`."""
25
+
26
+ acknowledged_safety_checks: Optional[List[ComputerToolCallSafetyCheck]] = None
27
+ """
28
+ The safety checks reported by the API that have been acknowledged by the
29
+ developer.
30
+ """
31
+
32
+ status: Optional[Literal["in_progress", "completed", "incomplete"]] = None
33
+ """The status of the message input.
34
+
35
+ One of `in_progress`, `completed`, or `incomplete`. Populated when input items
36
+ are returned via API.
37
+ """