scale-gp-beta 0.1.0a30__py3-none-any.whl → 0.1.0a32__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 (57) hide show
  1. scale_gp_beta/__init__.py +3 -1
  2. scale_gp_beta/_base_client.py +12 -12
  3. scale_gp_beta/_client.py +20 -20
  4. scale_gp_beta/_compat.py +48 -48
  5. scale_gp_beta/_models.py +51 -45
  6. scale_gp_beta/_qs.py +7 -7
  7. scale_gp_beta/_types.py +53 -12
  8. scale_gp_beta/_utils/__init__.py +9 -2
  9. scale_gp_beta/_utils/_compat.py +45 -0
  10. scale_gp_beta/_utils/_datetime_parse.py +136 -0
  11. scale_gp_beta/_utils/_transform.py +13 -3
  12. scale_gp_beta/_utils/_typing.py +6 -1
  13. scale_gp_beta/_utils/_utils.py +4 -5
  14. scale_gp_beta/_version.py +1 -1
  15. scale_gp_beta/resources/__init__.py +6 -6
  16. scale_gp_beta/resources/chat/completions.py +236 -236
  17. scale_gp_beta/resources/completions.py +142 -142
  18. scale_gp_beta/resources/dataset_items.py +27 -27
  19. scale_gp_beta/resources/datasets.py +38 -38
  20. scale_gp_beta/resources/evaluation_items.py +19 -19
  21. scale_gp_beta/resources/evaluations.py +97 -75
  22. scale_gp_beta/resources/files/content.py +3 -3
  23. scale_gp_beta/resources/files/files.py +21 -21
  24. scale_gp_beta/resources/inference.py +7 -7
  25. scale_gp_beta/resources/models.py +71 -73
  26. scale_gp_beta/resources/questions.py +43 -43
  27. scale_gp_beta/resources/responses.py +34 -34
  28. scale_gp_beta/resources/spans.py +81 -81
  29. scale_gp_beta/types/__init__.py +4 -4
  30. scale_gp_beta/types/chat/chat_completion.py +114 -19
  31. scale_gp_beta/types/chat/chat_completion_chunk.py +84 -14
  32. scale_gp_beta/types/chat/completion_create_params.py +5 -3
  33. scale_gp_beta/types/completion.py +36 -6
  34. scale_gp_beta/types/completion_create_params.py +5 -3
  35. scale_gp_beta/types/container.py +2 -2
  36. scale_gp_beta/types/container_param.py +2 -2
  37. scale_gp_beta/types/dataset_create_params.py +4 -2
  38. scale_gp_beta/types/dataset_list_params.py +3 -2
  39. scale_gp_beta/types/dataset_update_params.py +3 -2
  40. scale_gp_beta/types/evaluation.py +7 -1
  41. scale_gp_beta/types/evaluation_create_params.py +17 -6
  42. scale_gp_beta/types/evaluation_list_params.py +3 -1
  43. scale_gp_beta/types/evaluation_task.py +6 -1
  44. scale_gp_beta/types/evaluation_task_param.py +4 -3
  45. scale_gp_beta/types/evaluation_update_params.py +3 -2
  46. scale_gp_beta/types/inference_model.py +10 -1
  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_create_params.py +4 -2
  50. scale_gp_beta/types/response.py +852 -142
  51. scale_gp_beta/types/response_create_params.py +7 -5
  52. scale_gp_beta/types/response_create_response.py +6072 -1012
  53. scale_gp_beta/types/span_search_params.py +8 -7
  54. {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a32.dist-info}/METADATA +1 -1
  55. {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a32.dist-info}/RECORD +57 -55
  56. {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a32.dist-info}/WHEEL +0 -0
  57. {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a32.dist-info}/licenses/LICENSE +0 -0
@@ -31,12 +31,17 @@ class ChoiceDeltaFunctionCall(BaseModel):
31
31
 
32
32
  name: Optional[str] = None
33
33
 
34
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
35
34
  if TYPE_CHECKING:
35
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
36
+ # value to this field, so for compatibility we avoid doing it at runtime.
37
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
38
+
36
39
  # Stub to indicate that arbitrary properties are accepted.
