scale-gp-beta 0.1.0a29__py3-none-any.whl → 0.1.0a31__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 (61) hide show
  1. scale_gp_beta/_base_client.py +7 -4
  2. scale_gp_beta/_client.py +17 -8
  3. scale_gp_beta/_compat.py +48 -48
  4. scale_gp_beta/_files.py +4 -4
  5. scale_gp_beta/_models.py +63 -42
  6. scale_gp_beta/_types.py +35 -1
  7. scale_gp_beta/_utils/__init__.py +9 -2
  8. scale_gp_beta/_utils/_compat.py +45 -0
  9. scale_gp_beta/_utils/_datetime_parse.py +136 -0
  10. scale_gp_beta/_utils/_transform.py +11 -1
  11. scale_gp_beta/_utils/_typing.py +6 -1
  12. scale_gp_beta/_utils/_utils.py +0 -1
  13. scale_gp_beta/_version.py +1 -1
  14. scale_gp_beta/lib/CONTRIBUTING.MD +53 -0
  15. scale_gp_beta/lib/tracing/trace_queue_manager.py +14 -0
  16. scale_gp_beta/resources/__init__.py +20 -6
  17. scale_gp_beta/resources/chat/completions.py +22 -18
  18. scale_gp_beta/resources/completions.py +18 -18
  19. scale_gp_beta/resources/datasets.py +8 -8
  20. scale_gp_beta/resources/evaluations.py +35 -13
  21. scale_gp_beta/resources/responses.py +314 -0
  22. scale_gp_beta/resources/spans.py +25 -33
  23. scale_gp_beta/types/__init__.py +17 -0
  24. scale_gp_beta/types/chat/chat_completion.py +61 -6
  25. scale_gp_beta/types/chat/chat_completion_chunk.py +17 -1
  26. scale_gp_beta/types/chat/completion_create_params.py +5 -3
  27. scale_gp_beta/types/chat/completion_models_params.py +2 -0
  28. scale_gp_beta/types/chat/model_definition.py +6 -0
  29. scale_gp_beta/types/completion.py +8 -0
  30. scale_gp_beta/types/completion_create_params.py +5 -3
  31. scale_gp_beta/types/container.py +2 -8
  32. scale_gp_beta/types/container_param.py +2 -2
  33. scale_gp_beta/types/dataset.py +3 -1
  34. scale_gp_beta/types/dataset_create_params.py +4 -2
  35. scale_gp_beta/types/dataset_item.py +3 -1
  36. scale_gp_beta/types/dataset_list_params.py +3 -2
  37. scale_gp_beta/types/dataset_update_params.py +3 -2
  38. scale_gp_beta/types/evaluation.py +7 -8
  39. scale_gp_beta/types/evaluation_create_params.py +17 -6
  40. scale_gp_beta/types/evaluation_item.py +3 -1
  41. scale_gp_beta/types/evaluation_list_params.py +3 -1
  42. scale_gp_beta/types/evaluation_task.py +31 -55
  43. scale_gp_beta/types/evaluation_task_param.py +32 -4
  44. scale_gp_beta/types/evaluation_update_params.py +3 -2
  45. scale_gp_beta/types/file.py +3 -1
  46. scale_gp_beta/types/inference_model.py +7 -0
  47. scale_gp_beta/types/model_create_params.py +6 -4
  48. scale_gp_beta/types/model_update_params.py +6 -4
  49. scale_gp_beta/types/question.py +11 -10
  50. scale_gp_beta/types/question_create_params.py +4 -2
  51. scale_gp_beta/types/response.py +2852 -0
  52. scale_gp_beta/types/response_create_params.py +819 -0
  53. scale_gp_beta/types/response_create_response.py +20891 -0
  54. scale_gp_beta/types/shared/__init__.py +3 -0
  55. scale_gp_beta/types/shared/identity.py +16 -0
  56. scale_gp_beta/types/span.py +4 -2
  57. scale_gp_beta/types/span_search_params.py +10 -12
  58. {scale_gp_beta-0.1.0a29.dist-info → scale_gp_beta-0.1.0a31.dist-info}/METADATA +2 -3
  59. {scale_gp_beta-0.1.0a29.dist-info → scale_gp_beta-0.1.0a31.dist-info}/RECORD +61 -52
  60. {scale_gp_beta-0.1.0a29.dist-info → scale_gp_beta-0.1.0a31.dist-info}/WHEEL +0 -0
  61. {scale_gp_beta-0.1.0a29.dist-info → scale_gp_beta-0.1.0a31.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,314 @@
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 Any, Dict, Union, Iterable, cast
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ..types import response_create_params
11
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
12
+ from .._utils import maybe_transform, async_maybe_transform
13
+ from .._compat import cached_property
14
+ from .._resource import SyncAPIResource, AsyncAPIResource
15
+ from .._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .._base_client import make_request_options
22
+ from ..types.response_create_response import ResponseCreateResponse
23
+
24
+ __all__ = ["ResponsesResource", "AsyncResponsesResource"]
25
+
26
+
27
+ class ResponsesResource(SyncAPIResource):
28
+ @cached_property
29
+ def with_raw_response(self) -> ResponsesResourceWithRawResponse:
30
+ """
31
+ This property can be used as a prefix for any HTTP method call to return
32
+ the raw response object instead of the parsed content.
33
+
34
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#accessing-raw-response-data-eg-headers
35
+ """
36
+ return ResponsesResourceWithRawResponse(self)
37
+
38
+ @cached_property
39
+ def with_streaming_response(self) -> ResponsesResourceWithStreamingResponse:
40
+ """
41
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42
+
43
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#with_streaming_response
44
+ """
45
+ return ResponsesResourceWithStreamingResponse(self)
46
+
47
+ def create(
48
+ self,
49
+ *,
50
+ input: Union[str, Iterable[response_create_params.InputUnionMember1]],
51
+ model: str,
52
+ include: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
53
+ instructions: str | NotGiven = NOT_GIVEN,
54
+ max_output_tokens: int | NotGiven = NOT_GIVEN,
55
+ metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
56
+ parallel_tool_calls: bool | NotGiven = NOT_GIVEN,
57
+ previous_response_id: str | NotGiven = NOT_GIVEN,
58
+ reasoning: Dict[str, object] | NotGiven = NOT_GIVEN,
59
+ store: bool | NotGiven = NOT_GIVEN,
60
+ stream: bool | NotGiven = NOT_GIVEN,
61
+ temperature: float | NotGiven = NOT_GIVEN,
62
+ text: Dict[str, object] | NotGiven = NOT_GIVEN,
63
+ tool_choice: Union[str, Dict[str, object]] | NotGiven = NOT_GIVEN,
64
+ tools: Iterable[Dict[str, object]] | NotGiven = NOT_GIVEN,
65
+ top_p: float | NotGiven = NOT_GIVEN,
66
+ truncation: Literal["auto", "disabled"] | NotGiven = NOT_GIVEN,
67
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
68
+ # The extra values given here take precedence over values defined on the client or passed to this method.
69
+ extra_headers: Headers | None = None,
70
+ extra_query: Query | None = None,
71
+ extra_body: Body | None = None,
72
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
73
+ ) -> ResponseCreateResponse:
74
+ """
75
+ Responses
76
+
77
+ Args:
78
+ model: model specified as `model_vendor/model`, for example `openai/gpt-4o`
79
+
80
+ include: Which fields to include in the response
81
+
82
+ instructions: Instructions for the response generation
83
+
84
+ max_output_tokens: Maximum number of output tokens
85
+
86
+ metadata: Metadata for the response
87
+
88
+ parallel_tool_calls: Whether to enable parallel tool calls
89
+
90
+ previous_response_id: ID of the previous response for chaining
91
+
92
+ reasoning: Reasoning configuration for the response
93
+
94
+ store: Whether to store the response
95
+
96
+ stream: Whether to stream the response
97
+
98
+ temperature: Sampling temperature for randomness control
99
+
100
+ text: Text configuration parameters
101
+
102
+ tool_choice: Tool choice configuration
103
+
104
+ tools: Tools available for the response
105
+
106
+ top_p: Top-p sampling parameter
107
+
108
+ truncation: Truncation configuration
109
+
110
+ extra_headers: Send extra headers
111
+
112
+ extra_query: Add additional query parameters to the request
113
+
114
+ extra_body: Add additional JSON properties to the request
115
+
116
+ timeout: Override the client-level default timeout for this request, in seconds
117
+ """
118
+ return cast(
119
+ ResponseCreateResponse,
120
+ self._post(
121
+ "/v5/responses",
122
+ body=maybe_transform(
123
+ {
124
+ "input": input,
125
+ "model": model,
126
+ "include": include,
127
+ "instructions": instructions,
128
+ "max_output_tokens": max_output_tokens,
129
+ "metadata": metadata,
130
+ "parallel_tool_calls": parallel_tool_calls,
131
+ "previous_response_id": previous_response_id,
132
+ "reasoning": reasoning,
133
+ "store": store,
134
+ "stream": stream,
135
+ "temperature": temperature,
136
+ "text": text,
137
+ "tool_choice": tool_choice,
138
+ "tools": tools,
139
+ "top_p": top_p,
140
+ "truncation": truncation,
141
+ },
142
+ response_create_params.ResponseCreateParams,
143
+ ),
144
+ options=make_request_options(
145
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
146
+ ),
147
+ cast_to=cast(
148
+ Any, ResponseCreateResponse
149
+ ), # Union types cannot be passed in as arguments in the type system
150
+ ),
151
+ )
152
+
153
+
154
+ class AsyncResponsesResource(AsyncAPIResource):
155
+ @cached_property
156
+ def with_raw_response(self) -> AsyncResponsesResourceWithRawResponse:
157
+ """
158
+ This property can be used as a prefix for any HTTP method call to return
159
+ the raw response object instead of the parsed content.
160
+
161
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#accessing-raw-response-data-eg-headers
162
+ """
163
+ return AsyncResponsesResourceWithRawResponse(self)
164
+
165
+ @cached_property
166
+ def with_streaming_response(self) -> AsyncResponsesResourceWithStreamingResponse:
167
+ """
168
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
169
+
170
+ For more information, see https://www.github.com/scaleapi/sgp-python-beta#with_streaming_response
171
+ """
172
+ return AsyncResponsesResourceWithStreamingResponse(self)
173
+
174
+ async def create(
175
+ self,
176
+ *,
177
+ input: Union[str, Iterable[response_create_params.InputUnionMember1]],
178
+ model: str,
179
+ include: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
180
+ instructions: str | NotGiven = NOT_GIVEN,
181
+ max_output_tokens: int | NotGiven = NOT_GIVEN,
182
+ metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
183
+ parallel_tool_calls: bool | NotGiven = NOT_GIVEN,
184
+ previous_response_id: str | NotGiven = NOT_GIVEN,
185
+ reasoning: Dict[str, object] | NotGiven = NOT_GIVEN,
186
+ store: bool | NotGiven = NOT_GIVEN,
187
+ stream: bool | NotGiven = NOT_GIVEN,
188
+ temperature: float | NotGiven = NOT_GIVEN,
189
+ text: Dict[str, object] | NotGiven = NOT_GIVEN,
190
+ tool_choice: Union[str, Dict[str, object]] | NotGiven = NOT_GIVEN,
191
+ tools: Iterable[Dict[str, object]] | NotGiven = NOT_GIVEN,
192
+ top_p: float | NotGiven = NOT_GIVEN,
193
+ truncation: Literal["auto", "disabled"] | NotGiven = NOT_GIVEN,
194
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
195
+ # The extra values given here take precedence over values defined on the client or passed to this method.
196
+ extra_headers: Headers | None = None,
197
+ extra_query: Query | None = None,
198
+ extra_body: Body | None = None,
199
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
200
+ ) -> ResponseCreateResponse:
201
+ """
202
+ Responses
203
+
204
+ Args:
205
+ model: model specified as `model_vendor/model`, for example `openai/gpt-4o`
206
+
207
+ include: Which fields to include in the response
208
+
209
+ instructions: Instructions for the response generation
210
+
211
+ max_output_tokens: Maximum number of output tokens
212
+
213
+ metadata: Metadata for the response
214
+
215
+ parallel_tool_calls: Whether to enable parallel tool calls
216
+
217
+ previous_response_id: ID of the previous response for chaining
218
+
219
+ reasoning: Reasoning configuration for the response
220
+
221
+ store: Whether to store the response
222
+
223
+ stream: Whether to stream the response
224
+
225
+ temperature: Sampling temperature for randomness control
226
+
227
+ text: Text configuration parameters
228
+
229
+ tool_choice: Tool choice configuration
230
+
231
+ tools: Tools available for the response
232
+
233
+ top_p: Top-p sampling parameter
234
+
235
+ truncation: Truncation configuration
236
+
237
+ extra_headers: Send extra headers
238
+
239
+ extra_query: Add additional query parameters to the request
240
+
241
+ extra_body: Add additional JSON properties to the request
242
+
243
+ timeout: Override the client-level default timeout for this request, in seconds
244
+ """
245
+ return cast(
246
+ ResponseCreateResponse,
247
+ await self._post(
248
+ "/v5/responses",
249
+ body=await async_maybe_transform(
250
+ {
251
+ "input": input,
252
+ "model": model,
253
+ "include": include,
254
+ "instructions": instructions,
255
+ "max_output_tokens": max_output_tokens,
256
+ "metadata": metadata,
257
+ "parallel_tool_calls": parallel_tool_calls,
258
+ "previous_response_id": previous_response_id,
259
+ "reasoning": reasoning,
260
+ "store": store,
261
+ "stream": stream,
262
+ "temperature": temperature,
263
+ "text": text,
264
+ "tool_choice": tool_choice,
265
+ "tools": tools,
266
+ "top_p": top_p,
267
+ "truncation": truncation,
268
+ },
269
+ response_create_params.ResponseCreateParams,
270
+ ),
271
+ options=make_request_options(
272
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
273
+ ),
274
+ cast_to=cast(
275
+ Any, ResponseCreateResponse
276
+ ), # Union types cannot be passed in as arguments in the type system
277
+ ),
278
+ )
279
+
280
+
281
+ class ResponsesResourceWithRawResponse:
282
+ def __init__(self, responses: ResponsesResource) -> None:
283
+ self._responses = responses
284
+
285
+ self.create = to_raw_response_wrapper(
286
+ responses.create,
287
+ )
288
+
289
+
290
+ class AsyncResponsesResourceWithRawResponse:
291
+ def __init__(self, responses: AsyncResponsesResource) -> None:
292
+ self._responses = responses
293
+
294
+ self.create = async_to_raw_response_wrapper(
295
+ responses.create,
296
+ )
297
+
298
+
299
+ class ResponsesResourceWithStreamingResponse:
300
+ def __init__(self, responses: ResponsesResource) -> None:
301
+ self._responses = responses
302
+
303
+ self.create = to_streamed_response_wrapper(
304
+ responses.create,
305
+ )
306
+
307
+
308
+ class AsyncResponsesResourceWithStreamingResponse:
309
+ def __init__(self, responses: AsyncResponsesResource) -> None:
310
+ self._responses = responses
311
+
312
+ self.create = async_to_streamed_response_wrapper(
313
+ responses.create,
314
+ )
@@ -17,7 +17,7 @@ from ..types import (
17
17
  span_update_params,
18
18
  span_upsert_batch_params,
19
19
  )
20
- from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
20
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
21
21
  from .._utils import maybe_transform, async_maybe_transform
22
22
  from .._compat import cached_property
23
23
  from .._resource import SyncAPIResource, AsyncAPIResource
@@ -255,18 +255,17 @@ class SpansResource(SyncAPIResource):
255
255
  sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
256
256
  starting_after: str | NotGiven = NOT_GIVEN,
257
257
  to_ts: Union[str, datetime] | NotGiven = NOT_GIVEN,
258
- excluded_span_ids: List[str] | NotGiven = NOT_GIVEN,
259
- excluded_trace_ids: List[str] | NotGiven = NOT_GIVEN,
258
+ application_variant_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
259
+ excluded_span_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
260
+ excluded_trace_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
260
261
  extra_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
261
262
  group_id: str | NotGiven = NOT_GIVEN,
262
- names: List[str] | NotGiven = NOT_GIVEN,
263
+ names: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
263
264
  parents_only: bool | NotGiven = NOT_GIVEN,
264
- search_text: str | NotGiven = NOT_GIVEN,
265
- span_id: str | NotGiven = NOT_GIVEN,
266
- span_ids: List[str] | NotGiven = NOT_GIVEN,
265
+ search_texts: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
266
+ span_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
267
267
  statuses: List[SpanStatus] | NotGiven = NOT_GIVEN,
268
- trace_id: str | NotGiven = NOT_GIVEN,
269
- trace_ids: List[str] | NotGiven = NOT_GIVEN,
268
+ trace_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
270
269
  types: List[SpanType] | NotGiven = NOT_GIVEN,
271
270
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
272
271
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -283,6 +282,8 @@ class SpansResource(SyncAPIResource):
283
282
 
284
283
  to_ts: The ending (most recent) timestamp in ISO format.
285
284
 
285
+ application_variant_ids: Filter by application variant IDs
286
+
286
287
  excluded_span_ids: List of span IDs to exclude from results
287
288
 
288
289
  excluded_trace_ids: List of trace IDs to exclude from results
@@ -295,16 +296,12 @@ class SpansResource(SyncAPIResource):
295
296
 
296
297
  parents_only: Only fetch spans that are the top-level (ie. have no parent_id)
297
298
 
298
- search_text: Free text search across span input and output fields
299
-
300
- span_id: Filter by span ID (deprecated: use span_ids instead)
299
+ search_texts: Free text search across span input and output fields
301
300
 
302
301
  span_ids: Filter by span IDs
303
302
 
304
303
  statuses: Filter on span status
305
304
 
306
- trace_id: Filter by trace ID (deprecated: use trace_ids instead)
307
-
308
305
  trace_ids: Filter by trace IDs
309
306
 
310
307
  extra_headers: Send extra headers
@@ -320,17 +317,16 @@ class SpansResource(SyncAPIResource):
320
317
  page=SyncCursorPage[Span],
321
318
  body=maybe_transform(
322
319
  {
320
+ "application_variant_ids": application_variant_ids,
323
321
  "excluded_span_ids": excluded_span_ids,
324
322
  "excluded_trace_ids": excluded_trace_ids,
325
323
  "extra_metadata": extra_metadata,
326
324
  "group_id": group_id,
327
325
  "names": names,
328
326
  "parents_only": parents_only,
329
- "search_text": search_text,
330
- "span_id": span_id,
327
+ "search_texts": search_texts,
331
328
  "span_ids": span_ids,
332
329
  "statuses": statuses,
333
- "trace_id": trace_id,
334
330
  "trace_ids": trace_ids,
335
331
  "types": types,
336
332
  },
@@ -607,18 +603,17 @@ class AsyncSpansResource(AsyncAPIResource):
607
603
  sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
608
604
  starting_after: str | NotGiven = NOT_GIVEN,
609
605
  to_ts: Union[str, datetime] | NotGiven = NOT_GIVEN,
610
- excluded_span_ids: List[str] | NotGiven = NOT_GIVEN,
611
- excluded_trace_ids: List[str] | NotGiven = NOT_GIVEN,
606
+ application_variant_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
607
+ excluded_span_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
608
+ excluded_trace_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
612
609
  extra_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
613
610
  group_id: str | NotGiven = NOT_GIVEN,
614
- names: List[str] | NotGiven = NOT_GIVEN,
611
+ names: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
615
612
  parents_only: bool | NotGiven = NOT_GIVEN,
616
- search_text: str | NotGiven = NOT_GIVEN,
617
- span_id: str | NotGiven = NOT_GIVEN,
618
- span_ids: List[str] | NotGiven = NOT_GIVEN,
613
+ search_texts: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
614
+ span_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
619
615
  statuses: List[SpanStatus] | NotGiven = NOT_GIVEN,
620
- trace_id: str | NotGiven = NOT_GIVEN,
621
- trace_ids: List[str] | NotGiven = NOT_GIVEN,
616
+ trace_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
622
617
  types: List[SpanType] | NotGiven = NOT_GIVEN,
623
618
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
624
619
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -635,6 +630,8 @@ class AsyncSpansResource(AsyncAPIResource):
635
630
 
636
631
  to_ts: The ending (most recent) timestamp in ISO format.
637
632
 
633
+ application_variant_ids: Filter by application variant IDs
634
+
638
635
  excluded_span_ids: List of span IDs to exclude from results
639
636
 
640
637
  excluded_trace_ids: List of trace IDs to exclude from results
@@ -647,16 +644,12 @@ class AsyncSpansResource(AsyncAPIResource):
647
644
 
648
645
  parents_only: Only fetch spans that are the top-level (ie. have no parent_id)
649
646
 
650
- search_text: Free text search across span input and output fields
651
-
652
- span_id: Filter by span ID (deprecated: use span_ids instead)
647
+ search_texts: Free text search across span input and output fields
653
648
 
654
649
  span_ids: Filter by span IDs
655
650
 
656
651
  statuses: Filter on span status
657
652
 
658
- trace_id: Filter by trace ID (deprecated: use trace_ids instead)
659
-
660
653
  trace_ids: Filter by trace IDs
661
654
 
662
655
  extra_headers: Send extra headers
@@ -672,17 +665,16 @@ class AsyncSpansResource(AsyncAPIResource):
672
665
  page=AsyncCursorPage[Span],
673
666
  body=maybe_transform(
674
667
  {
668
+ "application_variant_ids": application_variant_ids,
675
669
  "excluded_span_ids": excluded_span_ids,
676
670
  "excluded_trace_ids": excluded_trace_ids,
677
671
  "extra_metadata": extra_metadata,
678
672
  "group_id": group_id,
679
673
  "names": names,
680
674
  "parents_only": parents_only,
681
- "search_text": search_text,
682
- "span_id": span_id,
675
+ "search_texts": search_texts,
683
676
  "span_ids": span_ids,
684
677
  "statuses": statuses,
685
- "trace_id": trace_id,
686
678
  "trace_ids": trace_ids,
687
679
  "types": types,
688
680
  },
@@ -2,10 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from . import container, evaluation
6
+ from .. import _compat
5
7
  from .file import File as File
6
8
  from .span import Span as Span
9
+ from .shared import Identity as Identity
7
10
  from .dataset import Dataset as Dataset
8
11
  from .question import Question as Question
12
+ from .response import Response as Response
9
13
  from .component import Component as Component
10
14
  from .container import Container as Container
11
15
  from .file_list import FileList as FileList
@@ -44,6 +48,7 @@ from .item_locator_template import ItemLocatorTemplate as ItemLocatorTemplate
44
48
  from .model_delete_response import ModelDeleteResponse as ModelDeleteResponse
45
49
  from .evaluation_list_params import EvaluationListParams as EvaluationListParams
46
50
  from .question_create_params import QuestionCreateParams as QuestionCreateParams
51
+ from .response_create_params import ResponseCreateParams as ResponseCreateParams
47
52
  from .dataset_delete_response import DatasetDeleteResponse as DatasetDeleteResponse
48
53
  from .dataset_retrieve_params import DatasetRetrieveParams as DatasetRetrieveParams
49
54
  from .inference_create_params import InferenceCreateParams as InferenceCreateParams
@@ -52,6 +57,7 @@ from .dataset_item_list_params import DatasetItemListParams as DatasetItemListPa
52
57
  from .evaluation_create_params import EvaluationCreateParams as EvaluationCreateParams
53
58
  from .evaluation_update_params import EvaluationUpdateParams as EvaluationUpdateParams
54
59
  from .inference_response_chunk import InferenceResponseChunk as InferenceResponseChunk
60
+ from .response_create_response import ResponseCreateResponse as ResponseCreateResponse
55
61
  from .span_upsert_batch_params import SpanUpsertBatchParams as SpanUpsertBatchParams
56
62
  from .inference_create_response import InferenceCreateResponse as InferenceCreateResponse
57
63
  from .dataset_item_update_params import DatasetItemUpdateParams as DatasetItemUpdateParams
@@ -64,3 +70,14 @@ from .dataset_item_retrieve_params import DatasetItemRetrieveParams as DatasetIt
64
70
  from .evaluation_item_retrieve_params import EvaluationItemRetrieveParams as EvaluationItemRetrieveParams
65
71
  from .dataset_item_batch_create_params import DatasetItemBatchCreateParams as DatasetItemBatchCreateParams
66
72
  from .dataset_item_batch_create_response import DatasetItemBatchCreateResponse as DatasetItemBatchCreateResponse
73
+
74
+ # Rebuild cyclical models only after all modules are imported.
75
+ # This ensures that, when building the deferred (due to cyclical references) model schema,
76
+ # Pydantic can resolve the necessary references.
77
+ # See: https://github.com/pydantic/pydantic/issues/11250 for more context.
78
+ if _compat.PYDANTIC_V1:
79
+ evaluation.Evaluation.update_forward_refs() # type: ignore
80
+ container.Container.update_forward_refs() # type: ignore
81
+ else:
82
+ evaluation.Evaluation.model_rebuild(_parent_namespace_depth=0)
83
+ container.Container.model_rebuild(_parent_namespace_depth=0)