superglue-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.
Files changed (46) hide show
  1. superglue_client-0.1.0.dist-info/METADATA +153 -0
  2. superglue_client-0.1.0.dist-info/RECORD +46 -0
  3. superglue_client-0.1.0.dist-info/WHEEL +4 -0
  4. superglue_sdk/__init__.py +12 -0
  5. superglue_sdk/api/__init__.py +1 -0
  6. superglue_sdk/api/runs/__init__.py +1 -0
  7. superglue_sdk/api/runs/cancel_run.py +156 -0
  8. superglue_sdk/api/runs/get_run.py +156 -0
  9. superglue_sdk/api/runs/list_runs.py +205 -0
  10. superglue_sdk/api/tools/__init__.py +1 -0
  11. superglue_sdk/api/tools/get_tool.py +156 -0
  12. superglue_sdk/api/tools/list_tools.py +172 -0
  13. superglue_sdk/api/tools/run_tool.py +198 -0
  14. superglue_sdk/client.py +268 -0
  15. superglue_sdk/errors.py +16 -0
  16. superglue_sdk/models/__init__.py +61 -0
  17. superglue_sdk/models/error.py +67 -0
  18. superglue_sdk/models/error_error.py +61 -0
  19. superglue_sdk/models/list_runs_response_200.py +115 -0
  20. superglue_sdk/models/list_runs_status.py +11 -0
  21. superglue_sdk/models/list_tools_response_200.py +115 -0
  22. superglue_sdk/models/pagination.py +99 -0
  23. superglue_sdk/models/pagination_type.py +11 -0
  24. superglue_sdk/models/run.py +226 -0
  25. superglue_sdk/models/run_data.py +46 -0
  26. superglue_sdk/models/run_metadata.py +95 -0
  27. superglue_sdk/models/run_options.py +46 -0
  28. superglue_sdk/models/run_request.py +125 -0
  29. superglue_sdk/models/run_request_credentials.py +52 -0
  30. superglue_sdk/models/run_request_inputs.py +51 -0
  31. superglue_sdk/models/run_request_options.py +93 -0
  32. superglue_sdk/models/run_status.py +11 -0
  33. superglue_sdk/models/run_step_results_item.py +102 -0
  34. superglue_sdk/models/run_step_results_item_data.py +46 -0
  35. superglue_sdk/models/run_tool.py +73 -0
  36. superglue_sdk/models/run_tool_payload.py +46 -0
  37. superglue_sdk/models/tool.py +196 -0
  38. superglue_sdk/models/tool_input_schema.py +52 -0
  39. superglue_sdk/models/tool_output_schema.py +46 -0
  40. superglue_sdk/models/tool_step.py +230 -0
  41. superglue_sdk/models/tool_step_failure_behavior.py +9 -0
  42. superglue_sdk/models/tool_step_headers.py +52 -0
  43. superglue_sdk/models/tool_step_method.py +14 -0
  44. superglue_sdk/models/tool_step_query_params.py +51 -0
  45. superglue_sdk/py.typed +1 -0
  46. superglue_sdk/types.py +54 -0