37
40
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
38
41
  # `getattr(obj, '$type')`
39
42
  def __getattr__(self, attr: str) -> object: ...
43
+ else:
44
+ __pydantic_extra__: Dict[str, object]
40
45
 
41
46
 
42
47
  class ChoiceDeltaToolCallFunction(BaseModel):
@@ -44,12 +49,17 @@ class ChoiceDeltaToolCallFunction(BaseModel):
44
49
 
45
50
  name: Optional[str] = None
46
51
 
47
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
48
52
  if TYPE_CHECKING:
53
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
54
+ # value to this field, so for compatibility we avoid doing it at runtime.
55
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
56
+
49
57
  # Stub to indicate that arbitrary properties are accepted.
50
58
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
51
59
  # `getattr(obj, '$type')`
52
60
  def __getattr__(self, attr: str) -> object: ...
61
+ else:
62
+ __pydantic_extra__: Dict[str, object]
53
63
 
54
64
 
55
65
  class ChoiceDeltaToolCall(BaseModel):
@@ -61,12 +71,17 @@ class ChoiceDeltaToolCall(BaseModel):
61
71
 
62
72
  type: Optional[Literal["function"]] = None
63
73
 
64
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
65
74
  if TYPE_CHECKING:
75
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
76
+ # value to this field, so for compatibility we avoid doing it at runtime.
77
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
78
+
66
79
  # Stub to indicate that arbitrary properties are accepted.
67
80
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
68
81
  # `getattr(obj, '$type')`
69
82
  def __getattr__(self, attr: str) -> object: ...
83
+ else:
84
+ __pydantic_extra__: Dict[str, object]
70
85
 
71
86
 
72
87
  class ChoiceDelta(BaseModel):
@@ -80,12 +95,17 @@ class ChoiceDelta(BaseModel):
80
95
 
81
96
  tool_calls: Optional[List[ChoiceDeltaToolCall]] = None
82
97
 
83
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
84
98
  if TYPE_CHECKING:
99
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
100
+ # value to this field, so for compatibility we avoid doing it at runtime.
101
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
102
+
85
103
  # Stub to indicate that arbitrary properties are accepted.
86
104
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
87
105
  # `getattr(obj, '$type')`
88
106
  def __getattr__(self, attr: str) -> object: ...
107
+ else:
108
+ __pydantic_extra__: Dict[str, object]
89
109
 
90
110
 
91
111
  class ChoiceLogprobsContentTopLogprob(BaseModel):
@@ -95,12 +115,17 @@ class ChoiceLogprobsContentTopLogprob(BaseModel):
95
115
 
96
116
  bytes: Optional[List[int]] = None
97
117
 
98
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
99
118
  if TYPE_CHECKING:
119
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
120
+ # value to this field, so for compatibility we avoid doing it at runtime.
121
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
122
+
100
123
  # Stub to indicate that arbitrary properties are accepted.
101
124
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
102
125
  # `getattr(obj, '$type')`
103
126
  def __getattr__(self, attr: str) -> object: ...
127
+ else:
128
+ __pydantic_extra__: Dict[str, object]
104
129
 
105
130
 
106
131
  class ChoiceLogprobsContent(BaseModel):
@@ -112,12 +137,17 @@ class ChoiceLogprobsContent(BaseModel):
112
137
 
113
138
  bytes: Optional[List[int]] = None
114
139
 
115
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
116
140
  if TYPE_CHECKING:
141
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
142
+ # value to this field, so for compatibility we avoid doing it at runtime.
143
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
144
+
117
145
  # Stub to indicate that arbitrary properties are accepted.
118
146
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
119
147
  # `getattr(obj, '$type')`
120
148
  def __getattr__(self, attr: str) -> object: ...
149
+ else:
150
+ __pydantic_extra__: Dict[str, object]
121
151
 
122
152
 
123
153
  class ChoiceLogprobsRefusalTopLogprob(BaseModel):
@@ -127,12 +157,17 @@ class ChoiceLogprobsRefusalTopLogprob(BaseModel):
127
157
 
128
158
  bytes: Optional[List[int]] = None
129
159
 
130
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
131
160
  if TYPE_CHECKING:
