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
@@ -1,8 +1,10 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import builtins
4
- from typing import TYPE_CHECKING, List, Optional
5
- from typing_extensions import Literal
4
+ from typing import TYPE_CHECKING, Dict, List, Union, Optional
5
+ from typing_extensions import Literal, TypeAlias
6
+
7
+ from pydantic import Field as FieldInfo
6
8
 
7
9
  from ..._models import BaseModel
8
10
 
@@ -15,7 +17,10 @@ __all__ = [
15
17
  "ChoiceMessageAudio",
16
18
  "ChoiceMessageFunctionCall",
17
19
  "ChoiceMessageToolCall",
18
- "ChoiceMessageToolCallFunction",
20
+ "ChoiceMessageToolCallChatCompletionMessageFunctionToolCall",
21
+ "ChoiceMessageToolCallChatCompletionMessageFunctionToolCallFunction",
22
+ "ChoiceMessageToolCallChatCompletionMessageCustomToolCall",
23
+ "ChoiceMessageToolCallChatCompletionMessageCustomToolCallCustom",
19
24
  "ChoiceLogprobs",
20
25
  "ChoiceLogprobsContent",
21
26
  "ChoiceLogprobsContentTopLogprob",
@@ -36,6 +41,7 @@ class ChoiceMessageAnnotationURLCitation(BaseModel):
36
41
 
37
42
  url: str
38
43
 
44
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
39
45
  if TYPE_CHECKING:
40
46
  # Stub to indicate that arbitrary properties are accepted.
41
47
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -48,6 +54,7 @@ class ChoiceMessageAnnotation(BaseModel):
48
54
 
49
55
  url_citation: ChoiceMessageAnnotationURLCitation
50
56
 
57
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
51
58
  if TYPE_CHECKING:
52
59
  # Stub to indicate that arbitrary properties are accepted.
53
60
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -64,6 +71,7 @@ class ChoiceMessageAudio(BaseModel):
64
71
 
65
72
  transcript: str
66
73
 
74
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
67
75
  if TYPE_CHECKING:
68
76
  # Stub to indicate that arbitrary properties are accepted.
69
77
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -76,6 +84,7 @@ class ChoiceMessageFunctionCall(BaseModel):
76
84
 
77
85
  name: str
78
86
 
87
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
79
88
  if TYPE_CHECKING:
80
89
  # Stub to indicate that arbitrary properties are accepted.
81
90
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -83,11 +92,12 @@ class ChoiceMessageFunctionCall(BaseModel):
83
92
  def __getattr__(self, attr: str) -> object: ...
84
93
 
85
94
 
86
- class ChoiceMessageToolCallFunction(BaseModel):
95
+ class ChoiceMessageToolCallChatCompletionMessageFunctionToolCallFunction(BaseModel):
87
96
  arguments: str
88
97
 
89
98
  name: str
90
99
 
100
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
91
101
  if TYPE_CHECKING:
92
102
  # Stub to indicate that arbitrary properties are accepted.
93
103
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -95,13 +105,14 @@ class ChoiceMessageToolCallFunction(BaseModel):
95
105
  def __getattr__(self, attr: str) -> object: ...
96
106
 
97
107
 
98
- class ChoiceMessageToolCall(BaseModel):
108
+ class ChoiceMessageToolCallChatCompletionMessageFunctionToolCall(BaseModel):
99
109
  id: str
100
110
 
101
- function: ChoiceMessageToolCallFunction
111
+ function: ChoiceMessageToolCallChatCompletionMessageFunctionToolCallFunction
102
112
 
103
113
  type: Literal["function"]
104
114
 
115
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
105
116
  if TYPE_CHECKING:
106
117
  # Stub to indicate that arbitrary properties are accepted.
107
118
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -109,6 +120,39 @@ class ChoiceMessageToolCall(BaseModel):
109
120
  def __getattr__(self, attr: str) -> object: ...
110
121
 
111
122
 
123
+ class ChoiceMessageToolCallChatCompletionMessageCustomToolCallCustom(BaseModel):
124
+ input: str
125
+
126
+ name: str
127
+
128
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
129
+ if TYPE_CHECKING:
130
+ # Stub to indicate that arbitrary properties are accepted.
131
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
132
+ # `getattr(obj, '$type')`
133
+ def __getattr__(self, attr: str) -> object: ...
134
+
135
+
136
+ class ChoiceMessageToolCallChatCompletionMessageCustomToolCall(BaseModel):
137
+ id: str
138
+
139
+ custom: ChoiceMessageToolCallChatCompletionMessageCustomToolCallCustom
140
+
141
+ type: Literal["custom"]
142
+
143
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
144
+ if TYPE_CHECKING:
145
+ # Stub to indicate that arbitrary properties are accepted.
146
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
147
+ # `getattr(obj, '$type')`
148
+ def __getattr__(self, attr: str) -> object: ...
149
+
150
+
151
+ ChoiceMessageToolCall: TypeAlias = Union[
152
+ ChoiceMessageToolCallChatCompletionMessageFunctionToolCall, ChoiceMessageToolCallChatCompletionMessageCustomToolCall
153
+ ]
154
+
155
+
112
156
  class ChoiceMessage(BaseModel):
113
157
  role: Literal["assistant"]
114
158
 
@@ -124,6 +168,7 @@ class ChoiceMessage(BaseModel):
124
168
 
125
169
  tool_calls: Optional[List[ChoiceMessageToolCall]] = None
126
170
 
171
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
127
172
  if TYPE_CHECKING:
128
173
  # Stub to indicate that arbitrary properties are accepted.
129
174
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -138,6 +183,7 @@ class ChoiceLogprobsContentTopLogprob(BaseModel):
138
183
 
139
184
  bytes: Optional[List[int]] = None
140
185
 
186
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
141
187
  if TYPE_CHECKING:
142
188
  # Stub to indicate that arbitrary properties are accepted.
143
189
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -154,6 +200,7 @@ class ChoiceLogprobsContent(BaseModel):
154
200
 
155
201
  bytes: Optional[List[int]] = None
156
202
 
203
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
157
204
  if TYPE_CHECKING:
158
205
  # Stub to indicate that arbitrary properties are accepted.
159
206
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -168,6 +215,7 @@ class ChoiceLogprobsRefusalTopLogprob(BaseModel):
168
215
 
169
216
  bytes: Optional[List[int]] = None
170
217
 
218
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
171
219
  if TYPE_CHECKING:
172
220
  # Stub to indicate that arbitrary properties are accepted.
173
221
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -184,6 +232,7 @@ class ChoiceLogprobsRefusal(BaseModel):
184
232
 
185
233
  bytes: Optional[List[int]] = None
186
234
 
235
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
187
236
  if TYPE_CHECKING:
188
237
  # Stub to indicate that arbitrary properties are accepted.
189
238
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -196,6 +245,7 @@ class ChoiceLogprobs(BaseModel):
196
245
 
197
246
  refusal: Optional[List[ChoiceLogprobsRefusal]] = None
198
247
 
248
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
199
249
  if TYPE_CHECKING:
200
250
  # Stub to indicate that arbitrary properties are accepted.
201
251
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -212,6 +262,7 @@ class Choice(BaseModel):
212
262
 
213
263
  logprobs: Optional[ChoiceLogprobs] = None
214
264
 
265
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
215
266
  if TYPE_CHECKING:
216
267
  # Stub to indicate that arbitrary properties are accepted.
217
268
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -228,6 +279,7 @@ class UsageCompletionTokensDetails(BaseModel):
228
279
 
229
280
  rejected_prediction_tokens: Optional[int] = None
230
281
 
282
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
231
283
  if TYPE_CHECKING:
232
284
  # Stub to indicate that arbitrary properties are accepted.
233
285
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -240,6 +292,7 @@ class UsagePromptTokensDetails(BaseModel):
240
292
 
241
293
  cached_tokens: Optional[int] = None
242
294
 
295
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
243
296
  if TYPE_CHECKING:
244
297
  # Stub to indicate that arbitrary properties are accepted.
245
298
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -258,6 +311,7 @@ class Usage(BaseModel):
258
311
 
259
312
  prompt_tokens_details: Optional[UsagePromptTokensDetails] = None
260
313
 
314
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
261
315
  if TYPE_CHECKING:
262
316
  # Stub to indicate that arbitrary properties are accepted.
263
317
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -282,6 +336,7 @@ class ChatCompletion(BaseModel):
282
336
 
283
337
  usage: Optional[Usage] = None
284
338
 
339
+ __pydantic_extra__: Dict[str, builtins.object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
285
340
  if TYPE_CHECKING:
286
341
  # Stub to indicate that arbitrary properties are accepted.
287
342
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -1,9 +1,11 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import builtins
4
- from typing import TYPE_CHECKING, List, Optional
4
+ from typing import TYPE_CHECKING, Dict, List, Optional
5
5
  from typing_extensions import Literal
6
6
 
7
+ from pydantic import Field as FieldInfo
8
+
7
9
  from ..._models import BaseModel
8
10
 
9
11
  __all__ = [
@@ -29,6 +31,7 @@ class ChoiceDeltaFunctionCall(BaseModel):
29
31
 
30
32
  name: Optional[str] = None
31
33
 
34
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
32
35
  if TYPE_CHECKING:
33
36
  # Stub to indicate that arbitrary properties are accepted.
34
37
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -41,6 +44,7 @@ class ChoiceDeltaToolCallFunction(BaseModel):
41
44
 
42
45
  name: Optional[str] = None
43
46
 
47
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
44
48
  if TYPE_CHECKING:
45
49
  # Stub to indicate that arbitrary properties are accepted.
46
50
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -57,6 +61,7 @@ class ChoiceDeltaToolCall(BaseModel):
57
61
 
58
62
  type: Optional[Literal["function"]] = None
59
63
 
64
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
60
65
  if TYPE_CHECKING:
61
66
  # Stub to indicate that arbitrary properties are accepted.
62
67
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -75,6 +80,7 @@ class ChoiceDelta(BaseModel):
75
80
 
76
81
  tool_calls: Optional[List[ChoiceDeltaToolCall]] = None
77
82
 
83
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
78
84
  if TYPE_CHECKING:
79
85
  # Stub to indicate that arbitrary properties are accepted.
80
86
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -89,6 +95,7 @@ class ChoiceLogprobsContentTopLogprob(BaseModel):
89
95
 
90
96
  bytes: Optional[List[int]] = None
91
97
 
98
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
92
99
  if TYPE_CHECKING:
93
100
  # Stub to indicate that arbitrary properties are accepted.
94
101
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -105,6 +112,7 @@ class ChoiceLogprobsContent(BaseModel):
105
112
 
106
113
  bytes: Optional[List[int]] = None
107
114
 
115
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
108
116
  if TYPE_CHECKING:
109
117
  # Stub to indicate that arbitrary properties are accepted.
110
118
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -119,6 +127,7 @@ class ChoiceLogprobsRefusalTopLogprob(BaseModel):
119
127
 
120
128
  bytes: Optional[List[int]] = None
121
129
 
130
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
122
131
  if TYPE_CHECKING:
123
132
  # Stub to indicate that arbitrary properties are accepted.
124
133
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -135,6 +144,7 @@ class ChoiceLogprobsRefusal(BaseModel):
135
144
 
136
145
  bytes: Optional[List[int]] = None
137
146
 
147
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
138
148
  if TYPE_CHECKING:
139
149
  # Stub to indicate that arbitrary properties are accepted.
140
150
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -147,6 +157,7 @@ class ChoiceLogprobs(BaseModel):
147
157
 
148
158
  refusal: Optional[List[ChoiceLogprobsRefusal]] = None
149
159
 
160
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
150
161
  if TYPE_CHECKING:
151
162
  # Stub to indicate that arbitrary properties are accepted.
152
163
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -163,6 +174,7 @@ class Choice(BaseModel):
163
174
 
164
175
  logprobs: Optional[ChoiceLogprobs] = None
165
176
 
177
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
166
178
  if TYPE_CHECKING:
167
179
  # Stub to indicate that arbitrary properties are accepted.
168
180
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -179,6 +191,7 @@ class UsageCompletionTokensDetails(BaseModel):
179
191
 
180
192
  rejected_prediction_tokens: Optional[int] = None
181
193
 
194
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
182
195
  if TYPE_CHECKING:
183
196
  # Stub to indicate that arbitrary properties are accepted.
184
197
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -191,6 +204,7 @@ class UsagePromptTokensDetails(BaseModel):
191
204
 
192
205
  cached_tokens: Optional[int] = None
193
206
 
207
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
194
208
  if TYPE_CHECKING:
195
209
  # Stub to indicate that arbitrary properties are accepted.
196
210
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -209,6 +223,7 @@ class Usage(BaseModel):
209
223
 
210
224
  prompt_tokens_details: Optional[UsagePromptTokensDetails] = None
211
225
 
226
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
212
227
  if TYPE_CHECKING:
213
228
  # Stub to indicate that arbitrary properties are accepted.
214
229
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -233,6 +248,7 @@ class ChatCompletionChunk(BaseModel):
233
248
 
234
249
  usage: Optional[Usage] = None
235
250
 
251
+ __pydantic_extra__: Dict[str, builtins.object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
236
252
  if TYPE_CHECKING:
237
253
  # Stub to indicate that arbitrary properties are accepted.
238
254
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -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
@@ -8,6 +8,8 @@ __all__ = ["CompletionModelsParams"]
8
8
 
9
9
 
10
10
  class CompletionModelsParams(TypedDict, total=False):
11
+ check_availability: bool
12
+
11
13
  ending_before: str
12
14
 
13
15
  limit: int
@@ -1,5 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ from typing import Optional
3
4
  from typing_extensions import Literal
4
5
 
5
6
  from pydantic import Field as FieldInfo
@@ -31,3 +32,8 @@ class ModelDefinition(BaseModel):
31
32
  "fireworks_ai",
32
33
  ] = FieldInfo(alias="model_vendor")
33
34
  """model vendor, for example `openai`"""
35
+
36
+ availability: Optional[Literal["unknown", "available", "unavailable"]] = FieldInfo(
37
+ alias="model_availability", default=None
38
+ )
39
+ """model availability indicating availability status, for example `available`"""
@@ -4,6 +4,8 @@ import builtins
4
4
  from typing import TYPE_CHECKING, Dict, List, Optional
5
5
  from typing_extensions import Literal
6
6
 
7
+ from pydantic import Field as FieldInfo
8
+
7
9
  from .._models import BaseModel
8
10
 
9
11
  __all__ = [
@@ -25,6 +27,7 @@ class ChoiceLogprobs(BaseModel):
25
27
 
26
28
  top_logprobs: Optional[List[Dict[str, float]]] = None
27
29
 
30
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
28
31
  if TYPE_CHECKING:
29
32
  # Stub to indicate that arbitrary properties are accepted.
30
33
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -41,6 +44,7 @@ class Choice(BaseModel):
41
44
 
42
45
  logprobs: Optional[ChoiceLogprobs] = None
43
46
 
47
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
44
48
  if TYPE_CHECKING:
45
49
  # Stub to indicate that arbitrary properties are accepted.
46
50
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -57,6 +61,7 @@ class UsageCompletionTokensDetails(BaseModel):
57
61
 
58
62
  rejected_prediction_tokens: Optional[int] = None
59
63
 
64
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
60
65
  if TYPE_CHECKING:
61
66
  # Stub to indicate that arbitrary properties are accepted.
62
67
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -69,6 +74,7 @@ class UsagePromptTokensDetails(BaseModel):
69
74
 
70
75
  cached_tokens: Optional[int] = None
71
76
 
77
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
72
78
  if TYPE_CHECKING:
73
79
  # Stub to indicate that arbitrary properties are accepted.
74
80
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -87,6 +93,7 @@ class Usage(BaseModel):
87
93
 
88
94
  prompt_tokens_details: Optional[UsagePromptTokensDetails] = None
89
95
 
96
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
90
97
  if TYPE_CHECKING:
91
98
  # Stub to indicate that arbitrary properties are accepted.
92
99
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -109,6 +116,7 @@ class Completion(BaseModel):
109
116
 
110
117
  usage: Optional[Usage] = None
111
118
 
119
+ __pydantic_extra__: Dict[str, builtins.object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
112
120
  if TYPE_CHECKING:
113
121
  # Stub to indicate that arbitrary properties are accepted.
114
122
  # To access properties that are not valid identifiers you can use `getattr`, e.g.
@@ -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]
@@ -27,9 +27,3 @@ class Container(BaseModel):
27
27
  Based on CSS `flex-direction` (see:
28
28
  https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction)
29
29
  """
30
-
31
-
32
- if PYDANTIC_V2:
33
- Container.model_rebuild()
34
- else:
35
- Container.update_forward_refs() # type: ignore
@@ -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]
@@ -5,6 +5,7 @@ from datetime import datetime
5
5
  from typing_extensions import Literal
6
6
 
7
7
  from .._models import BaseModel
8
+ from .shared.identity import Identity
8
9
 
9
10
  __all__ = ["Dataset"]
10
11
 
@@ -14,7 +15,8 @@ class Dataset(BaseModel):
14
15
 
15
16
  created_at: datetime
16
17
 
17
- created_by_user_id: str
18
+ created_by: Identity
19
+ """The identity that created the entity."""
18
20
 
19
21
  current_version_num: int
20
22
 
@@ -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"""
@@ -5,6 +5,7 @@ from datetime import datetime
5
5
  from typing_extensions import Literal
6
6
 
7
7
  from .._models import BaseModel
8
+ from .shared.identity import Identity
8
9
 
9
10
  __all__ = ["DatasetItem"]
10
11
 
@@ -16,7 +17,8 @@ class DatasetItem(BaseModel):
16
17
 
17
18
  created_at: datetime
18
19
 
19
- created_by_user_id: str
20
+ created_by: Identity
21
+ """The identity that created the entity."""
20
22
 
21
23
  data: object
22
24
 
@@ -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,13 +2,13 @@
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
 
9
9
  from .dataset import Dataset
10
- from .._compat import PYDANTIC_V2
11
10
  from .._models import BaseModel
11
+ from .shared.identity import Identity
12
12
 
13
13
  __all__ = ["Evaluation"]
14
14
 
@@ -18,7 +18,8 @@ class Evaluation(BaseModel):
18
18
 
19
19
  created_at: datetime
20
20
 
21
- created_by_user_id: str
21
+ created_by: Identity
22
+ """The identity that created the entity."""
22
23
 
23
24
  datasets: List[Dataset]
24
25
 
@@ -33,6 +34,9 @@ class Evaluation(BaseModel):
33
34
 
34
35
  description: Optional[str] = None
35
36
 
37
+ metadata: Optional[Dict[str, object]] = None
38
+ """Metadata key-value pairs for the evaluation"""
39
+
36
40
  object: Optional[Literal["evaluation"]] = None
37
41
 
38
42
  tasks: Optional[List["EvaluationTask"]] = None
@@ -40,8 +44,3 @@ class Evaluation(BaseModel):
40
44
 
41
45
 
42
46
  from .evaluation_task import EvaluationTask
43
-
44
- if PYDANTIC_V2:
45
- Evaluation.model_rebuild()
46
- else:
47
- Evaluation.update_forward_refs() # type: ignore