nimble_python 0.14.0__py3-none-any.whl → 0.16.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nimble_python/_qs.py +4 -1
- nimble_python/_version.py +1 -1
- nimble_python/resources/agent.py +495 -12
- nimble_python/types/__init__.py +7 -0
- nimble_python/types/agent_generate_params.py +31 -0
- nimble_python/types/agent_generate_response.py +32 -0
- nimble_python/types/agent_get_generation_response.py +32 -0
- nimble_python/types/agent_publish_params.py +11 -0
- nimble_python/types/agent_publish_response.py +11 -0
- nimble_python/types/agent_run_async_params.py +5 -2
- nimble_python/types/agent_run_batch_params.py +34 -0
- nimble_python/types/agent_run_batch_response.py +68 -0
- nimble_python/types/agent_run_params.py +5 -2
- nimble_python/types/agent_run_response.py +3 -0
- nimble_python/types/extract_response.py +3 -0
- {nimble_python-0.14.0.dist-info → nimble_python-0.16.0.dist-info}/METADATA +1 -1
- {nimble_python-0.14.0.dist-info → nimble_python-0.16.0.dist-info}/RECORD +19 -12
- {nimble_python-0.14.0.dist-info → nimble_python-0.16.0.dist-info}/WHEEL +0 -0
- {nimble_python-0.14.0.dist-info → nimble_python-0.16.0.dist-info}/licenses/LICENSE +0 -0
nimble_python/_qs.py
CHANGED
|
@@ -101,7 +101,10 @@ class Querystring:
|
|
|
101
101
|
items.extend(self._stringify_item(key, item, opts))
|
|
102
102
|
return items
|
|
103
103
|
elif array_format == "indices":
|
|
104
|
-
|
|
104
|
+
items = []
|
|
105
|
+
for i, item in enumerate(value):
|
|
106
|
+
items.extend(self._stringify_item(f"{key}[{i}]", item, opts))
|
|
107
|
+
return items
|
|
105
108
|
elif array_format == "brackets":
|
|
106
109
|
items = []
|
|
107
110
|
key = key + "[]"
|
nimble_python/_version.py
CHANGED
nimble_python/resources/agent.py
CHANGED
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, Optional
|
|
6
|
-
from typing_extensions import Literal
|
|
5
|
+
from typing import Dict, List, Iterable, Optional
|
|
6
|
+
from typing_extensions import Literal, overload
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..types import
|
|
10
|
+
from ..types import (
|
|
11
|
+
agent_run_params,
|
|
12
|
+
agent_list_params,
|
|
13
|
+
agent_publish_params,
|
|
14
|
+
agent_generate_params,
|
|
15
|
+
agent_run_async_params,
|
|
16
|
+
agent_run_batch_params,
|
|
17
|
+
)
|
|
11
18
|
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
12
|
-
from .._utils import path_template, maybe_transform, async_maybe_transform
|
|
19
|
+
from .._utils import path_template, required_args, maybe_transform, async_maybe_transform
|
|
13
20
|
from .._compat import cached_property
|
|
14
21
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
15
22
|
from .._response import (
|
|
@@ -22,7 +29,11 @@ from .._base_client import make_request_options
|
|
|
22
29
|
from ..types.agent_get_response import AgentGetResponse
|
|
23
30
|
from ..types.agent_run_response import AgentRunResponse
|
|
24
31
|
from ..types.agent_list_response import AgentListResponse
|
|
32
|
+
from ..types.agent_publish_response import AgentPublishResponse
|
|
33
|
+
from ..types.agent_generate_response import AgentGenerateResponse
|
|
25
34
|
from ..types.agent_run_async_response import AgentRunAsyncResponse
|
|
35
|
+
from ..types.agent_run_batch_response import AgentRunBatchResponse
|
|
36
|
+
from ..types.agent_get_generation_response import AgentGetGenerationResponse
|
|
26
37
|
|
|
27
38
|
__all__ = ["AgentResource", "AsyncAgentResource"]
|
|
28
39
|
|
|
@@ -63,7 +74,7 @@ class AgentResource(SyncAPIResource):
|
|
|
63
74
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
75
|
) -> AgentListResponse:
|
|
65
76
|
"""
|
|
66
|
-
List Templates
|
|
77
|
+
List Agent Templates
|
|
67
78
|
|
|
68
79
|
Args:
|
|
69
80
|
limit: Number of results per page
|
|
@@ -105,6 +116,102 @@ class AgentResource(SyncAPIResource):
|
|
|
105
116
|
cast_to=AgentListResponse,
|
|
106
117
|
)
|
|
107
118
|
|
|
119
|
+
@overload
|
|
120
|
+
def generate(
|
|
121
|
+
self,
|
|
122
|
+
*,
|
|
123
|
+
agent_name: str,
|
|
124
|
+
prompt: str,
|
|
125
|
+
url: str,
|
|
126
|
+
input_schema: object | Omit = omit,
|
|
127
|
+
metadata: Optional[object] | Omit = omit,
|
|
128
|
+
output_schema: object | Omit = omit,
|
|
129
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
130
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
131
|
+
extra_headers: Headers | None = None,
|
|
132
|
+
extra_query: Query | None = None,
|
|
133
|
+
extra_body: Body | None = None,
|
|
134
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
135
|
+
) -> AgentGenerateResponse:
|
|
136
|
+
"""
|
|
137
|
+
Create Agent Generation
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
extra_headers: Send extra headers
|
|
141
|
+
|
|
142
|
+
extra_query: Add additional query parameters to the request
|
|
143
|
+
|
|
144
|
+
extra_body: Add additional JSON properties to the request
|
|
145
|
+
|
|
146
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
147
|
+
"""
|
|
148
|
+
...
|
|
149
|
+
|
|
150
|
+
@overload
|
|
151
|
+
def generate(
|
|
152
|
+
self,
|
|
153
|
+
*,
|
|
154
|
+
from_agent: str,
|
|
155
|
+
prompt: str,
|
|
156
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
157
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
158
|
+
extra_headers: Headers | None = None,
|
|
159
|
+
extra_query: Query | None = None,
|
|
160
|
+
extra_body: Body | None = None,
|
|
161
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
162
|
+
) -> AgentGenerateResponse:
|
|
163
|
+
"""
|
|
164
|
+
Create Agent Generation
|
|
165
|
+
|
|
166
|
+
Args:
|
|
167
|
+
extra_headers: Send extra headers
|
|
168
|
+
|
|
169
|
+
extra_query: Add additional query parameters to the request
|
|
170
|
+
|
|
171
|
+
extra_body: Add additional JSON properties to the request
|
|
172
|
+
|
|
173
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
174
|
+
"""
|
|
175
|
+
...
|
|
176
|
+
|
|
177
|
+
@required_args(["agent_name", "prompt", "url"], ["from_agent", "prompt"])
|
|
178
|
+
def generate(
|
|
179
|
+
self,
|
|
180
|
+
*,
|
|
181
|
+
agent_name: str | Omit = omit,
|
|
182
|
+
prompt: str,
|
|
183
|
+
url: str | Omit = omit,
|
|
184
|
+
input_schema: object | Omit = omit,
|
|
185
|
+
metadata: Optional[object] | Omit = omit,
|
|
186
|
+
output_schema: object | Omit = omit,
|
|
187
|
+
from_agent: str | Omit = omit,
|
|
188
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
189
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
190
|
+
extra_headers: Headers | None = None,
|
|
191
|
+
extra_query: Query | None = None,
|
|
192
|
+
extra_body: Body | None = None,
|
|
193
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
194
|
+
) -> AgentGenerateResponse:
|
|
195
|
+
return self._post(
|
|
196
|
+
"/v1/agents/generations",
|
|
197
|
+
body=maybe_transform(
|
|
198
|
+
{
|
|
199
|
+
"agent_name": agent_name,
|
|
200
|
+
"prompt": prompt,
|
|
201
|
+
"url": url,
|
|
202
|
+
"input_schema": input_schema,
|
|
203
|
+
"metadata": metadata,
|
|
204
|
+
"output_schema": output_schema,
|
|
205
|
+
"from_agent": from_agent,
|
|
206
|
+
},
|
|
207
|
+
agent_generate_params.AgentGenerateParams,
|
|
208
|
+
),
|
|
209
|
+
options=make_request_options(
|
|
210
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
211
|
+
),
|
|
212
|
+
cast_to=AgentGenerateResponse,
|
|
213
|
+
)
|
|
214
|
+
|
|
108
215
|
def get(
|
|
109
216
|
self,
|
|
110
217
|
template_name: str,
|
|
@@ -117,7 +224,7 @@ class AgentResource(SyncAPIResource):
|
|
|
117
224
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
118
225
|
) -> AgentGetResponse:
|
|
119
226
|
"""
|
|
120
|
-
Get Template
|
|
227
|
+
Get Agent Template
|
|
121
228
|
|
|
122
229
|
Args:
|
|
123
230
|
extra_headers: Send extra headers
|
|
@@ -138,11 +245,80 @@ class AgentResource(SyncAPIResource):
|
|
|
138
245
|
cast_to=AgentGetResponse,
|
|
139
246
|
)
|
|
140
247
|
|
|
248
|
+
def get_generation(
|
|
249
|
+
self,
|
|
250
|
+
generation_id: str,
|
|
251
|
+
*,
|
|
252
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
253
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
254
|
+
extra_headers: Headers | None = None,
|
|
255
|
+
extra_query: Query | None = None,
|
|
256
|
+
extra_body: Body | None = None,
|
|
257
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
258
|
+
) -> AgentGetGenerationResponse:
|
|
259
|
+
"""
|
|
260
|
+
Get Agent Generation
|
|
261
|
+
|
|
262
|
+
Args:
|
|
263
|
+
extra_headers: Send extra headers
|
|
264
|
+
|
|
265
|
+
extra_query: Add additional query parameters to the request
|
|
266
|
+
|
|
267
|
+
extra_body: Add additional JSON properties to the request
|
|
268
|
+
|
|
269
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
270
|
+
"""
|
|
271
|
+
if not generation_id:
|
|
272
|
+
raise ValueError(f"Expected a non-empty value for `generation_id` but received {generation_id!r}")
|
|
273
|
+
return self._get(
|
|
274
|
+
path_template("/v1/agents/generations/{generation_id}", generation_id=generation_id),
|
|
275
|
+
options=make_request_options(
|
|
276
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
277
|
+
),
|
|
278
|
+
cast_to=AgentGetGenerationResponse,
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
def publish(
|
|
282
|
+
self,
|
|
283
|
+
agent_name: str,
|
|
284
|
+
*,
|
|
285
|
+
version_id: str,
|
|
286
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
287
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
288
|
+
extra_headers: Headers | None = None,
|
|
289
|
+
extra_query: Query | None = None,
|
|
290
|
+
extra_body: Body | None = None,
|
|
291
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
292
|
+
) -> AgentPublishResponse:
|
|
293
|
+
"""
|
|
294
|
+
Publish Agent Version
|
|
295
|
+
|
|
296
|
+
Args:
|
|
297
|
+
extra_headers: Send extra headers
|
|
298
|
+
|
|
299
|
+
extra_query: Add additional query parameters to the request
|
|
300
|
+
|
|
301
|
+
extra_body: Add additional JSON properties to the request
|
|
302
|
+
|
|
303
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
304
|
+
"""
|
|
305
|
+
if not agent_name:
|
|
306
|
+
raise ValueError(f"Expected a non-empty value for `agent_name` but received {agent_name!r}")
|
|
307
|
+
return self._post(
|
|
308
|
+
path_template("/v1/agents/{agent_name}/publish", agent_name=agent_name),
|
|
309
|
+
body=maybe_transform({"version_id": version_id}, agent_publish_params.AgentPublishParams),
|
|
310
|
+
options=make_request_options(
|
|
311
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
312
|
+
),
|
|
313
|
+
cast_to=AgentPublishResponse,
|
|
314
|
+
)
|
|
315
|
+
|
|
141
316
|
def run(
|
|
142
317
|
self,
|
|
143
318
|
*,
|
|
144
319
|
agent: str,
|
|
145
320
|
params: Dict[str, object],
|
|
321
|
+
formats: List[Literal["html", "markdown", "screenshot", "headers"]] | Omit = omit,
|
|
146
322
|
localization: bool | Omit = omit,
|
|
147
323
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
148
324
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -151,10 +327,13 @@ class AgentResource(SyncAPIResource):
|
|
|
151
327
|
extra_body: Body | None = None,
|
|
152
328
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
153
329
|
) -> AgentRunResponse:
|
|
154
|
-
"""
|
|
155
|
-
Execute WSA Realtime Endpoint
|
|
330
|
+
"""Execute WSA Realtime Endpoint
|
|
156
331
|
|
|
157
332
|
Args:
|
|
333
|
+
formats: Response formats to include.
|
|
334
|
+
|
|
335
|
+
All disabled by default.
|
|
336
|
+
|
|
158
337
|
extra_headers: Send extra headers
|
|
159
338
|
|
|
160
339
|
extra_query: Add additional query parameters to the request
|
|
@@ -169,6 +348,7 @@ class AgentResource(SyncAPIResource):
|
|
|
169
348
|
{
|
|
170
349
|
"agent": agent,
|
|
171
350
|
"params": params,
|
|
351
|
+
"formats": formats,
|
|
172
352
|
"localization": localization,
|
|
173
353
|
},
|
|
174
354
|
agent_run_params.AgentRunParams,
|
|
@@ -185,6 +365,7 @@ class AgentResource(SyncAPIResource):
|
|
|
185
365
|
agent: str,
|
|
186
366
|
params: Dict[str, object],
|
|
187
367
|
callback_url: str | Omit = omit,
|
|
368
|
+
formats: List[Literal["html", "markdown", "screenshot", "headers"]] | Omit = omit,
|
|
188
369
|
localization: bool | Omit = omit,
|
|
189
370
|
storage_compress: bool | Omit = omit,
|
|
190
371
|
storage_object_name: str | Omit = omit,
|
|
@@ -203,6 +384,8 @@ class AgentResource(SyncAPIResource):
|
|
|
203
384
|
Args:
|
|
204
385
|
callback_url: URL to call back when async operation completes
|
|
205
386
|
|
|
387
|
+
formats: Response formats to include. All disabled by default.
|
|
388
|
+
|
|
206
389
|
storage_compress: Whether to compress stored data
|
|
207
390
|
|
|
208
391
|
storage_object_name: Custom name for the stored object
|
|
@@ -226,6 +409,7 @@ class AgentResource(SyncAPIResource):
|
|
|
226
409
|
"agent": agent,
|
|
227
410
|
"params": params,
|
|
228
411
|
"callback_url": callback_url,
|
|
412
|
+
"formats": formats,
|
|
229
413
|
"localization": localization,
|
|
230
414
|
"storage_compress": storage_compress,
|
|
231
415
|
"storage_object_name": storage_object_name,
|
|
@@ -240,6 +424,45 @@ class AgentResource(SyncAPIResource):
|
|
|
240
424
|
cast_to=AgentRunAsyncResponse,
|
|
241
425
|
)
|
|
242
426
|
|
|
427
|
+
def run_batch(
|
|
428
|
+
self,
|
|
429
|
+
*,
|
|
430
|
+
inputs: Iterable[agent_run_batch_params.Input],
|
|
431
|
+
shared_inputs: agent_run_batch_params.SharedInputs,
|
|
432
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
433
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
434
|
+
extra_headers: Headers | None = None,
|
|
435
|
+
extra_query: Query | None = None,
|
|
436
|
+
extra_body: Body | None = None,
|
|
437
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
438
|
+
) -> AgentRunBatchResponse:
|
|
439
|
+
"""
|
|
440
|
+
Execute WSA Batch Endpoint
|
|
441
|
+
|
|
442
|
+
Args:
|
|
443
|
+
extra_headers: Send extra headers
|
|
444
|
+
|
|
445
|
+
extra_query: Add additional query parameters to the request
|
|
446
|
+
|
|
447
|
+
extra_body: Add additional JSON properties to the request
|
|
448
|
+
|
|
449
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
450
|
+
"""
|
|
451
|
+
return self._post(
|
|
452
|
+
"/v1/agents/batch",
|
|
453
|
+
body=maybe_transform(
|
|
454
|
+
{
|
|
455
|
+
"inputs": inputs,
|
|
456
|
+
"shared_inputs": shared_inputs,
|
|
457
|
+
},
|
|
458
|
+
agent_run_batch_params.AgentRunBatchParams,
|
|
459
|
+
),
|
|
460
|
+
options=make_request_options(
|
|
461
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
462
|
+
),
|
|
463
|
+
cast_to=AgentRunBatchResponse,
|
|
464
|
+
)
|
|
465
|
+
|
|
243
466
|
|
|
244
467
|
class AsyncAgentResource(AsyncAPIResource):
|
|
245
468
|
@cached_property
|
|
@@ -277,7 +500,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
277
500
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
278
501
|
) -> AgentListResponse:
|
|
279
502
|
"""
|
|
280
|
-
List Templates
|
|
503
|
+
List Agent Templates
|
|
281
504
|
|
|
282
505
|
Args:
|
|
283
506
|
limit: Number of results per page
|
|
@@ -319,6 +542,102 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
319
542
|
cast_to=AgentListResponse,
|
|
320
543
|
)
|
|
321
544
|
|
|
545
|
+
@overload
|
|
546
|
+
async def generate(
|
|
547
|
+
self,
|
|
548
|
+
*,
|
|
549
|
+
agent_name: str,
|
|
550
|
+
prompt: str,
|
|
551
|
+
url: str,
|
|
552
|
+
input_schema: object | Omit = omit,
|
|
553
|
+
metadata: Optional[object] | Omit = omit,
|
|
554
|
+
output_schema: object | Omit = omit,
|
|
555
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
556
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
557
|
+
extra_headers: Headers | None = None,
|
|
558
|
+
extra_query: Query | None = None,
|
|
559
|
+
extra_body: Body | None = None,
|
|
560
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
561
|
+
) -> AgentGenerateResponse:
|
|
562
|
+
"""
|
|
563
|
+
Create Agent Generation
|
|
564
|
+
|
|
565
|
+
Args:
|
|
566
|
+
extra_headers: Send extra headers
|
|
567
|
+
|
|
568
|
+
extra_query: Add additional query parameters to the request
|
|
569
|
+
|
|
570
|
+
extra_body: Add additional JSON properties to the request
|
|
571
|
+
|
|
572
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
573
|
+
"""
|
|
574
|
+
...
|
|
575
|
+
|
|
576
|
+
@overload
|
|
577
|
+
async def generate(
|
|
578
|
+
self,
|
|
579
|
+
*,
|
|
580
|
+
from_agent: str,
|
|
581
|
+
prompt: str,
|
|
582
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
583
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
584
|
+
extra_headers: Headers | None = None,
|
|
585
|
+
extra_query: Query | None = None,
|
|
586
|
+
extra_body: Body | None = None,
|
|
587
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
588
|
+
) -> AgentGenerateResponse:
|
|
589
|
+
"""
|
|
590
|
+
Create Agent Generation
|
|
591
|
+
|
|
592
|
+
Args:
|
|
593
|
+
extra_headers: Send extra headers
|
|
594
|
+
|
|
595
|
+
extra_query: Add additional query parameters to the request
|
|
596
|
+
|
|
597
|
+
extra_body: Add additional JSON properties to the request
|
|
598
|
+
|
|
599
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
600
|
+
"""
|
|
601
|
+
...
|
|
602
|
+
|
|
603
|
+
@required_args(["agent_name", "prompt", "url"], ["from_agent", "prompt"])
|
|
604
|
+
async def generate(
|
|
605
|
+
self,
|
|
606
|
+
*,
|
|
607
|
+
agent_name: str | Omit = omit,
|
|
608
|
+
prompt: str,
|
|
609
|
+
url: str | Omit = omit,
|
|
610
|
+
input_schema: object | Omit = omit,
|
|
611
|
+
metadata: Optional[object] | Omit = omit,
|
|
612
|
+
output_schema: object | Omit = omit,
|
|
613
|
+
from_agent: str | Omit = omit,
|
|
614
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
615
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
616
|
+
extra_headers: Headers | None = None,
|
|
617
|
+
extra_query: Query | None = None,
|
|
618
|
+
extra_body: Body | None = None,
|
|
619
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
620
|
+
) -> AgentGenerateResponse:
|
|
621
|
+
return await self._post(
|
|
622
|
+
"/v1/agents/generations",
|
|
623
|
+
body=await async_maybe_transform(
|
|
624
|
+
{
|
|
625
|
+
"agent_name": agent_name,
|
|
626
|
+
"prompt": prompt,
|
|
627
|
+
"url": url,
|
|
628
|
+
"input_schema": input_schema,
|
|
629
|
+
"metadata": metadata,
|
|
630
|
+
"output_schema": output_schema,
|
|
631
|
+
"from_agent": from_agent,
|
|
632
|
+
},
|
|
633
|
+
agent_generate_params.AgentGenerateParams,
|
|
634
|
+
),
|
|
635
|
+
options=make_request_options(
|
|
636
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
637
|
+
),
|
|
638
|
+
cast_to=AgentGenerateResponse,
|
|
639
|
+
)
|
|
640
|
+
|
|
322
641
|
async def get(
|
|
323
642
|
self,
|
|
324
643
|
template_name: str,
|
|
@@ -331,7 +650,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
331
650
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
332
651
|
) -> AgentGetResponse:
|
|
333
652
|
"""
|
|
334
|
-
Get Template
|
|
653
|
+
Get Agent Template
|
|
335
654
|
|
|
336
655
|
Args:
|
|
337
656
|
extra_headers: Send extra headers
|
|
@@ -352,11 +671,80 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
352
671
|
cast_to=AgentGetResponse,
|
|
353
672
|
)
|
|
354
673
|
|
|
674
|
+
async def get_generation(
|
|
675
|
+
self,
|
|
676
|
+
generation_id: str,
|
|
677
|
+
*,
|
|
678
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
679
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
680
|
+
extra_headers: Headers | None = None,
|
|
681
|
+
extra_query: Query | None = None,
|
|
682
|
+
extra_body: Body | None = None,
|
|
683
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
684
|
+
) -> AgentGetGenerationResponse:
|
|
685
|
+
"""
|
|
686
|
+
Get Agent Generation
|
|
687
|
+
|
|
688
|
+
Args:
|
|
689
|
+
extra_headers: Send extra headers
|
|
690
|
+
|
|
691
|
+
extra_query: Add additional query parameters to the request
|
|
692
|
+
|
|
693
|
+
extra_body: Add additional JSON properties to the request
|
|
694
|
+
|
|
695
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
696
|
+
"""
|
|
697
|
+
if not generation_id:
|
|
698
|
+
raise ValueError(f"Expected a non-empty value for `generation_id` but received {generation_id!r}")
|
|
699
|
+
return await self._get(
|
|
700
|
+
path_template("/v1/agents/generations/{generation_id}", generation_id=generation_id),
|
|
701
|
+
options=make_request_options(
|
|
702
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
703
|
+
),
|
|
704
|
+
cast_to=AgentGetGenerationResponse,
|
|
705
|
+
)
|
|
706
|
+
|
|
707
|
+
async def publish(
|
|
708
|
+
self,
|
|
709
|
+
agent_name: str,
|
|
710
|
+
*,
|
|
711
|
+
version_id: str,
|
|
712
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
713
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
714
|
+
extra_headers: Headers | None = None,
|
|
715
|
+
extra_query: Query | None = None,
|
|
716
|
+
extra_body: Body | None = None,
|
|
717
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
718
|
+
) -> AgentPublishResponse:
|
|
719
|
+
"""
|
|
720
|
+
Publish Agent Version
|
|
721
|
+
|
|
722
|
+
Args:
|
|
723
|
+
extra_headers: Send extra headers
|
|
724
|
+
|
|
725
|
+
extra_query: Add additional query parameters to the request
|
|
726
|
+
|
|
727
|
+
extra_body: Add additional JSON properties to the request
|
|
728
|
+
|
|
729
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
730
|
+
"""
|
|
731
|
+
if not agent_name:
|
|
732
|
+
raise ValueError(f"Expected a non-empty value for `agent_name` but received {agent_name!r}")
|
|
733
|
+
return await self._post(
|
|
734
|
+
path_template("/v1/agents/{agent_name}/publish", agent_name=agent_name),
|
|
735
|
+
body=await async_maybe_transform({"version_id": version_id}, agent_publish_params.AgentPublishParams),
|
|
736
|
+
options=make_request_options(
|
|
737
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
738
|
+
),
|
|
739
|
+
cast_to=AgentPublishResponse,
|
|
740
|
+
)
|
|
741
|
+
|
|
355
742
|
async def run(
|
|
356
743
|
self,
|
|
357
744
|
*,
|
|
358
745
|
agent: str,
|
|
359
746
|
params: Dict[str, object],
|
|
747
|
+
formats: List[Literal["html", "markdown", "screenshot", "headers"]] | Omit = omit,
|
|
360
748
|
localization: bool | Omit = omit,
|
|
361
749
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
362
750
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -365,10 +753,13 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
365
753
|
extra_body: Body | None = None,
|
|
366
754
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
367
755
|
) -> AgentRunResponse:
|
|
368
|
-
"""
|
|
369
|
-
Execute WSA Realtime Endpoint
|
|
756
|
+
"""Execute WSA Realtime Endpoint
|
|
370
757
|
|
|
371
758
|
Args:
|
|
759
|
+
formats: Response formats to include.
|
|
760
|
+
|
|
761
|
+
All disabled by default.
|
|
762
|
+
|
|
372
763
|
extra_headers: Send extra headers
|
|
373
764
|
|
|
374
765
|
extra_query: Add additional query parameters to the request
|
|
@@ -383,6 +774,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
383
774
|
{
|
|
384
775
|
"agent": agent,
|
|
385
776
|
"params": params,
|
|
777
|
+
"formats": formats,
|
|
386
778
|
"localization": localization,
|
|
387
779
|
},
|
|
388
780
|
agent_run_params.AgentRunParams,
|
|
@@ -399,6 +791,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
399
791
|
agent: str,
|
|
400
792
|
params: Dict[str, object],
|
|
401
793
|
callback_url: str | Omit = omit,
|
|
794
|
+
formats: List[Literal["html", "markdown", "screenshot", "headers"]] | Omit = omit,
|
|
402
795
|
localization: bool | Omit = omit,
|
|
403
796
|
storage_compress: bool | Omit = omit,
|
|
404
797
|
storage_object_name: str | Omit = omit,
|
|
@@ -417,6 +810,8 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
417
810
|
Args:
|
|
418
811
|
callback_url: URL to call back when async operation completes
|
|
419
812
|
|
|
813
|
+
formats: Response formats to include. All disabled by default.
|
|
814
|
+
|
|
420
815
|
storage_compress: Whether to compress stored data
|
|
421
816
|
|
|
422
817
|
storage_object_name: Custom name for the stored object
|
|
@@ -440,6 +835,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
440
835
|
"agent": agent,
|
|
441
836
|
"params": params,
|
|
442
837
|
"callback_url": callback_url,
|
|
838
|
+
"formats": formats,
|
|
443
839
|
"localization": localization,
|
|
444
840
|
"storage_compress": storage_compress,
|
|
445
841
|
"storage_object_name": storage_object_name,
|
|
@@ -454,6 +850,45 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
454
850
|
cast_to=AgentRunAsyncResponse,
|
|
455
851
|
)
|
|
456
852
|
|
|
853
|
+
async def run_batch(
|
|
854
|
+
self,
|
|
855
|
+
*,
|
|
856
|
+
inputs: Iterable[agent_run_batch_params.Input],
|
|
857
|
+
shared_inputs: agent_run_batch_params.SharedInputs,
|
|
858
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
859
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
860
|
+
extra_headers: Headers | None = None,
|
|
861
|
+
extra_query: Query | None = None,
|
|
862
|
+
extra_body: Body | None = None,
|
|
863
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
864
|
+
) -> AgentRunBatchResponse:
|
|
865
|
+
"""
|
|
866
|
+
Execute WSA Batch Endpoint
|
|
867
|
+
|
|
868
|
+
Args:
|
|
869
|
+
extra_headers: Send extra headers
|
|
870
|
+
|
|
871
|
+
extra_query: Add additional query parameters to the request
|
|
872
|
+
|
|
873
|
+
extra_body: Add additional JSON properties to the request
|
|
874
|
+
|
|
875
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
876
|
+
"""
|
|
877
|
+
return await self._post(
|
|
878
|
+
"/v1/agents/batch",
|
|
879
|
+
body=await async_maybe_transform(
|
|
880
|
+
{
|
|
881
|
+
"inputs": inputs,
|
|
882
|
+
"shared_inputs": shared_inputs,
|
|
883
|
+
},
|
|
884
|
+
agent_run_batch_params.AgentRunBatchParams,
|
|
885
|
+
),
|
|
886
|
+
options=make_request_options(
|
|
887
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
888
|
+
),
|
|
889
|
+
cast_to=AgentRunBatchResponse,
|
|
890
|
+
)
|
|
891
|
+
|
|
457
892
|
|
|
458
893
|
class AgentResourceWithRawResponse:
|
|
459
894
|
def __init__(self, agent: AgentResource) -> None:
|
|
@@ -462,15 +897,27 @@ class AgentResourceWithRawResponse:
|
|
|
462
897
|
self.list = to_raw_response_wrapper(
|
|
463
898
|
agent.list,
|
|
464
899
|
)
|
|
900
|
+
self.generate = to_raw_response_wrapper(
|
|
901
|
+
agent.generate,
|
|
902
|
+
)
|
|
465
903
|
self.get = to_raw_response_wrapper(
|
|
466
904
|
agent.get,
|
|
467
905
|
)
|
|
906
|
+
self.get_generation = to_raw_response_wrapper(
|
|
907
|
+
agent.get_generation,
|
|
908
|
+
)
|
|
909
|
+
self.publish = to_raw_response_wrapper(
|
|
910
|
+
agent.publish,
|
|
911
|
+
)
|
|
468
912
|
self.run = to_raw_response_wrapper(
|
|
469
913
|
agent.run,
|
|
470
914
|
)
|
|
471
915
|
self.run_async = to_raw_response_wrapper(
|
|
472
916
|
agent.run_async,
|
|
473
917
|
)
|
|
918
|
+
self.run_batch = to_raw_response_wrapper(
|
|
919
|
+
agent.run_batch,
|
|
920
|
+
)
|
|
474
921
|
|
|
475
922
|
|
|
476
923
|
class AsyncAgentResourceWithRawResponse:
|
|
@@ -480,15 +927,27 @@ class AsyncAgentResourceWithRawResponse:
|
|
|
480
927
|
self.list = async_to_raw_response_wrapper(
|
|
481
928
|
agent.list,
|
|
482
929
|
)
|
|
930
|
+
self.generate = async_to_raw_response_wrapper(
|
|
931
|
+
agent.generate,
|
|
932
|
+
)
|
|
483
933
|
self.get = async_to_raw_response_wrapper(
|
|
484
934
|
agent.get,
|
|
485
935
|
)
|
|
936
|
+
self.get_generation = async_to_raw_response_wrapper(
|
|
937
|
+
agent.get_generation,
|
|
938
|
+
)
|
|
939
|
+
self.publish = async_to_raw_response_wrapper(
|
|
940
|
+
agent.publish,
|
|
941
|
+
)
|
|
486
942
|
self.run = async_to_raw_response_wrapper(
|
|
487
943
|
agent.run,
|
|
488
944
|
)
|
|
489
945
|
self.run_async = async_to_raw_response_wrapper(
|
|
490
946
|
agent.run_async,
|
|
491
947
|
)
|
|
948
|
+
self.run_batch = async_to_raw_response_wrapper(
|
|
949
|
+
agent.run_batch,
|
|
950
|
+
)
|
|
492
951
|
|
|
493
952
|
|
|
494
953
|
class AgentResourceWithStreamingResponse:
|
|
@@ -498,15 +957,27 @@ class AgentResourceWithStreamingResponse:
|
|
|
498
957
|
self.list = to_streamed_response_wrapper(
|
|
499
958
|
agent.list,
|
|
500
959
|
)
|
|
960
|
+
self.generate = to_streamed_response_wrapper(
|
|
961
|
+
agent.generate,
|
|
962
|
+
)
|
|
501
963
|
self.get = to_streamed_response_wrapper(
|
|
502
964
|
agent.get,
|
|
503
965
|
)
|
|
966
|
+
self.get_generation = to_streamed_response_wrapper(
|
|
967
|
+
agent.get_generation,
|
|
968
|
+
)
|
|
969
|
+
self.publish = to_streamed_response_wrapper(
|
|
970
|
+
agent.publish,
|
|
971
|
+
)
|
|
504
972
|
self.run = to_streamed_response_wrapper(
|
|
505
973
|
agent.run,
|
|
506
974
|
)
|
|
507
975
|
self.run_async = to_streamed_response_wrapper(
|
|
508
976
|
agent.run_async,
|
|
509
977
|
)
|
|
978
|
+
self.run_batch = to_streamed_response_wrapper(
|
|
979
|
+
agent.run_batch,
|
|
980
|
+
)
|
|
510
981
|
|
|
511
982
|
|
|
512
983
|
class AsyncAgentResourceWithStreamingResponse:
|
|
@@ -516,12 +987,24 @@ class AsyncAgentResourceWithStreamingResponse:
|
|
|
516
987
|
self.list = async_to_streamed_response_wrapper(
|
|
517
988
|
agent.list,
|
|
518
989
|
)
|
|
990
|
+
self.generate = async_to_streamed_response_wrapper(
|
|
991
|
+
agent.generate,
|
|
992
|
+
)
|
|
519
993
|
self.get = async_to_streamed_response_wrapper(
|
|
520
994
|
agent.get,
|
|
521
995
|
)
|
|
996
|
+
self.get_generation = async_to_streamed_response_wrapper(
|
|
997
|
+
agent.get_generation,
|
|
998
|
+
)
|
|
999
|
+
self.publish = async_to_streamed_response_wrapper(
|
|
1000
|
+
agent.publish,
|
|
1001
|
+
)
|
|
522
1002
|
self.run = async_to_streamed_response_wrapper(
|
|
523
1003
|
agent.run,
|
|
524
1004
|
)
|
|
525
1005
|
self.run_async = async_to_streamed_response_wrapper(
|
|
526
1006
|
agent.run_async,
|
|
527
1007
|
)
|
|
1008
|
+
self.run_batch = async_to_streamed_response_wrapper(
|
|
1009
|
+
agent.run_batch,
|
|
1010
|
+
)
|
nimble_python/types/__init__.py
CHANGED
|
@@ -34,15 +34,22 @@ from .crawl_run_response import CrawlRunResponse as CrawlRunResponse
|
|
|
34
34
|
from .task_list_response import TaskListResponse as TaskListResponse
|
|
35
35
|
from .agent_list_response import AgentListResponse as AgentListResponse
|
|
36
36
|
from .crawl_list_response import CrawlListResponse as CrawlListResponse
|
|
37
|
+
from .agent_publish_params import AgentPublishParams as AgentPublishParams
|
|
37
38
|
from .client_search_params import ClientSearchParams as ClientSearchParams
|
|
39
|
+
from .agent_generate_params import AgentGenerateParams as AgentGenerateParams
|
|
38
40
|
from .client_extract_params import ClientExtractParams as ClientExtractParams
|
|
39
41
|
from .crawl_status_response import CrawlStatusResponse as CrawlStatusResponse
|
|
40
42
|
from .task_results_response import TaskResultsResponse as TaskResultsResponse
|
|
43
|
+
from .agent_publish_response import AgentPublishResponse as AgentPublishResponse
|
|
41
44
|
from .agent_run_async_params import AgentRunAsyncParams as AgentRunAsyncParams
|
|
45
|
+
from .agent_run_batch_params import AgentRunBatchParams as AgentRunBatchParams
|
|
42
46
|
from .extract_async_response import ExtractAsyncResponse as ExtractAsyncResponse
|
|
43
47
|
from .extract_batch_response import ExtractBatchResponse as ExtractBatchResponse
|
|
48
|
+
from .agent_generate_response import AgentGenerateResponse as AgentGenerateResponse
|
|
44
49
|
from .batch_progress_response import BatchProgressResponse as BatchProgressResponse
|
|
45
50
|
from .agent_run_async_response import AgentRunAsyncResponse as AgentRunAsyncResponse
|
|
51
|
+
from .agent_run_batch_response import AgentRunBatchResponse as AgentRunBatchResponse
|
|
46
52
|
from .crawl_terminate_response import CrawlTerminateResponse as CrawlTerminateResponse
|
|
47
53
|
from .client_extract_async_params import ClientExtractAsyncParams as ClientExtractAsyncParams
|
|
48
54
|
from .client_extract_batch_params import ClientExtractBatchParams as ClientExtractBatchParams
|
|
55
|
+
from .agent_get_generation_response import AgentGetGenerationResponse as AgentGetGenerationResponse
|
|
@@ -0,0 +1,31 @@
|
|
|
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 Union, Optional
|
|
6
|
+
from typing_extensions import Required, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["AgentGenerateParams", "CreateAgentGenerationRequest", "CreateAgentRefinementRequest"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CreateAgentGenerationRequest(TypedDict, total=False):
|
|
12
|
+
agent_name: Required[str]
|
|
13
|
+
|
|
14
|
+
prompt: Required[str]
|
|
15
|
+
|
|
16
|
+
url: Required[str]
|
|
17
|
+
|
|
18
|
+
input_schema: object
|
|
19
|
+
|
|
20
|
+
metadata: Optional[object]
|
|
21
|
+
|
|
22
|
+
output_schema: object
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class CreateAgentRefinementRequest(TypedDict, total=False):
|
|
26
|
+
from_agent: Required[str]
|
|
27
|
+
|
|
28
|
+
prompt: Required[str]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
AgentGenerateParams: TypeAlias = Union[CreateAgentGenerationRequest, CreateAgentRefinementRequest]
|
|
@@ -0,0 +1,32 @@
|
|
|
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__ = ["AgentGenerateResponse"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AgentGenerateResponse(BaseModel):
|
|
12
|
+
id: str
|
|
13
|
+
|
|
14
|
+
status: str
|
|
15
|
+
|
|
16
|
+
agent_name: Optional[str] = None
|
|
17
|
+
|
|
18
|
+
completed_at: Optional[datetime] = None
|
|
19
|
+
|
|
20
|
+
created_at: Optional[datetime] = None
|
|
21
|
+
|
|
22
|
+
error: Optional[str] = None
|
|
23
|
+
|
|
24
|
+
generated_version: Optional[object] = None
|
|
25
|
+
|
|
26
|
+
generated_version_id: Optional[str] = None
|
|
27
|
+
|
|
28
|
+
source_version_id: Optional[str] = None
|
|
29
|
+
|
|
30
|
+
started_at: Optional[datetime] = None
|
|
31
|
+
|
|
32
|
+
summary: Optional[str] = None
|
|
@@ -0,0 +1,32 @@
|
|
|
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__ = ["AgentGetGenerationResponse"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AgentGetGenerationResponse(BaseModel):
|
|
12
|
+
id: str
|
|
13
|
+
|
|
14
|
+
status: str
|
|
15
|
+
|
|
16
|
+
agent_name: Optional[str] = None
|
|
17
|
+
|
|
18
|
+
completed_at: Optional[datetime] = None
|
|
19
|
+
|
|
20
|
+
created_at: Optional[datetime] = None
|
|
21
|
+
|
|
22
|
+
error: Optional[str] = None
|
|
23
|
+
|
|
24
|
+
generated_version: Optional[object] = None
|
|
25
|
+
|
|
26
|
+
generated_version_id: Optional[str] = None
|
|
27
|
+
|
|
28
|
+
source_version_id: Optional[str] = None
|
|
29
|
+
|
|
30
|
+
started_at: Optional[datetime] = None
|
|
31
|
+
|
|
32
|
+
summary: Optional[str] = None
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Required, TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["AgentPublishParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AgentPublishParams(TypedDict, total=False):
|
|
11
|
+
version_id: Required[str]
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict
|
|
6
|
-
from typing_extensions import Required, TypedDict
|
|
5
|
+
from typing import Dict, List
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
7
|
|
|
8
8
|
__all__ = ["AgentRunAsyncParams"]
|
|
9
9
|
|
|
@@ -16,6 +16,9 @@ class AgentRunAsyncParams(TypedDict, total=False):
|
|
|
16
16
|
callback_url: str
|
|
17
17
|
"""URL to call back when async operation completes"""
|
|
18
18
|
|
|
19
|
+
formats: List[Literal["html", "markdown", "screenshot", "headers"]]
|
|
20
|
+
"""Response formats to include. All disabled by default."""
|
|
21
|
+
|
|
19
22
|
localization: bool
|
|
20
23
|
|
|
21
24
|
storage_compress: bool
|
|
@@ -0,0 +1,34 @@
|
|
|
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 Dict, List, Iterable
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["AgentRunBatchParams", "Input", "SharedInputs"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AgentRunBatchParams(TypedDict, total=False):
|
|
12
|
+
inputs: Required[Iterable[Input]]
|
|
13
|
+
|
|
14
|
+
shared_inputs: Required[SharedInputs]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Input(TypedDict, total=False):
|
|
18
|
+
formats: List[Literal["html", "markdown", "screenshot", "headers"]]
|
|
19
|
+
"""Response formats to include. All disabled by default."""
|
|
20
|
+
|
|
21
|
+
localization: bool
|
|
22
|
+
|
|
23
|
+
params: Dict[str, object]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class SharedInputs(TypedDict, total=False):
|
|
27
|
+
agent: Required[str]
|
|
28
|
+
|
|
29
|
+
formats: List[Literal["html", "markdown", "screenshot", "headers"]]
|
|
30
|
+
"""Response formats to include. All disabled by default."""
|
|
31
|
+
|
|
32
|
+
localization: bool
|
|
33
|
+
|
|
34
|
+
params: Dict[str, object]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["AgentRunBatchResponse", "Task"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Task(BaseModel):
|
|
14
|
+
id: str
|
|
15
|
+
"""Unique task identifier."""
|
|
16
|
+
|
|
17
|
+
api_query: object = FieldInfo(alias="_query")
|
|
18
|
+
|
|
19
|
+
created_at: str
|
|
20
|
+
"""Timestamp when the task was created."""
|
|
21
|
+
|
|
22
|
+
input: object
|
|
23
|
+
"""Original input data for the task."""
|
|
24
|
+
|
|
25
|
+
state: Literal["pending", "success", "error"]
|
|
26
|
+
"""Current state of the task."""
|
|
27
|
+
|
|
28
|
+
status_url: str
|
|
29
|
+
"""URL for checking the task status."""
|
|
30
|
+
|
|
31
|
+
account_name: Optional[str] = None
|
|
32
|
+
"""Account name that owns the task."""
|
|
33
|
+
|
|
34
|
+
api_type: Optional[Literal["web", "serp", "ecommerce", "social", "media", "agent", "extract"]] = None
|
|
35
|
+
|
|
36
|
+
batch_id: Optional[str] = None
|
|
37
|
+
"""Batch ID if this task is part of a batch."""
|
|
38
|
+
|
|
39
|
+
download_url: Optional[str] = None
|
|
40
|
+
"""URL for downloading the task results."""
|
|
41
|
+
|
|
42
|
+
error: Optional[str] = None
|
|
43
|
+
"""Error message if the task failed."""
|
|
44
|
+
|
|
45
|
+
error_type: Optional[str] = None
|
|
46
|
+
"""Classification of the error type."""
|
|
47
|
+
|
|
48
|
+
modified_at: Optional[str] = None
|
|
49
|
+
"""Timestamp when the task was last modified."""
|
|
50
|
+
|
|
51
|
+
output_url: Optional[str] = None
|
|
52
|
+
"""Storage location of the output data."""
|
|
53
|
+
|
|
54
|
+
status_code: Optional[float] = None
|
|
55
|
+
"""HTTP status code from the task execution."""
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class AgentRunBatchResponse(BaseModel):
|
|
59
|
+
"""Response when a batch of extract tasks is created successfully."""
|
|
60
|
+
|
|
61
|
+
batch_id: str
|
|
62
|
+
"""Unique identifier for the batch."""
|
|
63
|
+
|
|
64
|
+
batch_size: float
|
|
65
|
+
"""Number of tasks in the batch."""
|
|
66
|
+
|
|
67
|
+
tasks: List[Task]
|
|
68
|
+
"""List of created tasks."""
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict
|
|
6
|
-
from typing_extensions import Required, TypedDict
|
|
5
|
+
from typing import Dict, List
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
7
|
|
|
8
8
|
__all__ = ["AgentRunParams"]
|
|
9
9
|
|
|
@@ -13,4 +13,7 @@ class AgentRunParams(TypedDict, total=False):
|
|
|
13
13
|
|
|
14
14
|
params: Required[Dict[str, object]]
|
|
15
15
|
|
|
16
|
+
formats: List[Literal["html", "markdown", "screenshot", "headers"]]
|
|
17
|
+
"""Response formats to include. All disabled by default."""
|
|
18
|
+
|
|
16
19
|
localization: bool
|
|
@@ -246,6 +246,9 @@ class Data(BaseModel):
|
|
|
246
246
|
network_capture: Optional[List[DataNetworkCapture]] = None
|
|
247
247
|
"""The network capture data collected during the task."""
|
|
248
248
|
|
|
249
|
+
pages_html: Optional[List[str]] = None
|
|
250
|
+
"""Individual HTML content of each pagination page, before merging."""
|
|
251
|
+
|
|
249
252
|
parsing: Optional[DataParsing] = None
|
|
250
253
|
"""The parsing results extracted from the HTML & network content."""
|
|
251
254
|
|
|
@@ -246,6 +246,9 @@ class Data(BaseModel):
|
|
|
246
246
|
network_capture: Optional[List[DataNetworkCapture]] = None
|
|
247
247
|
"""The network capture data collected during the task."""
|
|
248
248
|
|
|
249
|
+
pages_html: Optional[List[str]] = None
|
|
250
|
+
"""Individual HTML content of each pagination page, before merging."""
|
|
251
|
+
|
|
249
252
|
parsing: Optional[DataParsing] = None
|
|
250
253
|
"""The parsing results extracted from the HTML & network content."""
|
|
251
254
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: nimble_python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: The official Python library for the nimble API
|
|
5
5
|
Project-URL: Homepage, https://github.com/Nimbleway/nimble-python
|
|
6
6
|
Project-URL: Repository, https://github.com/Nimbleway/nimble-python
|
|
@@ -6,12 +6,12 @@ nimble_python/_constants.py,sha256=giUwuSKDnpjRLaHvgzErnXB3CSYjKMaI5xnBQJI-23s,4
|
|
|
6
6
|
nimble_python/_exceptions.py,sha256=x1M0s_wI9jkJ5ARR07APUuDZfxl7BjQ53snlFU-jAoQ,3220
|
|
7
7
|
nimble_python/_files.py,sha256=KnEzGi_O756MvKyJ4fOCW_u3JhOeWPQ4RsmDvqihDQU,3545
|
|
8
8
|
nimble_python/_models.py,sha256=R3MpO2z4XhTAnD3ObEks32suRXleF1g7BEgQTOLIxTs,32112
|
|
9
|
-
nimble_python/_qs.py,sha256=
|
|
9
|
+
nimble_python/_qs.py,sha256=ExvESqZz_a5ZALZG1aR2rkzE35o9Rmk0yPMQtKN0DTo,4924
|
|
10
10
|
nimble_python/_resource.py,sha256=TDtzjUMbNHRGQNq-4HJqce3T3THBD5Q7ESrONYPvKdI,1100
|
|
11
11
|
nimble_python/_response.py,sha256=hrLOCn3D0gCapH31eR9BVOgBpTYliUTVUsdeWc1J76A,28983
|
|
12
12
|
nimble_python/_streaming.py,sha256=StqGzUAIG9gQNCkRQnEAbN3IyiX4hDdCp2QR7_DANw8,10550
|
|
13
13
|
nimble_python/_types.py,sha256=ZhbxWgjPQAqNY4ePn8aUJV26mm5oDBrZqskA1XyjlQ0,7601
|
|
14
|
-
nimble_python/_version.py,sha256=
|
|
14
|
+
nimble_python/_version.py,sha256=Lb-CsoIL_IraYv5EV1eucIYPOAIePAbpXjQtYHRX5vQ,166
|
|
15
15
|
nimble_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
nimble_python/_utils/__init__.py,sha256=DJEWihdzRWrZI23vwocBkgvZCwn9iG7yV0c_9vKaysU,2355
|
|
17
17
|
nimble_python/_utils/_compat.py,sha256=33246eDcl3pwL6kWsEhVuT4Akrd8gZEW9LPTm465ohk,1231
|
|
@@ -29,18 +29,25 @@ nimble_python/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZ
|
|
|
29
29
|
nimble_python/_utils/_utils.py,sha256=ugfUaneOK7I8h9b3656flwf5u_kthY0gvNuqvgOLoSU,12252
|
|
30
30
|
nimble_python/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
31
31
|
nimble_python/resources/__init__.py,sha256=Wh5Ns-DfhwV5B1NL1sauYogLEctZiqtJxLuEVQzUvVw,1876
|
|
32
|
-
nimble_python/resources/agent.py,sha256=
|
|
32
|
+
nimble_python/resources/agent.py,sha256=lA2lZIr6D_yOXtyBUVM8nEdR1vsVtRQCw138Z6cqU-4,37893
|
|
33
33
|
nimble_python/resources/batches.py,sha256=LxPXo7mpDcXmtJAv7prVnDpJHkhHypix6ZNSxh9kpQU,11688
|
|
34
34
|
nimble_python/resources/crawl.py,sha256=GOMDGANIPAfay-J3ujW9ghlK-h-aIy99ChIKRN-pZK8,20651
|
|
35
35
|
nimble_python/resources/tasks.py,sha256=8rV6YZNpx8rq_83L8UZvt7HlPlRhY8SGrbVQAFDjBtM,13021
|
|
36
|
-
nimble_python/types/__init__.py,sha256=
|
|
36
|
+
nimble_python/types/__init__.py,sha256=IMIgUvouuZ_JeP5p7HBJEnwQJdnSBt9YopnYPY8y2Tw,3327
|
|
37
|
+
nimble_python/types/agent_generate_params.py,sha256=2YZjjZy7EDa-ISBftfjtgDh3wOba8UmmIVimYkILrG8,766
|
|
38
|
+
nimble_python/types/agent_generate_response.py,sha256=NaLHpAtIMssf5o094YfpsphnQXRtdIyAbM7RiVa5ij8,664
|
|
39
|
+
nimble_python/types/agent_get_generation_response.py,sha256=phzi3gsbrruea_eNcZIYJu9f8jYw26Nc_1sOyBsxIss,674
|
|
37
40
|
nimble_python/types/agent_get_response.py,sha256=qQtjNztWHGWGJ_LKLn2-VtQlzv2AfkPvu0QaADRXqIg,1131
|
|
38
41
|
nimble_python/types/agent_list_params.py,sha256=yUwgtiXrzfEXd3I--X_ISovY2BSHKXDvFZ2XUCUR9ew,670
|
|
39
42
|
nimble_python/types/agent_list_response.py,sha256=kBEVOD9nlby5QsfaDkjPLXDJyQotph3HBo321jP8rb4,599
|
|
40
|
-
nimble_python/types/
|
|
43
|
+
nimble_python/types/agent_publish_params.py,sha256=GNnBk5qgq1T1JMotVJSVrY_bW6CJHRRuF5H-9ofj9zE,289
|
|
44
|
+
nimble_python/types/agent_publish_response.py,sha256=VEyf8cMKVqgWRhOGPDuYevVhwPcE-oynoBc8UPoXVs8,247
|
|
45
|
+
nimble_python/types/agent_run_async_params.py,sha256=kma0zTwV2RK4BIDnOAneQ1Vx1sLZqSezBs403ODdoaI,877
|
|
41
46
|
nimble_python/types/agent_run_async_response.py,sha256=aawcjhtW6FaWxIPcg-l-1yIhsQDLUoYOaoSf_MLJ67s,321
|
|
42
|
-
nimble_python/types/
|
|
43
|
-
nimble_python/types/
|
|
47
|
+
nimble_python/types/agent_run_batch_params.py,sha256=R6yqYKx4w4-WFitwU1uPUu4DskYIc32c9NeKccm8UQ4,909
|
|
48
|
+
nimble_python/types/agent_run_batch_response.py,sha256=0dtYQ6epddVqO2sdbeTDJyGGGAob24Cl3y1qC2k2AT4,1776
|
|
49
|
+
nimble_python/types/agent_run_params.py,sha256=hC7CkPKvFoJf-KKIifJNKwDv-O_dS6Mk65k-A7up_RY,517
|
|
50
|
+
nimble_python/types/agent_run_response.py,sha256=0kPTccMFP3kBu-9legG_dRP5HSDNiafqDgZkaYxnqFA,8155
|
|
44
51
|
nimble_python/types/batch_get_response.py,sha256=5MIDHw3xt4UPdZY7eeYMDTJHbvyP4fCWNFMOLmuxcGM,2117
|
|
45
52
|
nimble_python/types/batch_progress_response.py,sha256=oHEHXclc0NnI3TiGMalfElhZ15rfvR7nZRub9Gg_nqs,726
|
|
46
53
|
nimble_python/types/client_extract_async_params.py,sha256=P26kzOH_UudChy5ZcCfoVz5YE-RVNCYifMAIAAeXErI,19339
|
|
@@ -56,7 +63,7 @@ nimble_python/types/crawl_status_response.py,sha256=rCNZkRNV65KzZpQCqbSX2FIW6kLh
|
|
|
56
63
|
nimble_python/types/crawl_terminate_response.py,sha256=Kw0udMxFAfBZcpKfIpK8Dt1wKyjFM5zUgGTiBNl1K4c,271
|
|
57
64
|
nimble_python/types/extract_async_response.py,sha256=__3OdwaSstOvDzaQnMv2w4cWeD4GN0-2zZ7YxdNDufs,1786
|
|
58
65
|
nimble_python/types/extract_batch_response.py,sha256=AjiTdf7eHP_kE3TCX7nDr2OdzdKWZyLDFkh3duZlNyg,1774
|
|
59
|
-
nimble_python/types/extract_response.py,sha256=
|
|
66
|
+
nimble_python/types/extract_response.py,sha256=B1Md11774eeSLinT7Z-a6ImP_X-WrUGoYSD1mbZMPjo,8153
|
|
60
67
|
nimble_python/types/map_response.py,sha256=rNCav8_9GXdbdNIaIQEWi6f8c_YduImddoCzxV4i4Os,607
|
|
61
68
|
nimble_python/types/search_response.py,sha256=lykUe_ICfs-dvtcz9nnrcFrV80FkSkWrR3ljumCyH4Y,2210
|
|
62
69
|
nimble_python/types/task_get_response.py,sha256=YMLwfZv2ejUu-4VePPCUkojzXDZ_4tYtYCem9JfQh0U,1563
|
|
@@ -91,7 +98,7 @@ nimble_python/types/shared_params/scroll_action.py,sha256=6PJMWVc9JhjyrXeAsFnvHR
|
|
|
91
98
|
nimble_python/types/shared_params/wait_action.py,sha256=2jlVgNNZcC2M9tka3xbmLkDocCJuoX_1qIGOmd6a2DU,1046
|
|
92
99
|
nimble_python/types/shared_params/wait_for_element_action.py,sha256=cKhvFe09G2aQBFKBXg00S43ykQqgNyTLYR1DoJmDvTA,1364
|
|
93
100
|
nimble_python/types/shared_params/wait_for_navigation_action.py,sha256=oPAK3OxZObqJjDEh9v0_q1ntHfWqgtXOp_k-oX8ZiHE,1257
|
|
94
|
-
nimble_python-0.
|
|
95
|
-
nimble_python-0.
|
|
96
|
-
nimble_python-0.
|
|
97
|
-
nimble_python-0.
|
|
101
|
+
nimble_python-0.16.0.dist-info/METADATA,sha256=be0K4zHYggpMamVI94U0JkITCx187hFZMdUYzxaXdrM,15816
|
|
102
|
+
nimble_python-0.16.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
103
|
+
nimble_python-0.16.0.dist-info/licenses/LICENSE,sha256=khtIpaYdgNbXXcmzsxlSL_iKmh160uTREZTiMQKCB24,11336
|
|
104
|
+
nimble_python-0.16.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|