161
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
162
+ # value to this field, so for compatibility we avoid doing it at runtime.
163
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
164
+
132
165
  # Stub to indicate that arbitrary properties are accepted.
133
166
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
134
167
  # `getattr(obj, '$type')`
135
168
  def __getattr__(self, attr: str) -> object: ...
169
+ else:
170
+ __pydantic_extra__: Dict[str, object]
136
171
 
137
172
 
138
173
  class ChoiceLogprobsRefusal(BaseModel):
@@ -144,12 +179,17 @@ class ChoiceLogprobsRefusal(BaseModel):
144
179
 
145
180
  bytes: Optional[List[int]] = None
146
181
 
147
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
148
182
  if TYPE_CHECKING:
183
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
184
+ # value to this field, so for compatibility we avoid doing it at runtime.
185
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
186
+
149
187
  # Stub to indicate that arbitrary properties are accepted.
150
188
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
151
189
  # `getattr(obj, '$type')`
152
190
  def __getattr__(self, attr: str) -> object: ...
191
+ else:
192
+ __pydantic_extra__: Dict[str, object]
153
193
 
154
194
 
155
195
  class ChoiceLogprobs(BaseModel):
@@ -157,12 +197,17 @@ class ChoiceLogprobs(BaseModel):
157
197
 
158
198
  refusal: Optional[List[ChoiceLogprobsRefusal]] = None
159
199
 
160
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
161
200
  if TYPE_CHECKING:
201
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
202
+ # value to this field, so for compatibility we avoid doing it at runtime.
203
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
204
+
162
205
  # Stub to indicate that arbitrary properties are accepted.
163
206
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
164
207
  # `getattr(obj, '$type')`
165
208
  def __getattr__(self, attr: str) -> object: ...
209
+ else:
210
+ __pydantic_extra__: Dict[str, object]
166
211
 
167
212
 
168
213
  class Choice(BaseModel):
@@ -174,12 +219,17 @@ class Choice(BaseModel):
174
219
 
175
220
  logprobs: Optional[ChoiceLogprobs] = None
176
221
 
177
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
178
222
  if TYPE_CHECKING:
223
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
224
+ # value to this field, so for compatibility we avoid doing it at runtime.
225
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
226
+
179
227
  # Stub to indicate that arbitrary properties are accepted.
180
228
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
181
229
  # `getattr(obj, '$type')`
182
230
  def __getattr__(self, attr: str) -> object: ...
231
+ else:
232
+ __pydantic_extra__: Dict[str, object]
183
233
 
184
234
 
185
235
  class UsageCompletionTokensDetails(BaseModel):
@@ -191,12 +241,17 @@ class UsageCompletionTokensDetails(BaseModel):
191
241
 
192
242
  rejected_prediction_tokens: Optional[int] = None
193
243
 
194
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
195
244
  if TYPE_CHECKING:
245
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
246
+ # value to this field, so for compatibility we avoid doing it at runtime.
247
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
248
+
196
249
  # Stub to indicate that arbitrary properties are accepted.
197
250
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
198
251
  # `getattr(obj, '$type')`
199
252
  def __getattr__(self, attr: str) -> object: ...
253
+ else:
254
+ __pydantic_extra__: Dict[str, object]
200
255
 
201
256
 
202
257
  class UsagePromptTokensDetails(BaseModel):
@@ -204,12 +259,17 @@ class UsagePromptTokensDetails(BaseModel):
204
259
 
205
260
  cached_tokens: Optional[int] = None
206
261
 
207
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
208
262
  if TYPE_CHECKING:
263
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
264
+ # value to this field, so for compatibility we avoid doing it at runtime.
265
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
266
+
209
267
  # Stub to indicate that arbitrary properties are accepted.
210
268
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
211
269
  # `getattr(obj, '$type')`
212
270
  def __getattr__(self, attr: str) -> object: ...
271
+ else:
272
+ __pydantic_extra__: Dict[str, object]
213
273
 
214
274
 
215
275
  class Usage(BaseModel):
@@ -223,12 +283,17 @@ class Usage(BaseModel):
223
283
 
224
284
  prompt_tokens_details: Optional[UsagePromptTokensDetails] = None
225
285
 
