codeset 0.4.4__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 (63) hide show
  1. codeset/__init__.py +92 -0
  2. codeset/_base_client.py +2001 -0
  3. codeset/_client.py +572 -0
  4. codeset/_compat.py +219 -0
  5. codeset/_constants.py +14 -0
  6. codeset/_exceptions.py +108 -0
  7. codeset/_files.py +123 -0
  8. codeset/_models.py +857 -0
  9. codeset/_qs.py +150 -0
  10. codeset/_resource.py +43 -0
  11. codeset/_response.py +830 -0
  12. codeset/_streaming.py +333 -0
  13. codeset/_types.py +261 -0
  14. codeset/_utils/__init__.py +66 -0
  15. codeset/_utils/_compat.py +45 -0
  16. codeset/_utils/_datetime_parse.py +136 -0
  17. codeset/_utils/_logs.py +25 -0
  18. codeset/_utils/_proxy.py +65 -0
  19. codeset/_utils/_reflection.py +42 -0
  20. codeset/_utils/_resources_proxy.py +24 -0
  21. codeset/_utils/_streams.py +12 -0
  22. codeset/_utils/_sync.py +58 -0
  23. codeset/_utils/_transform.py +457 -0
  24. codeset/_utils/_typing.py +156 -0
  25. codeset/_utils/_utils.py +474 -0
  26. codeset/_version.py +4 -0
  27. codeset/lib/.keep +4 -0
  28. codeset/py.typed +0 -0
  29. codeset/resources/__init__.py +61 -0
  30. codeset/resources/datasets.py +135 -0
  31. codeset/resources/health.py +135 -0
  32. codeset/resources/samples.py +303 -0
  33. codeset/resources/sessions/__init__.py +33 -0
  34. codeset/resources/sessions/sessions.py +891 -0
  35. codeset/resources/sessions/verify.py +335 -0
  36. codeset/types/__init__.py +22 -0
  37. codeset/types/container_info.py +32 -0
  38. codeset/types/dataset_list_response.py +28 -0
  39. codeset/types/error_info.py +15 -0
  40. codeset/types/health_check_response.py +21 -0
  41. codeset/types/interaction.py +37 -0
  42. codeset/types/interaction_status.py +7 -0
  43. codeset/types/sample_download_params.py +14 -0
  44. codeset/types/sample_list_params.py +22 -0
  45. codeset/types/sample_list_response.py +95 -0
  46. codeset/types/session.py +48 -0
  47. codeset/types/session_close_response.py +15 -0
  48. codeset/types/session_create_params.py +18 -0
  49. codeset/types/session_create_response.py +21 -0
  50. codeset/types/session_execute_command_params.py +15 -0
  51. codeset/types/session_execute_command_response.py +15 -0
  52. codeset/types/session_list_response.py +20 -0
  53. codeset/types/session_status.py +7 -0
  54. codeset/types/session_str_replace_params.py +18 -0
  55. codeset/types/session_str_replace_response.py +15 -0
  56. codeset/types/sessions/__init__.py +7 -0
  57. codeset/types/sessions/job_status.py +7 -0
  58. codeset/types/sessions/verify_start_response.py +21 -0
  59. codeset/types/sessions/verify_status_response.py +79 -0
  60. codeset-0.4.4.dist-info/METADATA +399 -0
  61. codeset-0.4.4.dist-info/RECORD +63 -0
  62. codeset-0.4.4.dist-info/WHEEL +4 -0
  63. codeset-0.4.4.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,335 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import time