@@ -0,0 +1,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: superglue-client
3
+ Version: 0.1.0
4
+ Summary: Python SDK for superglue - the open-source data integration framework
5
+ License: MIT
6
+ Keywords: api,sdk,data-integration,etl,superglue
7
+ Author: superglue
8
+ Author-email: hi@superglue.cloud
9
+ Requires-Python: >=3.10,<4.0
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Dist: attrs (>=22.2.0)
22
+ Requires-Dist: httpx (>=0.23.0,<0.29.0)
23
+ Requires-Dist: python-dateutil (>=2.8.0,<3.0.0)
24
+ Project-URL: Documentation, https://docs.superglue.cloud
25
+ Project-URL: Homepage, https://superglue.ai
26
+ Project-URL: Repository, https://github.com/superglue-ai/superglue
27
+ Description-Content-Type: text/markdown
28
+
29
+ # superglue-sdk
30
+ A client library for accessing superglue AI API
31
+
32
+ ## Usage
33
+ First, create a client:
34
+
35
+ ```python
36
+ from superglue_sdk import Client
37
+
38
+ client = Client(base_url="https://api.example.com")
39
+ ```
40
+
41
+ If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
42
+
43
+ ```python
44
+ from superglue_sdk import AuthenticatedClient
45
+
46
+ client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
47
+ ```
48
+
49
+ Now call your endpoint and use your models:
50
+
51
+ ```python
52
+ from superglue_sdk.models import MyDataModel
53
+ from superglue_sdk.api.my_tag import get_my_data_model
54
+ from superglue_sdk.types import Response
55
+
56
+ with client as client:
57
+ my_data: MyDataModel = get_my_data_model.sync(client=client)
58
+ # or if you need more info (e.g. status_code)
59
+ response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
60
+ ```
61
+
62
+ Or do the same thing with an async version:
63
+
64
+ ```python
65
+ from superglue_sdk.models import MyDataModel
66
+ from superglue_sdk.api.my_tag import get_my_data_model
67
+ from superglue_sdk.types import Response
68
+
69
+ async with client as client:
70
+ my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
71
+ response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
72
+ ```
73
+
74
+ By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
75
+
76
+ ```python
77
+ client = AuthenticatedClient(
78
+ base_url="https://internal_api.example.com",
79
+ token="SuperSecretToken",
80
+ verify_ssl="/path/to/certificate_bundle.pem",
81
+ )
82
+ ```
83
+
84
+ You can also disable certificate validation altogether, but beware that **this is a security risk**.
85
+
86
+ ```python
87
+ client = AuthenticatedClient(
88
+ base_url="https://internal_api.example.com",
89
+ token="SuperSecretToken",
90
+ verify_ssl=False
91
+ )
92
+ ```
93
+
94
+ Things to know:
95
+ 1. Every path/method combo becomes a Python module with four functions:
96
+ 1. `sync`: Blocking request that returns parsed data (if successful) or `None`
97
+ 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
98
+ 1. `asyncio`: Like `sync` but async instead of blocking
99
+ 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
100
+
101
+ 1. All path/query params, and bodies become method arguments.
102
+ 1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
103
+ 1. Any endpoint which did not have a tag will be in `superglue_sdk.api.default`
104
+
105
+ ## Advanced customizations
106
+
107
+ There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
108
+
109
+ ```python
110
+ from superglue_sdk import Client
111
+
112
+ def log_request(request):
113
+ print(f"Request event hook: {request.method} {request.url} - Waiting for response")
114
+
115
+ def log_response(response):
116
+ request = response.request
117
+ print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
118
+
119
+ client = Client(
120
+ base_url="https://api.example.com",
121
+ httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
122
+ )
123
+
124
+ # Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
125
+ ```
126
+
127
+ You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
128
+
129
+ ```python
130
+ import httpx
131
+ from superglue_sdk import Client
132
+
133
+ client = Client(
134
+ base_url="https://api.example.com",
135
+ )
136
+ # Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
137
+ client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
138
+ ```
139
+
140
+ ## Building / publishing this package
141
+ This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
142
+ 1. Update the metadata in pyproject.toml (e.g. authors, version)
143
+ 1. If you're using a private repository, configure it with Poetry
144
+ 1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
145
+ 1. `poetry config http-basic.<your-repository-name> <username> <password>`
146
+ 1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
147
+
148
+ If you want to install this client into another project without publishing it (e.g. for development) then:
149
+ 1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
150
+ 1. If that project is not using Poetry:
151
+ 1. Build a wheel with `poetry build -f wheel`
152
+ 1. Install that wheel from the other project `pip install <path-to-wheel>`
153
+
@@ -0,0 +1,46 @@
1
+ superglue_sdk/__init__.py,sha256=XG1Sby3QXmLvG_AFkLnraAzjj_L1rFw5Hdf3oNMgPGM,243
2
+ superglue_sdk/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
3
+ superglue_sdk/api/runs/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
4
+ superglue_sdk/api/runs/cancel_run.py,sha256=2L0TCXk7735EPxeRtUhLVk4gb4VgPBBnDi1zWF7U8Rw,3687
5
+ superglue_sdk/api/runs/get_run.py,sha256=dyNkVSkd8KDG8MDoqrgzu55USju_sIwHVKNJf4rPx3k,3687
6
+ superglue_sdk/api/runs/list_runs.py,sha256=vMMM9kxMVfjFAoyMxeACyj_6l8go0kqoz6B2Ka1dwzc,5382
7
+ superglue_sdk/api/tools/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
8
+ superglue_sdk/api/tools/get_tool.py,sha256=kMWwlpyns369HEzP3z46gLyyEico62yfEHvJpNVaqJc,3729
9
+ superglue_sdk/api/tools/list_tools.py,sha256=6ERMS-XWqRFCsQh9_Ul8-rlamW7tXlH3lJfLVCwv_cg,4295
10
+ superglue_sdk/api/tools/run_tool.py,sha256=-YTf9x7GLne3FTBqhD22u1AfDOBlnEMv5DStCgsLxn0,4688
11
+ superglue_sdk/client.py,sha256=-rT3epMc77Y7QMTy5o1oH5hkGLufY9qFrD1rb7qItFU,12384
12
+ superglue_sdk/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
13
+ superglue_sdk/models/__init__.py,sha256=KtSAnYIaa4_sthqEvKp7rxoOMtC46XCyXJVYMtAfpOQ,1877
14
+ superglue_sdk/models/error.py,sha256=PPr5UleRjovupH6jqGjQPYCZNnmipDXw5NETiEH5iKU,1632
15
+ superglue_sdk/models/error_error.py,sha256=keirj_yLp4Z4AXWNoKkBJzd3KS36EbYKEpEpkEXKq2I,1534
16
+ superglue_sdk/models/list_runs_response_200.py,sha256=U5Fw_Nv-jifj_vuYRMB4AxUQaxhXN_RtQ6_XRznEfeI,3140
17
+ superglue_sdk/models/list_runs_status.py,sha256=RYet2u_zvVMPcvR5ioOStho38viLRuwJpq5iQuIeSbY,213
18
+ superglue_sdk/models/list_tools_response_200.py,sha256=us6LtKLx1vlocyHorqkONsnIf5y5-8s_Hc2CpKzFYLI,3153
19
+ superglue_sdk/models/pagination.py,sha256=apMiIcj57obbkuDAIYkI66N1MIMbUGL5p9Cu1jAJhHY,3317
20
+ superglue_sdk/models/pagination_type.py,sha256=gf1nLP-uGxUQA9s1F1sk6SDN1Ml50B8zxbSsBPt_Wyw,237
21
+ superglue_sdk/models/run.py,sha256=vvsxBt98oIwC2ueTKibipp-z5UB6Wkn4-McUQ5wEomM,7806
22
+ superglue_sdk/models/run_data.py,sha256=Fwb0TILhwNn55gz3Lb55u4psPv9UAlf64r3SZu6AbhE,1308
23
+ superglue_sdk/models/run_metadata.py,sha256=nJY0xDi7KdWQpqT4W296kyNKg50r6PwFZiOafPiBi5Y,2972
24
+ superglue_sdk/models/run_options.py,sha256=4Eb7aPQnVTtHYfAcNEH3x1kCzQ0soVPeUlxZU7OruXU,1275
25
+ superglue_sdk/models/run_request.py,sha256=WWFTuDKELTSyHS_-G-KiH0JrJxIuCiICf54WJLGBP9A,4344
26
+ superglue_sdk/models/run_request_credentials.py,sha256=7qghLFcctroMnRTUbDbjm9QD8u9OX7TrBYDm7pZM3N0,1557
27
+ superglue_sdk/models/run_request_inputs.py,sha256=uOZSie5namK6lkFuMgtXPwunFhrhmviMTv82N3d-lNI,1366
28
+ superglue_sdk/models/run_request_options.py,sha256=bwIodF7RJ2pbaDp3XpMbzQwYWGhvCb_zhC6VtiVPewE,2983
29
+ superglue_sdk/models/run_status.py,sha256=5JnCr4mwqr9Rij7zUJnGBRCElXIDnQgnAmfC9i6iYik,208
30
+ superglue_sdk/models/run_step_results_item.py,sha256=qH7ZV0QILFgOxJ1YByD9l76dSQhXBt0JCPRzv7Hn_2I,2828
31
+ superglue_sdk/models/run_step_results_item_data.py,sha256=stnEROwpKa0KrK0AU_Zu5uXbpFkLNSaKAeUQF54ChW0,1325
32
+ superglue_sdk/models/run_tool.py,sha256=9hhVnpyItFjb9o6BzCKRWmtyBW6NnPvgMUrorSGqotw,1801
33
+ superglue_sdk/models/run_tool_payload.py,sha256=mvoOs33vb67QwQEv2E85EBiO7upltlnDJ5NUcuC72Rs,1341
34
+ superglue_sdk/models/tool.py,sha256=nlB5dZf6DD6EsN9i6DbE7bhAELE1COiJ1KdKsKMD2HE,6776
35
+ superglue_sdk/models/tool_input_schema.py,sha256=Njqt43krP6ow__ywO9XjVARfTf8gVCMPLE4xs2k33hY,1462
36
+ superglue_sdk/models/tool_output_schema.py,sha256=8_qGzDuiu7Q01CK2EWPDHCJ3daMVMagrYrSamv3qDp4,1323
37
+ superglue_sdk/models/tool_step.py,sha256=wRojnCiGQKzxTrZE-2XNVBOiLsplYGqpnpUmHFeEITU,8972
38
+ superglue_sdk/models/tool_step_failure_behavior.py,sha256=0ESefrKrBK_zBIvX9UgbXIjNOBWJ_pC7Ahd5p-HxAig,172
39
+ superglue_sdk/models/tool_step_headers.py,sha256=NKqXvymXPvZLtoCVuvYScp99iuNxS9C6o3OuDN3yuLY,1504
40
+ superglue_sdk/models/tool_step_method.py,sha256=vFDNEYX5JwBTZJpGv8_sv4-gfzUEqImO-bLvUYyT3Yg,253
41
+ superglue_sdk/models/tool_step_query_params.py,sha256=eJXluJ22snbqmHD5leefFpy46n_Q2yHG1v3r90lYmfk,1468
42
+ superglue_sdk/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
43
+ superglue_sdk/types.py,sha256=0We4NPvhIYASRpQ3le41nmJeEAVm42-2VKdzlJ4Ogok,1343
44
+ superglue_client-0.1.0.dist-info/METADATA,sha256=3ZEQMQFyiSvGYUfD-71mosZpZKJFNtCtFkWl9gHB5mU,6154
45
+ superglue_client-0.1.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
46
+ superglue_client-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.2.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,12 @@
1
+ """A client library for accessing superglue AI API"""
2
+
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ # Alias for better DX
6
+ SuperglueClient = AuthenticatedClient
7
+
8
+ __all__ = (
9
+ "SuperglueClient",
10
+ "AuthenticatedClient",
11
+ "Client",
12
+ )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,156 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.error import Error
10
+ from ...models.run import Run
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ run_id: str,
16
+ ) -> dict[str, Any]:
17
+ _kwargs: dict[str, Any] = {
18
+ "method": "post",
19
+ "url": "/runs/{run_id}/cancel".format(
20
+ run_id=quote(str(run_id), safe=""),
21
+ ),
22
+ }
23
+
24
+ return _kwargs
25
+
26
+
27
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Run | None:
28
+ if response.status_code == 200:
29
+ response_200 = Run.from_dict(response.json())
30
+
31
+ return response_200
32
+
33
+ if response.status_code == 400:
34
+ response_400 = Error.from_dict(response.json())
35
+
36
+ return response_400
37
+
38
+ if client.raise_on_unexpected_status:
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+ else:
41
+ return None
42
+
43
+
44
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | Run]:
45
+ return Response(
46
+ status_code=HTTPStatus(response.status_code),
47
+ content=response.content,
48
+ headers=response.headers,
49
+ parsed=_parse_response(client=client, response=response),
50
+ )
51
+
52
+
53
+ def sync_detailed(
54
+ run_id: str,
55
+ *,
56
+ client: AuthenticatedClient | Client,
57
+ ) -> Response[Error | Run]:
58
+ """Cancel a run
59
+
60
+ Args:
61
+ run_id (str):
62
+
63
+ Raises:
64
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
65
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
66
+
67
+ Returns:
68
+ Response[Error | Run]
69
+ """
70
+
71
+ kwargs = _get_kwargs(
72
+ run_id=run_id,
73
+ )
74
+
75
+ response = client.get_httpx_client().request(
76
+ **kwargs,
77
+ )
78
+
79
+ return _build_response(client=client, response=response)
80
+
81
+
82
+ def sync(
83
+ run_id: str,
84
+ *,
85
+ client: AuthenticatedClient | Client,
86
+ ) -> Error | Run | None:
87
+ """Cancel a run
88
+
89
+ Args:
90
+ run_id (str):
91
+
92
+ Raises:
93
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
95
+
96
+ Returns:
97
+ Error | Run
98
+ """
99
+
100
+ return sync_detailed(
101
+ run_id=run_id,
102
+ client=client,
103
+ ).parsed
104
+
105
+
106
+ async def asyncio_detailed(
107
+ run_id: str,
108
+ *,
109
+ client: AuthenticatedClient | Client,
110
+ ) -> Response[Error | Run]:
111
+ """Cancel a run
112
+
113
+ Args:
114
+ run_id (str):
115
+
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ Response[Error | Run]
122
+ """
123
+
124
+ kwargs = _get_kwargs(
125
+ run_id=run_id,
126
+ )
127
+
128
+ response = await client.get_async_httpx_client().request(**kwargs)
129
+
130
+ return _build_response(client=client, response=response)
131
+
132
+
133
+ async def asyncio(
134
+ run_id: str,
135
+ *,
136
+ client: AuthenticatedClient | Client,
137
+ ) -> Error | Run | None:
138
+ """Cancel a run
139
+
140
+ Args:
141
+ run_id (str):
142
+
143
+ Raises:
144
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
145
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
146
+
147
+ Returns:
148
+ Error | Run
149
+ """
150
+
151
+ return (
152
+ await asyncio_detailed(
153
+ run_id=run_id,
154
+ client=client,
155
+ )
156
+ ).parsed
@@ -0,0 +1,156 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.error import Error
10
+ from ...models.run import Run
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ run_id: str,
16
+ ) -> dict[str, Any]:
17
+ _kwargs: dict[str, Any] = {
18
+ "method": "get",
19
+ "url": "/runs/{run_id}".format(
20
+ run_id=quote(str(run_id), safe=""),
21
+ ),
22
+ }
23
+
24
+ return _kwargs
25
+
26
+
27
+ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Run | None:
28
+ if response.status_code == 200:
29
+ response_200 = Run.from_dict(response.json())
30
+
31
+ return response_200
32
+
33
+ if response.status_code == 404:
34
+ response_404 = Error.from_dict(response.json())
35
+
36
+ return response_404
37
+
38
+ if client.raise_on_unexpected_status:
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+ else:
41
+ return None
42
+
43
+
44
+ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | Run]:
45
+ return Response(
46
+ status_code=HTTPStatus(response.status_code),
47
+ content=response.content,
48
+ headers=response.headers,
49
+ parsed=_parse_response(client=client, response=response),
50
+ )
51
+
52
+
53
+ def sync_detailed(
54
+ run_id: str,
55
+ *,
56
+ client: AuthenticatedClient | Client,
57
+ ) -> Response[Error | Run]:
58
+ """Get run status
59
+
60
+ Args:
61
+ run_id (str):
62
+
63
+ Raises:
64
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
65
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
66
+
67
+ Returns:
68
+ Response[Error | Run]
69
+ """
70
+
71
+ kwargs = _get_kwargs(
72
+ run_id=run_id,
73
+ )
74
+
75
+ response = client.get_httpx_client().request(
76
+ **kwargs,
77
+ )
78
+
79
+ return _build_response(client=client, response=response)
80
+
81
+
82
+ def sync(
83
+ run_id: str,
84
+ *,
85
+ client: AuthenticatedClient | Client,
86
+ ) -> Error | Run | None:
87
+ """Get run status
88
+
89
+ Args:
90
+ run_id (str):
91
+
92
+ Raises:
93
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
95
+
96
+ Returns:
97
+ Error | Run
98
+ """
99
+
100
+ return sync_detailed(
101
+ run_id=run_id,
102
+ client=client,
103
+ ).parsed
104
+
105
+
106
+ async def asyncio_detailed(
107
+ run_id: str,
108
+ *,
109
+ client: AuthenticatedClient | Client,
110
+ ) -> Response[Error | Run]:
111
+ """Get run status
112
+
113
+ Args:
114
+ run_id (str):
115
+
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ Response[Error | Run]
122
+ """
123
+
124
+ kwargs = _get_kwargs(
125
+ run_id=run_id,
126
+ )
127
+
128
+ response = await client.get_async_httpx_client().request(**kwargs)
129
+
130
+ return _build_response(client=client, response=response)
131
+
132
+
133
+ async def asyncio(
134
+ run_id: str,
135
+ *,
136
+ client: AuthenticatedClient | Client,
137
+ ) -> Error | Run | None:
138
+ """Get run status
139
+
140
+ Args:
141
+ run_id (str):
142
+
143
+ Raises:
144
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
145
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
146
+
147
+ Returns:
148
+ Error | Run
149
+ """
150
+
151
+ return (
152
+ await asyncio_detailed(
153
+ run_id=run_id,
154
+ client=client,
155
+ )
156
+ ).parsed