226
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
227
286
  if TYPE_CHECKING:
287
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
288
+ # value to this field, so for compatibility we avoid doing it at runtime.
289
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
290
+
228
291
  # Stub to indicate that arbitrary properties are accepted.
229
292
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
230
293
  # `getattr(obj, '$type')`
231
294
  def __getattr__(self, attr: str) -> object: ...
295
+ else:
296
+ __pydantic_extra__: Dict[str, object]
232
297
 
233
298
 
234
299
  class ChatCompletionChunk(BaseModel):
@@ -248,9 +313,14 @@ class ChatCompletionChunk(BaseModel):
248
313
 
249
314
  usage: Optional[Usage] = None
250
315
 
251
- __pydantic_extra__: Dict[str, builtins.object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
252
316
  if TYPE_CHECKING:
317
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
318
+ # value to this field, so for compatibility we avoid doing it at runtime.
319
+ __pydantic_extra__: Dict[str, builtins.object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
320
+
253
321
  # Stub to indicate that arbitrary properties are accepted.
254
322
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
255
323
  # `getattr(obj, '$type')`
256
324
  def __getattr__(self, attr: str) -> builtins.object: ...
325
+ else:
326
+ __pydantic_extra__: Dict[str, builtins.object]
@@ -2,9 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, List, Union, Iterable
5
+ from typing import Dict, Union, Iterable
6
6
  from typing_extensions import Literal, Required, TypedDict
7
7
 
8
+ from ..._types import SequenceNotStr
9
+
8
10
  __all__ = ["CompletionCreateParamsBase", "CompletionCreateParamsNonStreaming", "CompletionCreateParamsStreaming"]
9
11
 
10
12
 
@@ -67,7 +69,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
67
69
  dashboard.
68
70
  """
69
71
 
70
- modalities: List[str]
72
+ modalities: SequenceNotStr[str]
71
73
  """Output types that you would like the model to generate for this request."""
72
74
 
73
75
  n: int
@@ -100,7 +102,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
100
102
  requests with same seed.
101
103
  """
102
104
 
103
- stop: Union[str, List[str]]
105
+ stop: Union[str, SequenceNotStr[str]]
104
106
  """Up to 4 sequences where the API will stop generating further tokens."""
105
107
 
106
108
  store: bool
@@ -27,12 +27,17 @@ class ChoiceLogprobs(BaseModel):
27
27
 
28
28
  top_logprobs: Optional[List[Dict[str, float]]] = None
29
29
 
30
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
31
30
  if TYPE_CHECKING:
31
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
32
+ # value to this field, so for compatibility we avoid doing it at runtime.
33
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
34
+
32
35
  # Stub to indicate that arbitrary properties are accepted.
33
36
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
34
37
  # `getattr(obj, '$type')`
35
38
  def __getattr__(self, attr: str) -> object: ...
39
+ else:
40
+ __pydantic_extra__: Dict[str, object]
36
41
 
37
42
 
38
43
  class Choice(BaseModel):
@@ -44,12 +49,17 @@ class Choice(BaseModel):
44
49
 
45
50
  logprobs: Optional[ChoiceLogprobs] = None
46
51
 
47
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
48
52
  if TYPE_CHECKING:
53
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
54
+ # value to this field, so for compatibility we avoid doing it at runtime.
55
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
56
+
49
57
  # Stub to indicate that arbitrary properties are accepted.
50
58
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
51
59
  # `getattr(obj, '$type')`
52
60
  def __getattr__(self, attr: str) -> object: ...
61
+ else:
62
+ __pydantic_extra__: Dict[str, object]
53
63
 
54
64
 
55
65
  class UsageCompletionTokensDetails(BaseModel):
@@ -61,12 +71,17 @@ class UsageCompletionTokensDetails(BaseModel):
61
71
 
62
72
  rejected_prediction_tokens: Optional[int] = None
63
73
 
64
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
65
74
  if TYPE_CHECKING:
75
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
76
+ # value to this field, so for compatibility we avoid doing it at runtime.
77
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
78
+
66
79
  # Stub to indicate that arbitrary properties are accepted.
67
80
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
68
81
  # `getattr(obj, '$type')`
69
82
  def __getattr__(self, attr: str) -> object: ...
83
+ else:
84
+ __pydantic_extra__: Dict[str, object]
70
85
 
71
86
 
72
87
  class UsagePromptTokensDetails(BaseModel):
@@ -74,12 +89,17 @@ class UsagePromptTokensDetails(BaseModel):
74
89
 
75
90
  cached_tokens: Optional[int] = None
76
91
 
77
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
78
92
  if TYPE_CHECKING:
93
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
94
+ # value to this field, so for compatibility we avoid doing it at runtime.
95
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
96
+
79
97
  # Stub to indicate that arbitrary properties are accepted.
80
98
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
81
99
  # `getattr(obj, '$type')`
82
100
  def __getattr__(self, attr: str) -> object: ...
101
+ else:
102
+ __pydantic_extra__: Dict[str, object]
83
103
 
84
104
 
85
105
  class Usage(BaseModel):
@@ -93,12 +113,17 @@ class Usage(BaseModel):
93
113
 
94
114
  prompt_tokens_details: Optional[UsagePromptTokensDetails] = None
95
115
 
96
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
97
116
  if TYPE_CHECKING:
117
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
118
+ # value to this field, so for compatibility we avoid doing it at runtime.
119
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
120
+
98
121
  # Stub to indicate that arbitrary properties are accepted.
99
122
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
100
123
  # `getattr(obj, '$type')`
101
124
  def __getattr__(self, attr: str) -> object: ...
125
+ else:
126
+ __pydantic_extra__: Dict[str, object]
102
127
 
103
128
 
104
129
  class Completion(BaseModel):
@@ -116,9 +141,14 @@ class Completion(BaseModel):
116
141
 
117
142
  usage: Optional[Usage] = None
118
143
 
119
- __pydantic_extra__: Dict[str, builtins.object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
120
144
  if TYPE_CHECKING:
145
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
146
+ # value to this field, so for compatibility we avoid doing it at runtime.
147
+ __pydantic_extra__: Dict[str, builtins.object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
148
+
121
149
  # Stub to indicate that arbitrary properties are accepted.
122
150
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
123
151
  # `getattr(obj, '$type')`
124
152
  def __getattr__(self, attr: str) -> builtins.object: ...
153
+ else:
154
+ __pydantic_extra__: Dict[str, builtins.object]
@@ -2,9 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, List, Union
5
+ from typing import Dict, Union
6
6
  from typing_extensions import Literal, Required, TypedDict
7
7
 
8
+ from .._types import SequenceNotStr
9
+
8
10
  __all__ = ["CompletionCreateParamsBase", "CompletionCreateParamsNonStreaming", "CompletionCreateParamsStreaming"]
9
11
 
10
12
 
@@ -12,7 +14,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
12
14
  model: Required[str]
13
15
  """model specified as `model_vendor/model`, for example `openai/gpt-4o`"""
14
16
 
15
- prompt: Required[Union[str, List[str]]]
17
+ prompt: Required[Union[str, SequenceNotStr[str]]]
16
18
  """The prompt to generate completions for, encoded as a string"""
17
19
 
18
20
  best_of: int
@@ -58,7 +60,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
58
60
  Determinism is not guaranteed.
59
61
  """
60
62
 
61
- stop: Union[str, List[str]]
63
+ stop: Union[str, SequenceNotStr[str]]
62
64
  """Up to 4 sequences where the API will stop generating further tokens."""
63
65
 
64
66
  stream_options: Dict[str, object]
@@ -5,13 +5,13 @@ from __future__ import annotations
5
5
  from typing import TYPE_CHECKING, List, Union, Optional
6
6
  from typing_extensions import Literal, TypeAlias, TypeAliasType
7
7
 
8
- from .._compat import PYDANTIC_V2
8
+ from .._compat import PYDANTIC_V1
9
9
  from .._models import BaseModel
10
10
  from .component import Component
11
11
 
12
12
  __all__ = ["Container", "Child"]
13
13
 
14
- if TYPE_CHECKING or PYDANTIC_V2:
14
+ if TYPE_CHECKING or not PYDANTIC_V1:
15
15
  Child = TypeAliasType("Child", Union["Container", Component])
16
16
  else:
17
17
  Child: TypeAlias = Union["Container", Component]
@@ -5,12 +5,12 @@ from __future__ import annotations
5
5
  from typing import TYPE_CHECKING, Union, Iterable
6
6
  from typing_extensions import Literal, Required, TypeAlias, TypedDict, TypeAliasType
7
7
 
8
- from .._compat import PYDANTIC_V2
8
+ from .._compat import PYDANTIC_V1
9
9
  from .component_param import ComponentParam
10
10
 
11
11
  __all__ = ["ContainerParam", "Child"]
12
12
 
13
- if TYPE_CHECKING or PYDANTIC_V2:
13
+ if TYPE_CHECKING or not PYDANTIC_V1:
14
14
  Child = TypeAliasType("Child", Union["ContainerParam", ComponentParam])
15
15
  else:
16
16
  Child: TypeAlias = Union["ContainerParam", ComponentParam]
@@ -2,9 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, List, Iterable
5
+ from typing import Dict, Iterable
6
6
  from typing_extensions import Required, TypedDict
7
7
 
8
+ from .._types import SequenceNotStr
9
+
8
10
  __all__ = ["DatasetCreateParams"]
9
11
 
10
12
 
@@ -16,5 +18,5 @@ class DatasetCreateParams(TypedDict, total=False):
16
18
 
17
19
  description: str
18
20
 
19
- tags: List[str]
21
+ tags: SequenceNotStr[str]
20
22
  """The tags associated with the entity"""
@@ -2,9 +2,10 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List
6
5
  from typing_extensions import Literal, TypedDict
7
6
 
7
+ from .._types import SequenceNotStr
8
+
8
9
  __all__ = ["DatasetListParams"]
9
10
 
10
11
 
@@ -21,4 +22,4 @@ class DatasetListParams(TypedDict, total=False):
21
22
 
22
23
  starting_after: str
23
24
 
24
- tags: List[str]
25
+ tags: SequenceNotStr[str]
@@ -2,9 +2,10 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List
6
5
  from typing_extensions import TypedDict
7
6
 
7
+ from .._types import SequenceNotStr
8
+
8
9
  __all__ = ["DatasetUpdateParams"]
9
10
 
10
11
 
@@ -13,5 +14,5 @@ class DatasetUpdateParams(TypedDict, total=False):
13
14
 
14
15
  name: str
15
16
 
16
- tags: List[str]
17
+ tags: SequenceNotStr[str]
17
18
  """The tags associated with the entity"""
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Optional
5
+ from typing import Dict, List, Optional
6
6
  from datetime import datetime
7
7
  from typing_extensions import Literal
8
8
 
@@ -34,8 +34,14 @@ class Evaluation(BaseModel):
34
34
 
35
35
  description: Optional[str] = None
36
36
 
37
+ metadata: Optional[Dict[str, object]] = None
38
+ """Metadata key-value pairs for the evaluation"""
39
+
37
40
  object: Optional[Literal["evaluation"]] = None
38
41
 
42
+ status_reason: Optional[str] = None
43
+ """Reason for evaluation status"""
44
+
39
45
  tasks: Optional[List["EvaluationTask"]] = None
40
46
  """Tasks executed during evaluation. Populated with optional `task` view."""
41
47
 
@@ -2,9 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, List, Union, Iterable
5
+ from typing import Dict, Union, Iterable
6
6
  from typing_extensions import Required, TypeAlias, TypedDict
7
7
 
8
+ from .._types import SequenceNotStr
9
+
8
10
  __all__ = [
9
11
  "EvaluationCreateParams",
10
12
  "EvaluationStandaloneCreateRequest",
@@ -23,7 +25,10 @@ class EvaluationStandaloneCreateRequest(TypedDict, total=False):
23
25
 
24
26
  description: str
25
27
 
26
- tags: List[str]
28
+ metadata: Dict[str, object]
29
+ """Optional metadata key-value pairs for the evaluation"""
30
+
31
+ tags: SequenceNotStr[str]
27
32
  """The tags associated with the entity"""
28
33
 
29
34
  tasks: Iterable["EvaluationTaskParam"]
@@ -41,7 +46,10 @@ class EvaluationFromDatasetCreateRequest(TypedDict, total=False):
41
46
 
42
47
  description: str
43
48
 
44
- tags: List[str]
49
+ metadata: Dict[str, object]
50
+ """Optional metadata key-value pairs for the evaluation"""
51
+
52
+ tags: SequenceNotStr[str]
45
53
  """The tags associated with the entity"""
46
54
 
47
55
  tasks: Iterable["EvaluationTaskParam"]
@@ -68,7 +76,10 @@ class EvaluationWithDatasetCreateRequest(TypedDict, total=False):
68
76
 
69
77
  description: str
70
78
 
71
- tags: List[str]
79
+ metadata: Dict[str, object]
80
+ """Optional metadata key-value pairs for the evaluation"""
81
+
82
+ tags: SequenceNotStr[str]
72
83
  """The tags associated with the entity"""
73
84
 
74
85
  tasks: Iterable["EvaluationTaskParam"]
@@ -80,13 +91,13 @@ class EvaluationWithDatasetCreateRequestDataset(TypedDict, total=False):
80
91
 
81
92
  description: str
82
93
 
83
- keys: List[str]
94
+ keys: SequenceNotStr[str]
84
95
  """Keys from items in the `data` field that should be included in the dataset.
85
96
 
86
97
  If not provided, all keys will be included.
87
98
  """
88
99
 
89
- tags: List[str]
100
+ tags: SequenceNotStr[str]
90
101
  """The tags associated with the entity"""
91
102
 
92
103
 
@@ -5,6 +5,8 @@ from __future__ import annotations
5
5
  from typing import List
6
6
  from typing_extensions import Literal, TypedDict
7
7
 
8
+ from .._types import SequenceNotStr
9
+
8
10
  __all__ = ["EvaluationListParams"]
9
11
 
10
12
 
@@ -21,6 +23,6 @@ class EvaluationListParams(TypedDict, total=False):
21
23
 
22
24
  starting_after: str
23
25
 
24
- tags: List[str]
26
+ tags: SequenceNotStr[str]
25
27
 
26
28
  views: List[Literal["tasks"]]
@@ -101,12 +101,17 @@ class ChatCompletionEvaluationTaskConfiguration(BaseModel):
101
101
 
102
102
  top_p: Union[float, ItemLocator, None] = None
103
103
 
104
- __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
105
104
  if TYPE_CHECKING:
105
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
106
+ # value to this field, so for compatibility we avoid doing it at runtime.
107
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
108
+
106
109
  # Stub to indicate that arbitrary properties are accepted.
107
110
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
108
111
  # `getattr(obj, '$type')`
109
112
  def __getattr__(self, attr: str) -> object: ...
113
+ else:
114
+ __pydantic_extra__: Dict[str, object]
110
115
 
111
116
 
112
117
  class ChatCompletionEvaluationTask(BaseModel):
@@ -2,9 +2,10 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, List, Union, Iterable
5
+ from typing import Dict, Union, Iterable
6
6
  from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
7
 
8
+ from .._types import SequenceNotStr
8
9
  from .item_locator import ItemLocator
9
10
 
10
11
  __all__ = [
@@ -65,7 +66,7 @@ class ChatCompletionEvaluationTaskConfigurationTyped(TypedDict, total=False):
65
66
 
66
67
  metadata: Union[Dict[str, str], ItemLocator]
67
68
 
68
- modalities: Union[List[str], ItemLocator]
69
+ modalities: Union[SequenceNotStr[str], ItemLocator]
69
70
 
70
71
  n: Union[int, ItemLocator]
71
72
 
@@ -342,7 +343,7 @@ class AutoEvaluationGuidedDecodingEvaluationTaskConfigurationAutoEvaluationStruc
342
343
  class AutoEvaluationGuidedDecodingEvaluationTaskConfigurationAutoEvaluationGuidedDecodingTaskRequestWithItemLocator(
343
344
  TypedDict, total=False
344
345
  ):
345
- choices: Required[List[str]]
346
+ choices: Required[SequenceNotStr[str]]
346
347
  """Choices array cannot be empty"""
347
348
 
348
349
  model: Required[str]