6
+
7
+ import httpx
8
+
9
+ from ..._types import Body, Query, Headers, NotGiven, not_given
10
+ from ..._utils import check_timeout, get_remaining_timeout
11
+ from ..._compat import cached_property
12
+ from ..._resource import SyncAPIResource, AsyncAPIResource
13
+ from ..._response import (
14
+ to_raw_response_wrapper,
15
+ to_streamed_response_wrapper,
16
+ async_to_raw_response_wrapper,
17
+ async_to_streamed_response_wrapper,
18
+ )
19
+ from ..._base_client import make_request_options
20
+ from ...types.sessions.verify_start_response import VerifyStartResponse
21
+ from ...types.sessions.verify_status_response import VerifyStatusResponse
22
+
23
+ __all__ = ["VerifyResource", "AsyncVerifyResource"]
24
+
25
+
26
+ class VerifyResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> VerifyResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/codeset-ai/codeset-sdk#accessing-raw-response-data-eg-headers
34
+ """
35
+ return VerifyResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> VerifyResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/codeset-ai/codeset-sdk#with_streaming_response
43
+ """
44
+ return VerifyResourceWithStreamingResponse(self)
45
+
46
+ def start(
47
+ self,
48
+ session_id: str,
49
+ *,
50
+ poll_interval: float = 3.0,
51
+ wait_for_completion: bool = True,
52
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
53
+ # The extra values given here take precedence over values defined on the client or passed to this method.
54
+ extra_headers: Headers | None = None,
55
+ extra_query: Query | None = None,
56
+ extra_body: Body | None = None,
57
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
58
+ ) -> VerifyStatusResponse:
59
+ """
60
+ Start verification (oracle) in a session - async
61
+
62
+ Args:
63
+ poll_interval: Interval in seconds between polling attempts while waiting for verification to complete (default: 3.0).
64
+
65
+ wait_for_completion: Whether to poll until the verification is completed (default: True). If False, returns the current status immediately after creation.
66
+
67
+ extra_headers: Send extra headers
68
+
69
+ extra_query: Add additional query parameters to the request
70
+
71
+ extra_body: Add additional JSON properties to the request
72
+
73
+ timeout: Override the client-level default timeout for this request, in seconds
74
+ """
75
+ if not session_id:
76
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
77
+ start_time = time.time()
78
+
79
+ check_timeout(timeout, start_time)
80
+ response = self._post(
81
+ f"/sessions/{session_id}/verify",
82
+ options=make_request_options(
83
+ extra_headers=extra_headers,
84
+ extra_query=extra_query,
85
+ extra_body=extra_body,
86
+ timeout=get_remaining_timeout(timeout, start_time),
87
+ ),
88
+ cast_to=VerifyStartResponse,
89
+ )
90
+
91
+ check_timeout(timeout, start_time)
92
+ status_response = self.status(
93
+ response.job_id,
94
+ session_id=session_id,
95
+ extra_headers=extra_headers,
96
+ extra_query=extra_query,
97
+ extra_body=extra_body,
98
+ timeout=get_remaining_timeout(timeout, start_time),
99
+ )
100
+
101
+ if not wait_for_completion:
102
+ return status_response
103
+
104
+ while status_response.status != "completed":
105
+ if status_response.status in ("error", "cancelled"):
106
+ return status_response
107
+ check_timeout(timeout, start_time)
108
+ self._sleep(poll_interval)
109
+ check_timeout(timeout, start_time)
110
+ status_response = self.status(
111
+ response.job_id,
112
+ session_id=session_id,
113
+ extra_headers=extra_headers,
114
+ extra_query=extra_query,
115
+ extra_body=extra_body,
116
+ timeout=get_remaining_timeout(timeout, start_time),
117
+ )
118
+
119
+ return status_response
120
+
121
+ def status(
122
+ self,
123
+ job_id: str,
124
+ *,
125
+ session_id: str,
126
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
127
+ # The extra values given here take precedence over values defined on the client or passed to this method.
128
+ extra_headers: Headers | None = None,
129
+ extra_query: Query | None = None,
130
+ extra_body: Body | None = None,
131
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
132
+ ) -> VerifyStatusResponse:
133
+ """
134
+ Get a verification job, including the result if it's completed
135
+
136
+ Args:
137
+ extra_headers: Send extra headers
138
+
139
+ extra_query: Add additional query parameters to the request
140
+
141
+ extra_body: Add additional JSON properties to the request
142
+
143
+ timeout: Override the client-level default timeout for this request, in seconds
144
+ """
145
+ if not session_id:
146
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
147
+ if not job_id:
148
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
149
+ return self._get(
150
+ f"/sessions/{session_id}/verify/{job_id}",
151
+ options=make_request_options(
152
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
153
+ ),
154
+ cast_to=VerifyStatusResponse,
155
+ )
156
+
157
+
158
+ class AsyncVerifyResource(AsyncAPIResource):
159
+ @cached_property
160
+ def with_raw_response(self) -> AsyncVerifyResourceWithRawResponse:
161
+ """
162
+ This property can be used as a prefix for any HTTP method call to return
163
+ the raw response object instead of the parsed content.
164
+
165
+ For more information, see https://www.github.com/codeset-ai/codeset-sdk#accessing-raw-response-data-eg-headers
166
+ """
167
+ return AsyncVerifyResourceWithRawResponse(self)
168
+
169
+ @cached_property
170
+ def with_streaming_response(self) -> AsyncVerifyResourceWithStreamingResponse:
171
+ """
172
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
173
+
174
+ For more information, see https://www.github.com/codeset-ai/codeset-sdk#with_streaming_response
175
+ """
176
+ return AsyncVerifyResourceWithStreamingResponse(self)
177
+
178
+ async def start(
179
+ self,
180
+ session_id: str,
181
+ *,
182
+ poll_interval: float = 3.0,
183
+ wait_for_completion: bool = True,
184
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
185
+ # The extra values given here take precedence over values defined on the client or passed to this method.
186
+ extra_headers: Headers | None = None,
187
+ extra_query: Query | None = None,
188
+ extra_body: Body | None = None,
189
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
190
+ ) -> VerifyStatusResponse:
191
+ """
192
+ Start verification (oracle) in a session - async
193
+
194
+ Args:
195
+ poll_interval: Interval in seconds between polling attempts while waiting for verification to complete (default: 3.0).
196
+
197
+ wait_for_completion: Whether to poll until the verification is completed (default: True). If False, returns the current status immediately after creation.
198
+
199
+ extra_headers: Send extra headers
200
+
201
+ extra_query: Add additional query parameters to the request
202
+
203
+ extra_body: Add additional JSON properties to the request
204
+
205
+ timeout: Override the client-level default timeout for this request, in seconds
206
+ """
207
+ if not session_id:
208
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
209
+ start_time = time.time()
210
+
211
+ check_timeout(timeout, start_time)
212
+ response = await self._post(
213
+ f"/sessions/{session_id}/verify",
214
+ options=make_request_options(
215
+ extra_headers=extra_headers,
216
+ extra_query=extra_query,
217
+ extra_body=extra_body,
218
+ timeout=get_remaining_timeout(timeout, start_time),
219
+ ),
220
+ cast_to=VerifyStartResponse,
221
+ )
222
+
223
+ check_timeout(timeout, start_time)
224
+ status_response = await self.status(
225
+ response.job_id,
226
+ session_id=session_id,
227
+ extra_headers=extra_headers,
228
+ extra_query=extra_query,
229
+ extra_body=extra_body,
230
+ timeout=get_remaining_timeout(timeout, start_time),
231
+ )
232
+
233
+ if not wait_for_completion:
234
+ return status_response
235
+
236
+ while status_response.status != "completed":
237
+ if status_response.status in ("error", "cancelled"):
238
+ return status_response
239
+ check_timeout(timeout, start_time)
240
+ await self._sleep(poll_interval)
241
+ check_timeout(timeout, start_time)
242
+ status_response = await self.status(
243
+ response.job_id,
244
+ session_id=session_id,
245
+ extra_headers=extra_headers,
246
+ extra_query=extra_query,
247
+ extra_body=extra_body,
248
+ timeout=get_remaining_timeout(timeout, start_time),
249
+ )
250
+
251
+ return status_response
252
+
253
+ async def status(
254
+ self,
255
+ job_id: str,
256
+ *,
257
+ session_id: str,
258
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
259
+ # The extra values given here take precedence over values defined on the client or passed to this method.
260
+ extra_headers: Headers | None = None,
261
+ extra_query: Query | None = None,
262
+ extra_body: Body | None = None,
263
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
264
+ ) -> VerifyStatusResponse:
265
+ """
266
+ Get a verification job, including the result if it's completed
267
+
268
+ Args:
269
+ extra_headers: Send extra headers
270
+
271
+ extra_query: Add additional query parameters to the request
272
+
273
+ extra_body: Add additional JSON properties to the request
274
+
275
+ timeout: Override the client-level default timeout for this request, in seconds
276
+ """
277
+ if not session_id:
278
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
279
+ if not job_id:
280
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
281
+ return await self._get(
282
+ f"/sessions/{session_id}/verify/{job_id}",
283
+ options=make_request_options(
284
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
285
+ ),
286
+ cast_to=VerifyStatusResponse,
287
+ )
288
+
289
+
290
+ class VerifyResourceWithRawResponse:
291
+ def __init__(self, verify: VerifyResource) -> None:
292
+ self._verify = verify
293
+
294
+ self.start = to_raw_response_wrapper(
295
+ verify.start,
296
+ )
297
+ self.status = to_raw_response_wrapper(
298
+ verify.status,
299
+ )
300
+
301
+
302
+ class AsyncVerifyResourceWithRawResponse:
303
+ def __init__(self, verify: AsyncVerifyResource) -> None:
304
+ self._verify = verify
305
+
306
+ self.start = async_to_raw_response_wrapper(
307
+ verify.start,
308
+ )
309
+ self.status = async_to_raw_response_wrapper(
310
+ verify.status,
311
+ )
312
+
313
+
314
+ class VerifyResourceWithStreamingResponse:
315
+ def __init__(self, verify: VerifyResource) -> None:
316
+ self._verify = verify
317
+
318
+ self.start = to_streamed_response_wrapper(
319
+ verify.start,
320
+ )
321
+ self.status = to_streamed_response_wrapper(
322
+ verify.status,
323
+ )
324
+
325
+
326
+ class AsyncVerifyResourceWithStreamingResponse:
327
+ def __init__(self, verify: AsyncVerifyResource) -> None:
328
+ self._verify = verify
329
+
330
+ self.start = async_to_streamed_response_wrapper(
331
+ verify.start,
332
+ )
333
+ self.status = async_to_streamed_response_wrapper(
334
+ verify.status,
335
+ )
@@ -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 .session import Session as Session
6
+ from .error_info import ErrorInfo as ErrorInfo
7
+ from .interaction import Interaction as Interaction
8
+ from .container_info import ContainerInfo as ContainerInfo
9
+ from .session_status import SessionStatus as SessionStatus
10
+ from .sample_list_params import SampleListParams as SampleListParams
11
+ from .sample_list_response import SampleListResponse as SampleListResponse
12
+ from .dataset_list_response import DatasetListResponse as DatasetListResponse
13
+ from .health_check_response import HealthCheckResponse as HealthCheckResponse
14
+ from .session_create_params import SessionCreateParams as SessionCreateParams
15
+ from .session_list_response import SessionListResponse as SessionListResponse
16
+ from .sample_download_params import SampleDownloadParams as SampleDownloadParams
17
+ from .session_close_response import SessionCloseResponse as SessionCloseResponse
18
+ from .session_create_response import SessionCreateResponse as SessionCreateResponse
19
+ from .session_str_replace_params import SessionStrReplaceParams as SessionStrReplaceParams
20
+ from .session_str_replace_response import SessionStrReplaceResponse as SessionStrReplaceResponse
21
+ from .session_execute_command_params import SessionExecuteCommandParams as SessionExecuteCommandParams
22
+ from .session_execute_command_response import SessionExecuteCommandResponse as SessionExecuteCommandResponse
@@ -0,0 +1,32 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["ContainerInfo"]
8
+
9
+
10
+ class ContainerInfo(BaseModel):
11
+ """Information about a container."""
12
+
13
+ container_name: str
14
+ """Name of the Cloud Run service."""
15
+
16
+ created_at: datetime
17
+ """Timestamp when the container was created (UTC)."""
18
+
19
+ expires_at: datetime
20
+ """Timestamp when the container will expire (UTC)."""
21
+
22
+ location: str
23
+ """Cloud Run region where the container is deployed (e.g., 'europe-west1')."""
24
+
25
+ sample_id: str
26
+ """Sample ID of the container."""
27
+
28
+ service_url: str
29
+ """URL of the Cloud Run service."""
30
+
31
+ status: str
32
+ """Status of the container."""
@@ -0,0 +1,28 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import TypeAlias
6
+
7
+ from .._models import BaseModel
8
+
9
+ __all__ = ["DatasetListResponse", "DatasetListResponseItem"]
10
+
11
+
12
+ class DatasetListResponseItem(BaseModel):
13
+ """Information about a dataset."""
14
+
15
+ name: str
16
+ """Unique name of the dataset."""
17
+
18
+ sample_count: int
19
+ """Number of samples in the dataset."""
20
+
21
+ created_at: Optional[datetime] = None
22
+ """Timestamp when the dataset was first created (UTC)."""
23
+
24
+ description: Optional[str] = None
25
+ """A brief description of the dataset."""
26
+
27
+
28
+ DatasetListResponse: TypeAlias = List[DatasetListResponseItem]
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .._models import BaseModel
4
+
5
+ __all__ = ["ErrorInfo"]
6
+
7
+
8
+ class ErrorInfo(BaseModel):
9
+ """Details about an error that occurred during job processing."""
10
+
11
+ code: str
12
+ """A unique error code for programmatic handling."""
13
+
14
+ message: str
15
+ """A human-readable error message."""
@@ -0,0 +1,21 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .._models import BaseModel
4
+
5
+ __all__ = ["HealthCheckResponse"]
6
+
7
+
8
+ class HealthCheckResponse(BaseModel):
9
+ """Response model for health check endpoint."""
10
+
11
+ service: str
12
+ """Name of the service"""
13
+
14
+ status: str
15
+ """Health status of the service"""
16
+
17
+ timestamp: str
18
+ """Timestamp when the health check was performed (ISO format)"""
19
+
20
+ version: str
21
+ """Version of the service"""
@@ -0,0 +1,37 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+
6
+ from .._models import BaseModel
7
+
8
+ __all__ = ["Interaction"]
9
+
10
+
11
+ class Interaction(BaseModel):
12
+ interaction_id: str
13
+ """Unique identifier for the interaction."""
14
+
15
+ session_id: str
16
+ """Session identifier for this interaction."""
17
+
18
+ created_at: datetime
19
+ """Timestamp when the interaction was created (UTC)."""
20
+
21
+ exit_code: Optional[int] = None
22
+ """Exit code of the executed command (if completed)."""
23
+
24
+ stdout: Optional[str] = None
25
+ """Standard output from the command (if completed)."""
26
+
27
+ stderr: Optional[str] = None
28
+ """Standard error from the command (if completed)."""
29
+
30
+ execution_time_seconds: Optional[float] = None
31
+ """Execution time in seconds (if completed)."""
32
+
33
+ success: Optional[bool] = None
34
+ """Whether the command execution was successful (if completed)."""
35
+
36
+ message: Optional[str] = None
37
+ """Message describing the interaction status."""
@@ -0,0 +1,7 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing_extensions import Literal, TypeAlias
4
+
5
+ __all__ = ["InteractionStatus"]
6
+
7
+ InteractionStatus: TypeAlias = Literal["pending", "completed", "error"]
@@ -0,0 +1,14 @@
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 Optional
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ __all__ = ["SampleDownloadParams"]
9
+
10
+
11
+ class SampleDownloadParams(TypedDict, total=False):
12
+ dataset: Required[str]
13
+
14
+ version: Optional[int]
@@ -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 typing import Optional
6
+ from typing_extensions import TypedDict
7
+
8
+ __all__ = ["SampleListParams"]
9
+
10
+
11
+ class SampleListParams(TypedDict, total=False):
12
+ dataset: Optional[str]
13
+ """Filter samples by dataset name"""
14
+
15
+ page: Optional[int]
16
+ """Page number (1-based). If not provided, returns all samples"""
17
+
18
+ page_size: Optional[int]
19
+ """Number of samples per page (max 100). If not provided, returns all samples"""
20
+
21
+ search: Optional[str]
22
+ """Search for samples by instance_id"""
@@ -0,0 +1,95 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from .._models import BaseModel
8
+
9
+ __all__ = ["SampleListResponse", "Sample"]
10
+
11
+
12
+ class Sample(BaseModel):
13
+ """Information about a software engineering task sample."""
14
+
15
+ base_commit: str
16
+ """Base commit hash for the sample."""
17
+
18
+ environment_setup_commit: str
19
+ """Environment setup commit hash for the sample."""
20
+
21
+ fail_to_fail: List[str]
22
+ """List of test names that remained FAIL to FAIL."""
23
+
24
+ fail_to_pass: List[str]
25
+ """List of test names that changed from FAIL to PASS."""
26
+
27
+ hints_text: str
28
+ """Hints text for the sample (concatenated issue comments)."""
29
+
30
+ instance_id: str
31
+ """Instance identifier for the sample (e.g., 'psf\\__\\__requests-1234')."""
32
+
33
+ language: str
34
+ """Primary programming language of the sample."""
35
+
36
+ non_code_patch: str
37
+ """Non-code patch for the sample."""
38
+
39
+ pass_to_pass: List[str]
40
+ """List of test names that remained PASS to PASS."""
41
+
42
+ patch: str
43
+ """Code patch (diff) that fixes the bug for the sample."""
44
+
45
+ problem_statement: str
46
+ """Problem statement for the sample (issue title + body)."""
47
+
48
+ repo: str
49
+ """Repository full name for the sample (e.g., 'psf/requests')."""
50
+
51
+ sample_id: str
52
+ """Unique identifier for the sample (e.g., 'traccar-1')."""
53
+
54
+ test_patch: str
55
+ """Test patch (diff) for the sample."""
56
+
57
+ verifier: Literal["test_suite", "static_analysis", "linter", "custom"]
58
+ """The type of verifier used for this sample."""
59
+
60
+ created_at: Optional[datetime] = None
61
+ """Timestamp when the sample was created (UTC)."""
62
+
63
+ dataset: Optional[str] = None
64
+ """Dataset name for the sample."""
65
+
66
+ description: Optional[str] = None
67
+ """A brief description of the sample."""
68
+
69
+ latest: Optional[bool] = None
70
+ """Whether this is the latest version."""
71
+
72
+ version: Optional[int] = None
73
+ """Version number of the sample."""
74
+
75
+ version_description: Optional[str] = None
76
+ """Description of this version."""
77
+
78
+
79
+ class SampleListResponse(BaseModel):
80
+ """Response for listing samples with pagination."""
81
+
82
+ has_more: bool
83
+ """Indicates if more pages of results are available."""
84
+
85
+ page: int
86
+ """Current page number (1-based)."""
87
+
88
+ page_size: int
89
+ """Number of samples per page."""
90
+
91
+ samples: List[Sample]
92
+ """List of samples for the current page."""
93
+
94
+ total_count: int
95
+ """Total number of samples available."""
@@ -0,0 +1,48 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+
6
+ from .._models import BaseModel
7
+ from .error_info import ErrorInfo
8
+ from .container_info import ContainerInfo
9
+ from .session_status import SessionStatus
10
+
11
+ __all__ = ["Session"]
12
+
13
+
14
+ class Session(BaseModel):
15
+ """Represents a session for multi-turn interactions."""
16
+
17
+ dataset: str
18
+ """Dataset name for the sample."""
19
+
20
+ expires_at: datetime
21
+ """Timestamp when the session will expire (UTC)."""
22
+
23
+ requested_at: datetime
24
+ """Timestamp when the session was requested (UTC)."""
25
+
26
+ sample_id: str
27
+ """Identifier of the sample being used for the session."""
28
+
29
+ session_id: str
30
+ """Unique identifier for the session."""
31
+
32
+ status: SessionStatus
33
+ """Current status of the session."""
34
+
35
+ user_id: str
36
+ """User ID who owns this session."""
37
+
38
+ container_info: Optional[ContainerInfo] = None
39
+ """Information about a container."""
40
+
41
+ created_at: Optional[datetime] = None
42
+ """Timestamp when the container became ready and billing started (UTC)."""
43
+
44
+ duration_seconds: Optional[float] = None
45
+ """Duration of the session in seconds."""
46
+
47
+ error: Optional[ErrorInfo] = None
48
+ """Details about an error that occurred during job processing."""