opencode-python-sdk 0.2.2__py3-none-any.whl → 0.2.3__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.
- opencode/__init__.py +9 -0
- opencode/_aiohttp.py +44 -0
- opencode/_base_client.py +237 -11
- opencode/_client.py +8 -2
- opencode/_logs.py +29 -0
- opencode/_pagination.py +14 -0
- opencode/_response.py +316 -0
- opencode/resources/agent.py +63 -0
- opencode/resources/command.py +59 -0
- opencode/resources/config.py +93 -20
- opencode/resources/credential.py +149 -56
- opencode/resources/debug.py +156 -20
- opencode/resources/event.py +59 -0
- opencode/resources/experimental.py +210 -36
- opencode/resources/file.py +71 -0
- opencode/resources/form.py +59 -0
- opencode/resources/generate.py +59 -0
- opencode/resources/integration.py +538 -128
- opencode/resources/location.py +87 -18
- opencode/resources/mcp.py +252 -82
- opencode/resources/message.py +59 -0
- opencode/resources/migration.py +126 -0
- opencode/resources/model.py +63 -0
- opencode/resources/permission.py +272 -38
- opencode/resources/plugin.py +95 -22
- opencode/resources/project.py +63 -0
- opencode/resources/provider.py +63 -0
- opencode/resources/pty.py +172 -20
- opencode/resources/reference.py +59 -0
- opencode/resources/rpc.py +59 -0
- opencode/resources/server.py +67 -0
- opencode/resources/session.py +1159 -405
- opencode/resources/shell.py +101 -20
- opencode/resources/skill.py +59 -0
- opencode/resources/vcs.py +172 -20
- opencode/resources/voice.py +59 -0
- opencode/resources/websearch.py +63 -0
- opencode/resources/worktree.py +123 -40
- {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/METADATA +90 -2
- opencode_python_sdk-0.2.3.dist-info/RECORD +67 -0
- opencode_python_sdk-0.2.2.dist-info/RECORD +0 -64
- {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/WHEEL +0 -0
- {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/licenses/LICENSE +0 -0
opencode/resources/session.py
CHANGED
|
@@ -14,6 +14,12 @@ from .._base_client import RequestOptions
|
|
|
14
14
|
from .._pagination import AsyncPaginator, SyncCursorPage
|
|
15
15
|
from .._qs import encode_path_segment
|
|
16
16
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
17
|
+
from .._response import (
|
|
18
|
+
async_to_raw_response_wrapper,
|
|
19
|
+
async_to_streamed_response_wrapper,
|
|
20
|
+
to_raw_response_wrapper,
|
|
21
|
+
to_streamed_response_wrapper,
|
|
22
|
+
)
|
|
17
23
|
from .._streaming import AsyncStream, Stream
|
|
18
24
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, OpenEnum, Query, Timeout
|
|
19
25
|
from ..lib._session import AsyncSessionHelpers, SessionHelpers
|
|
@@ -66,6 +72,16 @@ __all__ = ["SessionResource", "AsyncSessionResource"]
|
|
|
66
72
|
class SessionRevertResource(SyncAPIResource):
|
|
67
73
|
"""Operations under ``client.session.revert`` (OpenCode ``session.revert``)."""
|
|
68
74
|
|
|
75
|
+
@cached_property
|
|
76
|
+
def with_raw_response(self) -> SessionRevertResourceWithRawResponse:
|
|
77
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
78
|
+
return SessionRevertResourceWithRawResponse(self)
|
|
79
|
+
|
|
80
|
+
@cached_property
|
|
81
|
+
def with_streaming_response(self) -> SessionRevertResourceWithStreamingResponse:
|
|
82
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
83
|
+
return SessionRevertResourceWithStreamingResponse(self)
|
|
84
|
+
|
|
69
85
|
def stage(
|
|
70
86
|
self,
|
|
71
87
|
session_id: SessionID,
|
|
@@ -130,16 +146,19 @@ class SessionRevertResource(SyncAPIResource):
|
|
|
130
146
|
|
|
131
147
|
``DELETE /api/session/:sessionID/revert``
|
|
132
148
|
"""
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
149
|
+
return cast(
|
|
150
|
+
"None",
|
|
151
|
+
self._client.request(
|
|
152
|
+
RequestOptions(
|
|
153
|
+
method="DELETE",
|
|
154
|
+
path=f"/api/session/{encode_path_segment(session_id)}/revert",
|
|
155
|
+
extra_headers=extra_headers,
|
|
156
|
+
extra_query=extra_query,
|
|
157
|
+
extra_body=extra_body,
|
|
158
|
+
timeout=timeout,
|
|
159
|
+
),
|
|
160
|
+
kind="void",
|
|
141
161
|
),
|
|
142
|
-
kind="void",
|
|
143
162
|
)
|
|
144
163
|
|
|
145
164
|
def commit(
|
|
@@ -162,22 +181,55 @@ class SessionRevertResource(SyncAPIResource):
|
|
|
162
181
|
|
|
163
182
|
``POST /api/session/:sessionID/revert/commit``
|
|
164
183
|
"""
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
184
|
+
return cast(
|
|
185
|
+
"None",
|
|
186
|
+
self._client.request(
|
|
187
|
+
RequestOptions(
|
|
188
|
+
method="POST",
|
|
189
|
+
path=f"/api/session/{encode_path_segment(session_id)}/revert/commit",
|
|
190
|
+
extra_headers=extra_headers,
|
|
191
|
+
extra_query=extra_query,
|
|
192
|
+
extra_body=extra_body,
|
|
193
|
+
timeout=timeout,
|
|
194
|
+
),
|
|
195
|
+
kind="void",
|
|
173
196
|
),
|
|
174
|
-
kind="void",
|
|
175
197
|
)
|
|
176
198
|
|
|
177
199
|
|
|
200
|
+
class SessionRevertResourceWithRawResponse:
|
|
201
|
+
"""``client.session.revert.with_raw_response``."""
|
|
202
|
+
|
|
203
|
+
def __init__(self, resource: SessionRevertResource) -> None:
|
|
204
|
+
self._resource = resource
|
|
205
|
+
self.stage = to_raw_response_wrapper(resource.stage)
|
|
206
|
+
self.clear = to_raw_response_wrapper(resource.clear)
|
|
207
|
+
self.commit = to_raw_response_wrapper(resource.commit)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
class SessionRevertResourceWithStreamingResponse:
|
|
211
|
+
"""``client.session.revert.with_streaming_response``."""
|
|
212
|
+
|
|
213
|
+
def __init__(self, resource: SessionRevertResource) -> None:
|
|
214
|
+
self._resource = resource
|
|
215
|
+
self.stage = to_streamed_response_wrapper(resource.stage)
|
|
216
|
+
self.clear = to_streamed_response_wrapper(resource.clear)
|
|
217
|
+
self.commit = to_streamed_response_wrapper(resource.commit)
|
|
218
|
+
|
|
219
|
+
|
|
178
220
|
class SessionInboxResource(SyncAPIResource):
|
|
179
221
|
"""Operations under ``client.session.inbox`` (OpenCode ``session.inbox``)."""
|
|
180
222
|
|
|
223
|
+
@cached_property
|
|
224
|
+
def with_raw_response(self) -> SessionInboxResourceWithRawResponse:
|
|
225
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
226
|
+
return SessionInboxResourceWithRawResponse(self)
|
|
227
|
+
|
|
228
|
+
@cached_property
|
|
229
|
+
def with_streaming_response(self) -> SessionInboxResourceWithStreamingResponse:
|
|
230
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
231
|
+
return SessionInboxResourceWithStreamingResponse(self)
|
|
232
|
+
|
|
181
233
|
def list(
|
|
182
234
|
self,
|
|
183
235
|
session_id: SessionID,
|
|
@@ -235,16 +287,19 @@ class SessionInboxResource(SyncAPIResource):
|
|
|
235
287
|
|
|
236
288
|
``DELETE /api/session/:sessionID/inbox/:inboxID``
|
|
237
289
|
"""
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
290
|
+
return cast(
|
|
291
|
+
"None",
|
|
292
|
+
self._client.request(
|
|
293
|
+
RequestOptions(
|
|
294
|
+
method="DELETE",
|
|
295
|
+
path=f"/api/session/{encode_path_segment(session_id)}/inbox/{encode_path_segment(inbox_id)}",
|
|
296
|
+
extra_headers=extra_headers,
|
|
297
|
+
extra_query=extra_query,
|
|
298
|
+
extra_body=extra_body,
|
|
299
|
+
timeout=timeout,
|
|
300
|
+
),
|
|
301
|
+
kind="void",
|
|
246
302
|
),
|
|
247
|
-
kind="void",
|
|
248
303
|
)
|
|
249
304
|
|
|
250
305
|
def update(
|
|
@@ -270,23 +325,56 @@ class SessionInboxResource(SyncAPIResource):
|
|
|
270
325
|
|
|
271
326
|
``PATCH /api/session/:sessionID/inbox/:inboxID``
|
|
272
327
|
"""
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
328
|
+
return cast(
|
|
329
|
+
"None",
|
|
330
|
+
self._client.request(
|
|
331
|
+
RequestOptions(
|
|
332
|
+
method="PATCH",
|
|
333
|
+
path=f"/api/session/{encode_path_segment(session_id)}/inbox/{encode_path_segment(inbox_id)}",
|
|
334
|
+
body={"delivery": delivery},
|
|
335
|
+
extra_headers=extra_headers,
|
|
336
|
+
extra_query=extra_query,
|
|
337
|
+
extra_body=extra_body,
|
|
338
|
+
timeout=timeout,
|
|
339
|
+
),
|
|
340
|
+
kind="void",
|
|
282
341
|
),
|
|
283
|
-
kind="void",
|
|
284
342
|
)
|
|
285
343
|
|
|
286
344
|
|
|
345
|
+
class SessionInboxResourceWithRawResponse:
|
|
346
|
+
"""``client.session.inbox.with_raw_response``."""
|
|
347
|
+
|
|
348
|
+
def __init__(self, resource: SessionInboxResource) -> None:
|
|
349
|
+
self._resource = resource
|
|
350
|
+
self.list = to_raw_response_wrapper(resource.list)
|
|
351
|
+
self.cancel = to_raw_response_wrapper(resource.cancel)
|
|
352
|
+
self.update = to_raw_response_wrapper(resource.update)
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
class SessionInboxResourceWithStreamingResponse:
|
|
356
|
+
"""``client.session.inbox.with_streaming_response``."""
|
|
357
|
+
|
|
358
|
+
def __init__(self, resource: SessionInboxResource) -> None:
|
|
359
|
+
self._resource = resource
|
|
360
|
+
self.list = to_streamed_response_wrapper(resource.list)
|
|
361
|
+
self.cancel = to_streamed_response_wrapper(resource.cancel)
|
|
362
|
+
self.update = to_streamed_response_wrapper(resource.update)
|
|
363
|
+
|
|
364
|
+
|
|
287
365
|
class SessionInstructionsEntryResource(SyncAPIResource):
|
|
288
366
|
"""Operations under ``client.session.instructions.entry`` (OpenCode ``session.instructions.entry``)."""
|
|
289
367
|
|
|
368
|
+
@cached_property
|
|
369
|
+
def with_raw_response(self) -> SessionInstructionsEntryResourceWithRawResponse:
|
|
370
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
371
|
+
return SessionInstructionsEntryResourceWithRawResponse(self)
|
|
372
|
+
|
|
373
|
+
@cached_property
|
|
374
|
+
def with_streaming_response(self) -> SessionInstructionsEntryResourceWithStreamingResponse:
|
|
375
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
376
|
+
return SessionInstructionsEntryResourceWithStreamingResponse(self)
|
|
377
|
+
|
|
290
378
|
def list(
|
|
291
379
|
self,
|
|
292
380
|
session_id: SessionID,
|
|
@@ -352,17 +440,20 @@ class SessionInstructionsEntryResource(SyncAPIResource):
|
|
|
352
440
|
|
|
353
441
|
``PUT /api/experimental/session/:sessionID/instructions/entries/:key``
|
|
354
442
|
"""
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
443
|
+
return cast(
|
|
444
|
+
"None",
|
|
445
|
+
self._client.request(
|
|
446
|
+
RequestOptions(
|
|
447
|
+
method="PUT",
|
|
448
|
+
path=f"/api/experimental/session/{encode_path_segment(session_id)}/instructions/entries/{encode_path_segment(key)}",
|
|
449
|
+
body={"value": value},
|
|
450
|
+
extra_headers=extra_headers,
|
|
451
|
+
extra_query=extra_query,
|
|
452
|
+
extra_body=extra_body,
|
|
453
|
+
timeout=timeout,
|
|
454
|
+
),
|
|
455
|
+
kind="void",
|
|
364
456
|
),
|
|
365
|
-
kind="void",
|
|
366
457
|
)
|
|
367
458
|
|
|
368
459
|
def remove(
|
|
@@ -389,19 +480,42 @@ class SessionInstructionsEntryResource(SyncAPIResource):
|
|
|
389
480
|
|
|
390
481
|
``DELETE /api/experimental/session/:sessionID/instructions/entries/:key``
|
|
391
482
|
"""
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
483
|
+
return cast(
|
|
484
|
+
"None",
|
|
485
|
+
self._client.request(
|
|
486
|
+
RequestOptions(
|
|
487
|
+
method="DELETE",
|
|
488
|
+
path=f"/api/experimental/session/{encode_path_segment(session_id)}/instructions/entries/{encode_path_segment(key)}",
|
|
489
|
+
extra_headers=extra_headers,
|
|
490
|
+
extra_query=extra_query,
|
|
491
|
+
extra_body=extra_body,
|
|
492
|
+
timeout=timeout,
|
|
493
|
+
),
|
|
494
|
+
kind="void",
|
|
400
495
|
),
|
|
401
|
-
kind="void",
|
|
402
496
|
)
|
|
403
497
|
|
|
404
498
|
|
|
499
|
+
class SessionInstructionsEntryResourceWithRawResponse:
|
|
500
|
+
"""``client.session.instructions.entry.with_raw_response``."""
|
|
501
|
+
|
|
502
|
+
def __init__(self, resource: SessionInstructionsEntryResource) -> None:
|
|
503
|
+
self._resource = resource
|
|
504
|
+
self.list = to_raw_response_wrapper(resource.list)
|
|
505
|
+
self.put = to_raw_response_wrapper(resource.put)
|
|
506
|
+
self.remove = to_raw_response_wrapper(resource.remove)
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
class SessionInstructionsEntryResourceWithStreamingResponse:
|
|
510
|
+
"""``client.session.instructions.entry.with_streaming_response``."""
|
|
511
|
+
|
|
512
|
+
def __init__(self, resource: SessionInstructionsEntryResource) -> None:
|
|
513
|
+
self._resource = resource
|
|
514
|
+
self.list = to_streamed_response_wrapper(resource.list)
|
|
515
|
+
self.put = to_streamed_response_wrapper(resource.put)
|
|
516
|
+
self.remove = to_streamed_response_wrapper(resource.remove)
|
|
517
|
+
|
|
518
|
+
|
|
405
519
|
class SessionInstructionsResource(SyncAPIResource):
|
|
406
520
|
"""Operations under ``client.session.instructions`` (OpenCode ``session.instructions``)."""
|
|
407
521
|
|
|
@@ -410,10 +524,54 @@ class SessionInstructionsResource(SyncAPIResource):
|
|
|
410
524
|
"""Operations under ``client.session.instructions.entry``."""
|
|
411
525
|
return SessionInstructionsEntryResource(self._client)
|
|
412
526
|
|
|
527
|
+
@cached_property
|
|
528
|
+
def with_raw_response(self) -> SessionInstructionsResourceWithRawResponse:
|
|
529
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
530
|
+
return SessionInstructionsResourceWithRawResponse(self)
|
|
531
|
+
|
|
532
|
+
@cached_property
|
|
533
|
+
def with_streaming_response(self) -> SessionInstructionsResourceWithStreamingResponse:
|
|
534
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
535
|
+
return SessionInstructionsResourceWithStreamingResponse(self)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
class SessionInstructionsResourceWithRawResponse:
|
|
539
|
+
"""``client.session.instructions.with_raw_response``."""
|
|
540
|
+
|
|
541
|
+
def __init__(self, resource: SessionInstructionsResource) -> None:
|
|
542
|
+
self._resource = resource
|
|
543
|
+
|
|
544
|
+
@cached_property
|
|
545
|
+
def entry(self) -> SessionInstructionsEntryResourceWithRawResponse:
|
|
546
|
+
"""``client.session.instructions.entry.with_raw_response``."""
|
|
547
|
+
return SessionInstructionsEntryResourceWithRawResponse(self._resource.entry)
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
class SessionInstructionsResourceWithStreamingResponse:
|
|
551
|
+
"""``client.session.instructions.with_streaming_response``."""
|
|
552
|
+
|
|
553
|
+
def __init__(self, resource: SessionInstructionsResource) -> None:
|
|
554
|
+
self._resource = resource
|
|
555
|
+
|
|
556
|
+
@cached_property
|
|
557
|
+
def entry(self) -> SessionInstructionsEntryResourceWithStreamingResponse:
|
|
558
|
+
"""``client.session.instructions.entry.with_streaming_response``."""
|
|
559
|
+
return SessionInstructionsEntryResourceWithStreamingResponse(self._resource.entry)
|
|
560
|
+
|
|
413
561
|
|
|
414
562
|
class SessionMessageResource(SyncAPIResource):
|
|
415
563
|
"""Operations under ``client.session.message`` (OpenCode ``session.message``)."""
|
|
416
564
|
|
|
565
|
+
@cached_property
|
|
566
|
+
def with_raw_response(self) -> SessionMessageResourceWithRawResponse:
|
|
567
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
568
|
+
return SessionMessageResourceWithRawResponse(self)
|
|
569
|
+
|
|
570
|
+
@cached_property
|
|
571
|
+
def with_streaming_response(self) -> SessionMessageResourceWithStreamingResponse:
|
|
572
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
573
|
+
return SessionMessageResourceWithStreamingResponse(self)
|
|
574
|
+
|
|
417
575
|
def get(
|
|
418
576
|
self,
|
|
419
577
|
session_id: SessionID,
|
|
@@ -453,9 +611,35 @@ class SessionMessageResource(SyncAPIResource):
|
|
|
453
611
|
)
|
|
454
612
|
|
|
455
613
|
|
|
614
|
+
class SessionMessageResourceWithRawResponse:
|
|
615
|
+
"""``client.session.message.with_raw_response``."""
|
|
616
|
+
|
|
617
|
+
def __init__(self, resource: SessionMessageResource) -> None:
|
|
618
|
+
self._resource = resource
|
|
619
|
+
self.get = to_raw_response_wrapper(resource.get)
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
class SessionMessageResourceWithStreamingResponse:
|
|
623
|
+
"""``client.session.message.with_streaming_response``."""
|
|
624
|
+
|
|
625
|
+
def __init__(self, resource: SessionMessageResource) -> None:
|
|
626
|
+
self._resource = resource
|
|
627
|
+
self.get = to_streamed_response_wrapper(resource.get)
|
|
628
|
+
|
|
629
|
+
|
|
456
630
|
class SessionFormResource(SyncAPIResource):
|
|
457
631
|
"""Operations under ``client.session.form`` (OpenCode ``session.form``)."""
|
|
458
632
|
|
|
633
|
+
@cached_property
|
|
634
|
+
def with_raw_response(self) -> SessionFormResourceWithRawResponse:
|
|
635
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
636
|
+
return SessionFormResourceWithRawResponse(self)
|
|
637
|
+
|
|
638
|
+
@cached_property
|
|
639
|
+
def with_streaming_response(self) -> SessionFormResourceWithStreamingResponse:
|
|
640
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
641
|
+
return SessionFormResourceWithStreamingResponse(self)
|
|
642
|
+
|
|
459
643
|
def list(
|
|
460
644
|
self,
|
|
461
645
|
session_id: str,
|
|
@@ -601,17 +785,20 @@ class SessionFormResource(SyncAPIResource):
|
|
|
601
785
|
|
|
602
786
|
``POST /api/session/:sessionID/form/:formID/reply``
|
|
603
787
|
"""
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
788
|
+
return cast(
|
|
789
|
+
"None",
|
|
790
|
+
self._client.request(
|
|
791
|
+
RequestOptions(
|
|
792
|
+
method="POST",
|
|
793
|
+
path=f"/api/session/{encode_path_segment(session_id)}/form/{encode_path_segment(form_id)}/reply",
|
|
794
|
+
body={"answer": answer},
|
|
795
|
+
extra_headers=extra_headers,
|
|
796
|
+
extra_query=extra_query,
|
|
797
|
+
extra_body=extra_body,
|
|
798
|
+
timeout=timeout,
|
|
799
|
+
),
|
|
800
|
+
kind="void",
|
|
613
801
|
),
|
|
614
|
-
kind="void",
|
|
615
802
|
)
|
|
616
803
|
|
|
617
804
|
def cancel(
|
|
@@ -639,20 +826,47 @@ class SessionFormResource(SyncAPIResource):
|
|
|
639
826
|
|
|
640
827
|
``DELETE /api/session/:sessionID/form/:formID``
|
|
641
828
|
"""
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
829
|
+
return cast(
|
|
830
|
+
"None",
|
|
831
|
+
self._client.request(
|
|
832
|
+
RequestOptions(
|
|
833
|
+
method="DELETE",
|
|
834
|
+
path=f"/api/session/{encode_path_segment(session_id)}/form/{encode_path_segment(form_id)}",
|
|
835
|
+
query={"message": message},
|
|
836
|
+
extra_headers=extra_headers,
|
|
837
|
+
extra_query=extra_query,
|
|
838
|
+
extra_body=extra_body,
|
|
839
|
+
timeout=timeout,
|
|
840
|
+
),
|
|
841
|
+
kind="void",
|
|
651
842
|
),
|
|
652
|
-
kind="void",
|
|
653
843
|
)
|
|
654
844
|
|
|
655
845
|
|
|
846
|
+
class SessionFormResourceWithRawResponse:
|
|
847
|
+
"""``client.session.form.with_raw_response``."""
|
|
848
|
+
|
|
849
|
+
def __init__(self, resource: SessionFormResource) -> None:
|
|
850
|
+
self._resource = resource
|
|
851
|
+
self.list = to_raw_response_wrapper(resource.list)
|
|
852
|
+
self.create = to_raw_response_wrapper(resource.create)
|
|
853
|
+
self.get = to_raw_response_wrapper(resource.get)
|
|
854
|
+
self.reply = to_raw_response_wrapper(resource.reply)
|
|
855
|
+
self.cancel = to_raw_response_wrapper(resource.cancel)
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
class SessionFormResourceWithStreamingResponse:
|
|
859
|
+
"""``client.session.form.with_streaming_response``."""
|
|
860
|
+
|
|
861
|
+
def __init__(self, resource: SessionFormResource) -> None:
|
|
862
|
+
self._resource = resource
|
|
863
|
+
self.list = to_streamed_response_wrapper(resource.list)
|
|
864
|
+
self.create = to_streamed_response_wrapper(resource.create)
|
|
865
|
+
self.get = to_streamed_response_wrapper(resource.get)
|
|
866
|
+
self.reply = to_streamed_response_wrapper(resource.reply)
|
|
867
|
+
self.cancel = to_streamed_response_wrapper(resource.cancel)
|
|
868
|
+
|
|
869
|
+
|
|
656
870
|
class SessionResource(SessionHelpers):
|
|
657
871
|
"""Operations under ``client.session`` (OpenCode ``session``)."""
|
|
658
872
|
|
|
@@ -681,6 +895,16 @@ class SessionResource(SessionHelpers):
|
|
|
681
895
|
"""Operations under ``client.session.form``."""
|
|
682
896
|
return SessionFormResource(self._client)
|
|
683
897
|
|
|
898
|
+
@cached_property
|
|
899
|
+
def with_raw_response(self) -> SessionResourceWithRawResponse:
|
|
900
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
901
|
+
return SessionResourceWithRawResponse(self)
|
|
902
|
+
|
|
903
|
+
@cached_property
|
|
904
|
+
def with_streaming_response(self) -> SessionResourceWithStreamingResponse:
|
|
905
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
906
|
+
return SessionResourceWithStreamingResponse(self)
|
|
907
|
+
|
|
684
908
|
def list(
|
|
685
909
|
self,
|
|
686
910
|
*,
|
|
@@ -1006,16 +1230,19 @@ class SessionResource(SessionHelpers):
|
|
|
1006
1230
|
|
|
1007
1231
|
``DELETE /api/session/:sessionID``
|
|
1008
1232
|
"""
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1233
|
+
return cast(
|
|
1234
|
+
"None",
|
|
1235
|
+
self._client.request(
|
|
1236
|
+
RequestOptions(
|
|
1237
|
+
method="DELETE",
|
|
1238
|
+
path=f"/api/session/{encode_path_segment(session_id)}",
|
|
1239
|
+
extra_headers=extra_headers,
|
|
1240
|
+
extra_query=extra_query,
|
|
1241
|
+
extra_body=extra_body,
|
|
1242
|
+
timeout=timeout,
|
|
1243
|
+
),
|
|
1244
|
+
kind="void",
|
|
1017
1245
|
),
|
|
1018
|
-
kind="void",
|
|
1019
1246
|
)
|
|
1020
1247
|
|
|
1021
1248
|
def fork(
|
|
@@ -1080,17 +1307,20 @@ class SessionResource(SessionHelpers):
|
|
|
1080
1307
|
|
|
1081
1308
|
``POST /api/session/:sessionID/agent``
|
|
1082
1309
|
"""
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1310
|
+
return cast(
|
|
1311
|
+
"None",
|
|
1312
|
+
self._client.request(
|
|
1313
|
+
RequestOptions(
|
|
1314
|
+
method="POST",
|
|
1315
|
+
path=f"/api/session/{encode_path_segment(session_id)}/agent",
|
|
1316
|
+
body={"agent": agent},
|
|
1317
|
+
extra_headers=extra_headers,
|
|
1318
|
+
extra_query=extra_query,
|
|
1319
|
+
extra_body=extra_body,
|
|
1320
|
+
timeout=timeout,
|
|
1321
|
+
),
|
|
1322
|
+
kind="void",
|
|
1092
1323
|
),
|
|
1093
|
-
kind="void",
|
|
1094
1324
|
)
|
|
1095
1325
|
|
|
1096
1326
|
def switch_model(
|
|
@@ -1115,17 +1345,20 @@ class SessionResource(SessionHelpers):
|
|
|
1115
1345
|
|
|
1116
1346
|
``POST /api/session/:sessionID/model``
|
|
1117
1347
|
"""
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1348
|
+
return cast(
|
|
1349
|
+
"None",
|
|
1350
|
+
self._client.request(
|
|
1351
|
+
RequestOptions(
|
|
1352
|
+
method="POST",
|
|
1353
|
+
path=f"/api/session/{encode_path_segment(session_id)}/model",
|
|
1354
|
+
body={"model": model},
|
|
1355
|
+
extra_headers=extra_headers,
|
|
1356
|
+
extra_query=extra_query,
|
|
1357
|
+
extra_body=extra_body,
|
|
1358
|
+
timeout=timeout,
|
|
1359
|
+
),
|
|
1360
|
+
kind="void",
|
|
1127
1361
|
),
|
|
1128
|
-
kind="void",
|
|
1129
1362
|
)
|
|
1130
1363
|
|
|
1131
1364
|
def update(
|
|
@@ -1156,17 +1389,20 @@ class SessionResource(SessionHelpers):
|
|
|
1156
1389
|
|
|
1157
1390
|
``PATCH /api/session/:sessionID``
|
|
1158
1391
|
"""
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1392
|
+
return cast(
|
|
1393
|
+
"None",
|
|
1394
|
+
self._client.request(
|
|
1395
|
+
RequestOptions(
|
|
1396
|
+
method="PATCH",
|
|
1397
|
+
path=f"/api/session/{encode_path_segment(session_id)}",
|
|
1398
|
+
body={"title": title, "metadata": metadata, "permissions": permissions, "archived": archived},
|
|
1399
|
+
extra_headers=extra_headers,
|
|
1400
|
+
extra_query=extra_query,
|
|
1401
|
+
extra_body=extra_body,
|
|
1402
|
+
timeout=timeout,
|
|
1403
|
+
),
|
|
1404
|
+
kind="void",
|
|
1168
1405
|
),
|
|
1169
|
-
kind="void",
|
|
1170
1406
|
)
|
|
1171
1407
|
|
|
1172
1408
|
def move(
|
|
@@ -1191,17 +1427,20 @@ class SessionResource(SessionHelpers):
|
|
|
1191
1427
|
|
|
1192
1428
|
``POST /api/session/:sessionID/move``
|
|
1193
1429
|
"""
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1430
|
+
return cast(
|
|
1431
|
+
"None",
|
|
1432
|
+
self._client.request(
|
|
1433
|
+
RequestOptions(
|
|
1434
|
+
method="POST",
|
|
1435
|
+
path=f"/api/session/{encode_path_segment(session_id)}/move",
|
|
1436
|
+
body={"directory": directory, "delivery": delivery},
|
|
1437
|
+
extra_headers=extra_headers,
|
|
1438
|
+
extra_query=extra_query,
|
|
1439
|
+
extra_body=extra_body,
|
|
1440
|
+
timeout=timeout,
|
|
1441
|
+
),
|
|
1442
|
+
kind="void",
|
|
1203
1443
|
),
|
|
1204
|
-
kind="void",
|
|
1205
1444
|
)
|
|
1206
1445
|
|
|
1207
1446
|
def prompt(
|
|
@@ -1289,24 +1528,27 @@ class SessionResource(SessionHelpers):
|
|
|
1289
1528
|
|
|
1290
1529
|
``POST /api/session/:sessionID/command``
|
|
1291
1530
|
"""
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
"
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1531
|
+
return cast(
|
|
1532
|
+
"None",
|
|
1533
|
+
self._client.request(
|
|
1534
|
+
RequestOptions(
|
|
1535
|
+
method="POST",
|
|
1536
|
+
path=f"/api/session/{encode_path_segment(session_id)}/command",
|
|
1537
|
+
body={
|
|
1538
|
+
"name": name,
|
|
1539
|
+
"text": text,
|
|
1540
|
+
"files": files,
|
|
1541
|
+
"agents": agents,
|
|
1542
|
+
"skills": skills,
|
|
1543
|
+
"delivery": delivery,
|
|
1544
|
+
},
|
|
1545
|
+
extra_headers=extra_headers,
|
|
1546
|
+
extra_query=extra_query,
|
|
1547
|
+
extra_body=extra_body,
|
|
1548
|
+
timeout=timeout,
|
|
1549
|
+
),
|
|
1550
|
+
kind="void",
|
|
1308
1551
|
),
|
|
1309
|
-
kind="void",
|
|
1310
1552
|
)
|
|
1311
1553
|
|
|
1312
1554
|
def skill(
|
|
@@ -1335,17 +1577,20 @@ class SessionResource(SessionHelpers):
|
|
|
1335
1577
|
|
|
1336
1578
|
``POST /api/experimental/session/:sessionID/skill``
|
|
1337
1579
|
"""
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1580
|
+
return cast(
|
|
1581
|
+
"None",
|
|
1582
|
+
self._client.request(
|
|
1583
|
+
RequestOptions(
|
|
1584
|
+
method="POST",
|
|
1585
|
+
path=f"/api/experimental/session/{encode_path_segment(session_id)}/skill",
|
|
1586
|
+
body={"id": id, "resume": resume},
|
|
1587
|
+
extra_headers=extra_headers,
|
|
1588
|
+
extra_query=extra_query,
|
|
1589
|
+
extra_body=extra_body,
|
|
1590
|
+
timeout=timeout,
|
|
1591
|
+
),
|
|
1592
|
+
kind="void",
|
|
1347
1593
|
),
|
|
1348
|
-
kind="void",
|
|
1349
1594
|
)
|
|
1350
1595
|
|
|
1351
1596
|
def synthetic(
|
|
@@ -1423,17 +1668,20 @@ class SessionResource(SessionHelpers):
|
|
|
1423
1668
|
|
|
1424
1669
|
``POST /api/session/:sessionID/shell``
|
|
1425
1670
|
"""
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1671
|
+
return cast(
|
|
1672
|
+
"None",
|
|
1673
|
+
self._client.request(
|
|
1674
|
+
RequestOptions(
|
|
1675
|
+
method="POST",
|
|
1676
|
+
path=f"/api/session/{encode_path_segment(session_id)}/shell",
|
|
1677
|
+
body={"id": id, "command": command},
|
|
1678
|
+
extra_headers=extra_headers,
|
|
1679
|
+
extra_query=extra_query,
|
|
1680
|
+
extra_body=extra_body,
|
|
1681
|
+
timeout=timeout,
|
|
1682
|
+
),
|
|
1683
|
+
kind="void",
|
|
1435
1684
|
),
|
|
1436
|
-
kind="void",
|
|
1437
1685
|
)
|
|
1438
1686
|
|
|
1439
1687
|
def compact(
|
|
@@ -1501,16 +1749,19 @@ class SessionResource(SessionHelpers):
|
|
|
1501
1749
|
|
|
1502
1750
|
``POST /api/experimental/session/:sessionID/wait``
|
|
1503
1751
|
"""
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1752
|
+
return cast(
|
|
1753
|
+
"None",
|
|
1754
|
+
self._client.request(
|
|
1755
|
+
RequestOptions(
|
|
1756
|
+
method="POST",
|
|
1757
|
+
path=f"/api/experimental/session/{encode_path_segment(session_id)}/wait",
|
|
1758
|
+
extra_headers=extra_headers,
|
|
1759
|
+
extra_query=extra_query,
|
|
1760
|
+
extra_body=extra_body,
|
|
1761
|
+
timeout=timeout,
|
|
1762
|
+
),
|
|
1763
|
+
kind="void",
|
|
1512
1764
|
),
|
|
1513
|
-
kind="void",
|
|
1514
1765
|
)
|
|
1515
1766
|
|
|
1516
1767
|
def context(
|
|
@@ -1734,16 +1985,19 @@ class SessionResource(SessionHelpers):
|
|
|
1734
1985
|
|
|
1735
1986
|
``POST /api/session/:sessionID/background``
|
|
1736
1987
|
"""
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1988
|
+
return cast(
|
|
1989
|
+
"None",
|
|
1990
|
+
self._client.request(
|
|
1991
|
+
RequestOptions(
|
|
1992
|
+
method="POST",
|
|
1993
|
+
path=f"/api/session/{encode_path_segment(session_id)}/background",
|
|
1994
|
+
extra_headers=extra_headers,
|
|
1995
|
+
extra_query=extra_query,
|
|
1996
|
+
extra_body=extra_body,
|
|
1997
|
+
timeout=timeout,
|
|
1998
|
+
),
|
|
1999
|
+
kind="void",
|
|
1745
2000
|
),
|
|
1746
|
-
kind="void",
|
|
1747
2001
|
)
|
|
1748
2002
|
|
|
1749
2003
|
def environment(
|
|
@@ -1767,17 +2021,20 @@ class SessionResource(SessionHelpers):
|
|
|
1767
2021
|
|
|
1768
2022
|
``PUT /api/session/:sessionID/environment``
|
|
1769
2023
|
"""
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
2024
|
+
return cast(
|
|
2025
|
+
"None",
|
|
2026
|
+
self._client.request(
|
|
2027
|
+
RequestOptions(
|
|
2028
|
+
method="PUT",
|
|
2029
|
+
path=f"/api/session/{encode_path_segment(session_id)}/environment",
|
|
2030
|
+
body={"variables": variables},
|
|
2031
|
+
extra_headers=extra_headers,
|
|
2032
|
+
extra_query=extra_query,
|
|
2033
|
+
extra_body=extra_body,
|
|
2034
|
+
timeout=timeout,
|
|
2035
|
+
),
|
|
2036
|
+
kind="void",
|
|
1779
2037
|
),
|
|
1780
|
-
kind="void",
|
|
1781
2038
|
)
|
|
1782
2039
|
|
|
1783
2040
|
def view(
|
|
@@ -1801,23 +2058,156 @@ class SessionResource(SessionHelpers):
|
|
|
1801
2058
|
|
|
1802
2059
|
``POST /api/session/:sessionID/view``
|
|
1803
2060
|
"""
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
2061
|
+
return cast(
|
|
2062
|
+
"None",
|
|
2063
|
+
self._client.request(
|
|
2064
|
+
RequestOptions(
|
|
2065
|
+
method="POST",
|
|
2066
|
+
path=f"/api/session/{encode_path_segment(session_id)}/view",
|
|
2067
|
+
body={"idle": idle},
|
|
2068
|
+
extra_headers=extra_headers,
|
|
2069
|
+
extra_query=extra_query,
|
|
2070
|
+
extra_body=extra_body,
|
|
2071
|
+
timeout=timeout,
|
|
2072
|
+
),
|
|
2073
|
+
kind="void",
|
|
1813
2074
|
),
|
|
1814
|
-
kind="void",
|
|
1815
2075
|
)
|
|
1816
2076
|
|
|
1817
2077
|
|
|
2078
|
+
class SessionResourceWithRawResponse:
|
|
2079
|
+
"""``client.session.with_raw_response``."""
|
|
2080
|
+
|
|
2081
|
+
def __init__(self, resource: SessionResource) -> None:
|
|
2082
|
+
self._resource = resource
|
|
2083
|
+
self.list = to_raw_response_wrapper(resource.list)
|
|
2084
|
+
self.stats = to_raw_response_wrapper(resource.stats)
|
|
2085
|
+
self.create = to_raw_response_wrapper(resource.create)
|
|
2086
|
+
self.import_ = to_raw_response_wrapper(resource.import_)
|
|
2087
|
+
self.export = to_raw_response_wrapper(resource.export)
|
|
2088
|
+
self.active = to_raw_response_wrapper(resource.active)
|
|
2089
|
+
self.get = to_raw_response_wrapper(resource.get)
|
|
2090
|
+
self.remove = to_raw_response_wrapper(resource.remove)
|
|
2091
|
+
self.fork = to_raw_response_wrapper(resource.fork)
|
|
2092
|
+
self.switch_agent = to_raw_response_wrapper(resource.switch_agent)
|
|
2093
|
+
self.switch_model = to_raw_response_wrapper(resource.switch_model)
|
|
2094
|
+
self.update = to_raw_response_wrapper(resource.update)
|
|
2095
|
+
self.move = to_raw_response_wrapper(resource.move)
|
|
2096
|
+
self.prompt = to_raw_response_wrapper(resource.prompt)
|
|
2097
|
+
self.command = to_raw_response_wrapper(resource.command)
|
|
2098
|
+
self.skill = to_raw_response_wrapper(resource.skill)
|
|
2099
|
+
self.synthetic = to_raw_response_wrapper(resource.synthetic)
|
|
2100
|
+
self.shell = to_raw_response_wrapper(resource.shell)
|
|
2101
|
+
self.compact = to_raw_response_wrapper(resource.compact)
|
|
2102
|
+
self.wait = to_raw_response_wrapper(resource.wait)
|
|
2103
|
+
self.context = to_raw_response_wrapper(resource.context)
|
|
2104
|
+
self.diff = to_raw_response_wrapper(resource.diff)
|
|
2105
|
+
self.generate = to_raw_response_wrapper(resource.generate)
|
|
2106
|
+
self.log = to_raw_response_wrapper(resource.log)
|
|
2107
|
+
self.interrupt = to_raw_response_wrapper(resource.interrupt)
|
|
2108
|
+
self.background = to_raw_response_wrapper(resource.background)
|
|
2109
|
+
self.environment = to_raw_response_wrapper(resource.environment)
|
|
2110
|
+
self.view = to_raw_response_wrapper(resource.view)
|
|
2111
|
+
|
|
2112
|
+
@cached_property
|
|
2113
|
+
def revert(self) -> SessionRevertResourceWithRawResponse:
|
|
2114
|
+
"""``client.session.revert.with_raw_response``."""
|
|
2115
|
+
return SessionRevertResourceWithRawResponse(self._resource.revert)
|
|
2116
|
+
|
|
2117
|
+
@cached_property
|
|
2118
|
+
def inbox(self) -> SessionInboxResourceWithRawResponse:
|
|
2119
|
+
"""``client.session.inbox.with_raw_response``."""
|
|
2120
|
+
return SessionInboxResourceWithRawResponse(self._resource.inbox)
|
|
2121
|
+
|
|
2122
|
+
@cached_property
|
|
2123
|
+
def instructions(self) -> SessionInstructionsResourceWithRawResponse:
|
|
2124
|
+
"""``client.session.instructions.with_raw_response``."""
|
|
2125
|
+
return SessionInstructionsResourceWithRawResponse(self._resource.instructions)
|
|
2126
|
+
|
|
2127
|
+
@cached_property
|
|
2128
|
+
def message(self) -> SessionMessageResourceWithRawResponse:
|
|
2129
|
+
"""``client.session.message.with_raw_response``."""
|
|
2130
|
+
return SessionMessageResourceWithRawResponse(self._resource.message)
|
|
2131
|
+
|
|
2132
|
+
@cached_property
|
|
2133
|
+
def form(self) -> SessionFormResourceWithRawResponse:
|
|
2134
|
+
"""``client.session.form.with_raw_response``."""
|
|
2135
|
+
return SessionFormResourceWithRawResponse(self._resource.form)
|
|
2136
|
+
|
|
2137
|
+
|
|
2138
|
+
class SessionResourceWithStreamingResponse:
|
|
2139
|
+
"""``client.session.with_streaming_response``."""
|
|
2140
|
+
|
|
2141
|
+
def __init__(self, resource: SessionResource) -> None:
|
|
2142
|
+
self._resource = resource
|
|
2143
|
+
self.list = to_streamed_response_wrapper(resource.list)
|
|
2144
|
+
self.stats = to_streamed_response_wrapper(resource.stats)
|
|
2145
|
+
self.create = to_streamed_response_wrapper(resource.create)
|
|
2146
|
+
self.import_ = to_streamed_response_wrapper(resource.import_)
|
|
2147
|
+
self.export = to_streamed_response_wrapper(resource.export)
|
|
2148
|
+
self.active = to_streamed_response_wrapper(resource.active)
|
|
2149
|
+
self.get = to_streamed_response_wrapper(resource.get)
|
|
2150
|
+
self.remove = to_streamed_response_wrapper(resource.remove)
|
|
2151
|
+
self.fork = to_streamed_response_wrapper(resource.fork)
|
|
2152
|
+
self.switch_agent = to_streamed_response_wrapper(resource.switch_agent)
|
|
2153
|
+
self.switch_model = to_streamed_response_wrapper(resource.switch_model)
|
|
2154
|
+
self.update = to_streamed_response_wrapper(resource.update)
|
|
2155
|
+
self.move = to_streamed_response_wrapper(resource.move)
|
|
2156
|
+
self.prompt = to_streamed_response_wrapper(resource.prompt)
|
|
2157
|
+
self.command = to_streamed_response_wrapper(resource.command)
|
|
2158
|
+
self.skill = to_streamed_response_wrapper(resource.skill)
|
|
2159
|
+
self.synthetic = to_streamed_response_wrapper(resource.synthetic)
|
|
2160
|
+
self.shell = to_streamed_response_wrapper(resource.shell)
|
|
2161
|
+
self.compact = to_streamed_response_wrapper(resource.compact)
|
|
2162
|
+
self.wait = to_streamed_response_wrapper(resource.wait)
|
|
2163
|
+
self.context = to_streamed_response_wrapper(resource.context)
|
|
2164
|
+
self.diff = to_streamed_response_wrapper(resource.diff)
|
|
2165
|
+
self.generate = to_streamed_response_wrapper(resource.generate)
|
|
2166
|
+
self.log = to_streamed_response_wrapper(resource.log)
|
|
2167
|
+
self.interrupt = to_streamed_response_wrapper(resource.interrupt)
|
|
2168
|
+
self.background = to_streamed_response_wrapper(resource.background)
|
|
2169
|
+
self.environment = to_streamed_response_wrapper(resource.environment)
|
|
2170
|
+
self.view = to_streamed_response_wrapper(resource.view)
|
|
2171
|
+
|
|
2172
|
+
@cached_property
|
|
2173
|
+
def revert(self) -> SessionRevertResourceWithStreamingResponse:
|
|
2174
|
+
"""``client.session.revert.with_streaming_response``."""
|
|
2175
|
+
return SessionRevertResourceWithStreamingResponse(self._resource.revert)
|
|
2176
|
+
|
|
2177
|
+
@cached_property
|
|
2178
|
+
def inbox(self) -> SessionInboxResourceWithStreamingResponse:
|
|
2179
|
+
"""``client.session.inbox.with_streaming_response``."""
|
|
2180
|
+
return SessionInboxResourceWithStreamingResponse(self._resource.inbox)
|
|
2181
|
+
|
|
2182
|
+
@cached_property
|
|
2183
|
+
def instructions(self) -> SessionInstructionsResourceWithStreamingResponse:
|
|
2184
|
+
"""``client.session.instructions.with_streaming_response``."""
|
|
2185
|
+
return SessionInstructionsResourceWithStreamingResponse(self._resource.instructions)
|
|
2186
|
+
|
|
2187
|
+
@cached_property
|
|
2188
|
+
def message(self) -> SessionMessageResourceWithStreamingResponse:
|
|
2189
|
+
"""``client.session.message.with_streaming_response``."""
|
|
2190
|
+
return SessionMessageResourceWithStreamingResponse(self._resource.message)
|
|
2191
|
+
|
|
2192
|
+
@cached_property
|
|
2193
|
+
def form(self) -> SessionFormResourceWithStreamingResponse:
|
|
2194
|
+
"""``client.session.form.with_streaming_response``."""
|
|
2195
|
+
return SessionFormResourceWithStreamingResponse(self._resource.form)
|
|
2196
|
+
|
|
2197
|
+
|
|
1818
2198
|
class AsyncSessionRevertResource(AsyncAPIResource):
|
|
1819
2199
|
"""Operations under ``client.session.revert`` (OpenCode ``session.revert``)."""
|
|
1820
2200
|
|
|
2201
|
+
@cached_property
|
|
2202
|
+
def with_raw_response(self) -> AsyncSessionRevertResourceWithRawResponse:
|
|
2203
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
2204
|
+
return AsyncSessionRevertResourceWithRawResponse(self)
|
|
2205
|
+
|
|
2206
|
+
@cached_property
|
|
2207
|
+
def with_streaming_response(self) -> AsyncSessionRevertResourceWithStreamingResponse:
|
|
2208
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
2209
|
+
return AsyncSessionRevertResourceWithStreamingResponse(self)
|
|
2210
|
+
|
|
1821
2211
|
async def stage(
|
|
1822
2212
|
self,
|
|
1823
2213
|
session_id: SessionID,
|
|
@@ -1882,16 +2272,19 @@ class AsyncSessionRevertResource(AsyncAPIResource):
|
|
|
1882
2272
|
|
|
1883
2273
|
``DELETE /api/session/:sessionID/revert``
|
|
1884
2274
|
"""
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
2275
|
+
return cast(
|
|
2276
|
+
"None",
|
|
2277
|
+
await self._client.request(
|
|
2278
|
+
RequestOptions(
|
|
2279
|
+
method="DELETE",
|
|
2280
|
+
path=f"/api/session/{encode_path_segment(session_id)}/revert",
|
|
2281
|
+
extra_headers=extra_headers,
|
|
2282
|
+
extra_query=extra_query,
|
|
2283
|
+
extra_body=extra_body,
|
|
2284
|
+
timeout=timeout,
|
|
2285
|
+
),
|
|
2286
|
+
kind="void",
|
|
1893
2287
|
),
|
|
1894
|
-
kind="void",
|
|
1895
2288
|
)
|
|
1896
2289
|
|
|
1897
2290
|
async def commit(
|
|
@@ -1914,22 +2307,55 @@ class AsyncSessionRevertResource(AsyncAPIResource):
|
|
|
1914
2307
|
|
|
1915
2308
|
``POST /api/session/:sessionID/revert/commit``
|
|
1916
2309
|
"""
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
2310
|
+
return cast(
|
|
2311
|
+
"None",
|
|
2312
|
+
await self._client.request(
|
|
2313
|
+
RequestOptions(
|
|
2314
|
+
method="POST",
|
|
2315
|
+
path=f"/api/session/{encode_path_segment(session_id)}/revert/commit",
|
|
2316
|
+
extra_headers=extra_headers,
|
|
2317
|
+
extra_query=extra_query,
|
|
2318
|
+
extra_body=extra_body,
|
|
2319
|
+
timeout=timeout,
|
|
2320
|
+
),
|
|
2321
|
+
kind="void",
|
|
1925
2322
|
),
|
|
1926
|
-
kind="void",
|
|
1927
2323
|
)
|
|
1928
2324
|
|
|
1929
2325
|
|
|
2326
|
+
class AsyncSessionRevertResourceWithRawResponse:
|
|
2327
|
+
"""``client.session.revert.with_raw_response``."""
|
|
2328
|
+
|
|
2329
|
+
def __init__(self, resource: AsyncSessionRevertResource) -> None:
|
|
2330
|
+
self._resource = resource
|
|
2331
|
+
self.stage = async_to_raw_response_wrapper(resource.stage)
|
|
2332
|
+
self.clear = async_to_raw_response_wrapper(resource.clear)
|
|
2333
|
+
self.commit = async_to_raw_response_wrapper(resource.commit)
|
|
2334
|
+
|
|
2335
|
+
|
|
2336
|
+
class AsyncSessionRevertResourceWithStreamingResponse:
|
|
2337
|
+
"""``client.session.revert.with_streaming_response``."""
|
|
2338
|
+
|
|
2339
|
+
def __init__(self, resource: AsyncSessionRevertResource) -> None:
|
|
2340
|
+
self._resource = resource
|
|
2341
|
+
self.stage = async_to_streamed_response_wrapper(resource.stage)
|
|
2342
|
+
self.clear = async_to_streamed_response_wrapper(resource.clear)
|
|
2343
|
+
self.commit = async_to_streamed_response_wrapper(resource.commit)
|
|
2344
|
+
|
|
2345
|
+
|
|
1930
2346
|
class AsyncSessionInboxResource(AsyncAPIResource):
|
|
1931
2347
|
"""Operations under ``client.session.inbox`` (OpenCode ``session.inbox``)."""
|
|
1932
2348
|
|
|
2349
|
+
@cached_property
|
|
2350
|
+
def with_raw_response(self) -> AsyncSessionInboxResourceWithRawResponse:
|
|
2351
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
2352
|
+
return AsyncSessionInboxResourceWithRawResponse(self)
|
|
2353
|
+
|
|
2354
|
+
@cached_property
|
|
2355
|
+
def with_streaming_response(self) -> AsyncSessionInboxResourceWithStreamingResponse:
|
|
2356
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
2357
|
+
return AsyncSessionInboxResourceWithStreamingResponse(self)
|
|
2358
|
+
|
|
1933
2359
|
async def list(
|
|
1934
2360
|
self,
|
|
1935
2361
|
session_id: SessionID,
|
|
@@ -1987,16 +2413,19 @@ class AsyncSessionInboxResource(AsyncAPIResource):
|
|
|
1987
2413
|
|
|
1988
2414
|
``DELETE /api/session/:sessionID/inbox/:inboxID``
|
|
1989
2415
|
"""
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2416
|
+
return cast(
|
|
2417
|
+
"None",
|
|
2418
|
+
await self._client.request(
|
|
2419
|
+
RequestOptions(
|
|
2420
|
+
method="DELETE",
|
|
2421
|
+
path=f"/api/session/{encode_path_segment(session_id)}/inbox/{encode_path_segment(inbox_id)}",
|
|
2422
|
+
extra_headers=extra_headers,
|
|
2423
|
+
extra_query=extra_query,
|
|
2424
|
+
extra_body=extra_body,
|
|
2425
|
+
timeout=timeout,
|
|
2426
|
+
),
|
|
2427
|
+
kind="void",
|
|
1998
2428
|
),
|
|
1999
|
-
kind="void",
|
|
2000
2429
|
)
|
|
2001
2430
|
|
|
2002
2431
|
async def update(
|
|
@@ -2022,23 +2451,56 @@ class AsyncSessionInboxResource(AsyncAPIResource):
|
|
|
2022
2451
|
|
|
2023
2452
|
``PATCH /api/session/:sessionID/inbox/:inboxID``
|
|
2024
2453
|
"""
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2454
|
+
return cast(
|
|
2455
|
+
"None",
|
|
2456
|
+
await self._client.request(
|
|
2457
|
+
RequestOptions(
|
|
2458
|
+
method="PATCH",
|
|
2459
|
+
path=f"/api/session/{encode_path_segment(session_id)}/inbox/{encode_path_segment(inbox_id)}",
|
|
2460
|
+
body={"delivery": delivery},
|
|
2461
|
+
extra_headers=extra_headers,
|
|
2462
|
+
extra_query=extra_query,
|
|
2463
|
+
extra_body=extra_body,
|
|
2464
|
+
timeout=timeout,
|
|
2465
|
+
),
|
|
2466
|
+
kind="void",
|
|
2034
2467
|
),
|
|
2035
|
-
kind="void",
|
|
2036
2468
|
)
|
|
2037
2469
|
|
|
2038
2470
|
|
|
2471
|
+
class AsyncSessionInboxResourceWithRawResponse:
|
|
2472
|
+
"""``client.session.inbox.with_raw_response``."""
|
|
2473
|
+
|
|
2474
|
+
def __init__(self, resource: AsyncSessionInboxResource) -> None:
|
|
2475
|
+
self._resource = resource
|
|
2476
|
+
self.list = async_to_raw_response_wrapper(resource.list)
|
|
2477
|
+
self.cancel = async_to_raw_response_wrapper(resource.cancel)
|
|
2478
|
+
self.update = async_to_raw_response_wrapper(resource.update)
|
|
2479
|
+
|
|
2480
|
+
|
|
2481
|
+
class AsyncSessionInboxResourceWithStreamingResponse:
|
|
2482
|
+
"""``client.session.inbox.with_streaming_response``."""
|
|
2483
|
+
|
|
2484
|
+
def __init__(self, resource: AsyncSessionInboxResource) -> None:
|
|
2485
|
+
self._resource = resource
|
|
2486
|
+
self.list = async_to_streamed_response_wrapper(resource.list)
|
|
2487
|
+
self.cancel = async_to_streamed_response_wrapper(resource.cancel)
|
|
2488
|
+
self.update = async_to_streamed_response_wrapper(resource.update)
|
|
2489
|
+
|
|
2490
|
+
|
|
2039
2491
|
class AsyncSessionInstructionsEntryResource(AsyncAPIResource):
|
|
2040
2492
|
"""Operations under ``client.session.instructions.entry`` (OpenCode ``session.instructions.entry``)."""
|
|
2041
2493
|
|
|
2494
|
+
@cached_property
|
|
2495
|
+
def with_raw_response(self) -> AsyncSessionInstructionsEntryResourceWithRawResponse:
|
|
2496
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
2497
|
+
return AsyncSessionInstructionsEntryResourceWithRawResponse(self)
|
|
2498
|
+
|
|
2499
|
+
@cached_property
|
|
2500
|
+
def with_streaming_response(self) -> AsyncSessionInstructionsEntryResourceWithStreamingResponse:
|
|
2501
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
2502
|
+
return AsyncSessionInstructionsEntryResourceWithStreamingResponse(self)
|
|
2503
|
+
|
|
2042
2504
|
async def list(
|
|
2043
2505
|
self,
|
|
2044
2506
|
session_id: SessionID,
|
|
@@ -2104,17 +2566,20 @@ class AsyncSessionInstructionsEntryResource(AsyncAPIResource):
|
|
|
2104
2566
|
|
|
2105
2567
|
``PUT /api/experimental/session/:sessionID/instructions/entries/:key``
|
|
2106
2568
|
"""
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2569
|
+
return cast(
|
|
2570
|
+
"None",
|
|
2571
|
+
await self._client.request(
|
|
2572
|
+
RequestOptions(
|
|
2573
|
+
method="PUT",
|
|
2574
|
+
path=f"/api/experimental/session/{encode_path_segment(session_id)}/instructions/entries/{encode_path_segment(key)}",
|
|
2575
|
+
body={"value": value},
|
|
2576
|
+
extra_headers=extra_headers,
|
|
2577
|
+
extra_query=extra_query,
|
|
2578
|
+
extra_body=extra_body,
|
|
2579
|
+
timeout=timeout,
|
|
2580
|
+
),
|
|
2581
|
+
kind="void",
|
|
2116
2582
|
),
|
|
2117
|
-
kind="void",
|
|
2118
2583
|
)
|
|
2119
2584
|
|
|
2120
2585
|
async def remove(
|
|
@@ -2141,31 +2606,98 @@ class AsyncSessionInstructionsEntryResource(AsyncAPIResource):
|
|
|
2141
2606
|
|
|
2142
2607
|
``DELETE /api/experimental/session/:sessionID/instructions/entries/:key``
|
|
2143
2608
|
"""
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2609
|
+
return cast(
|
|
2610
|
+
"None",
|
|
2611
|
+
await self._client.request(
|
|
2612
|
+
RequestOptions(
|
|
2613
|
+
method="DELETE",
|
|
2614
|
+
path=f"/api/experimental/session/{encode_path_segment(session_id)}/instructions/entries/{encode_path_segment(key)}",
|
|
2615
|
+
extra_headers=extra_headers,
|
|
2616
|
+
extra_query=extra_query,
|
|
2617
|
+
extra_body=extra_body,
|
|
2618
|
+
timeout=timeout,
|
|
2619
|
+
),
|
|
2620
|
+
kind="void",
|
|
2152
2621
|
),
|
|
2153
|
-
kind="void",
|
|
2154
2622
|
)
|
|
2155
2623
|
|
|
2156
2624
|
|
|
2157
|
-
class
|
|
2158
|
-
"""
|
|
2625
|
+
class AsyncSessionInstructionsEntryResourceWithRawResponse:
|
|
2626
|
+
"""``client.session.instructions.entry.with_raw_response``."""
|
|
2627
|
+
|
|
2628
|
+
def __init__(self, resource: AsyncSessionInstructionsEntryResource) -> None:
|
|
2629
|
+
self._resource = resource
|
|
2630
|
+
self.list = async_to_raw_response_wrapper(resource.list)
|
|
2631
|
+
self.put = async_to_raw_response_wrapper(resource.put)
|
|
2632
|
+
self.remove = async_to_raw_response_wrapper(resource.remove)
|
|
2633
|
+
|
|
2634
|
+
|
|
2635
|
+
class AsyncSessionInstructionsEntryResourceWithStreamingResponse:
|
|
2636
|
+
"""``client.session.instructions.entry.with_streaming_response``."""
|
|
2637
|
+
|
|
2638
|
+
def __init__(self, resource: AsyncSessionInstructionsEntryResource) -> None:
|
|
2639
|
+
self._resource = resource
|
|
2640
|
+
self.list = async_to_streamed_response_wrapper(resource.list)
|
|
2641
|
+
self.put = async_to_streamed_response_wrapper(resource.put)
|
|
2642
|
+
self.remove = async_to_streamed_response_wrapper(resource.remove)
|
|
2643
|
+
|
|
2644
|
+
|
|
2645
|
+
class AsyncSessionInstructionsResource(AsyncAPIResource):
|
|
2646
|
+
"""Operations under ``client.session.instructions`` (OpenCode ``session.instructions``)."""
|
|
2647
|
+
|
|
2648
|
+
@cached_property
|
|
2649
|
+
def entry(self) -> AsyncSessionInstructionsEntryResource:
|
|
2650
|
+
"""Operations under ``client.session.instructions.entry``."""
|
|
2651
|
+
return AsyncSessionInstructionsEntryResource(self._client)
|
|
2652
|
+
|
|
2653
|
+
@cached_property
|
|
2654
|
+
def with_raw_response(self) -> AsyncSessionInstructionsResourceWithRawResponse:
|
|
2655
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
2656
|
+
return AsyncSessionInstructionsResourceWithRawResponse(self)
|
|
2657
|
+
|
|
2658
|
+
@cached_property
|
|
2659
|
+
def with_streaming_response(self) -> AsyncSessionInstructionsResourceWithStreamingResponse:
|
|
2660
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
2661
|
+
return AsyncSessionInstructionsResourceWithStreamingResponse(self)
|
|
2662
|
+
|
|
2663
|
+
|
|
2664
|
+
class AsyncSessionInstructionsResourceWithRawResponse:
|
|
2665
|
+
"""``client.session.instructions.with_raw_response``."""
|
|
2666
|
+
|
|
2667
|
+
def __init__(self, resource: AsyncSessionInstructionsResource) -> None:
|
|
2668
|
+
self._resource = resource
|
|
2669
|
+
|
|
2670
|
+
@cached_property
|
|
2671
|
+
def entry(self) -> AsyncSessionInstructionsEntryResourceWithRawResponse:
|
|
2672
|
+
"""``client.session.instructions.entry.with_raw_response``."""
|
|
2673
|
+
return AsyncSessionInstructionsEntryResourceWithRawResponse(self._resource.entry)
|
|
2674
|
+
|
|
2675
|
+
|
|
2676
|
+
class AsyncSessionInstructionsResourceWithStreamingResponse:
|
|
2677
|
+
"""``client.session.instructions.with_streaming_response``."""
|
|
2678
|
+
|
|
2679
|
+
def __init__(self, resource: AsyncSessionInstructionsResource) -> None:
|
|
2680
|
+
self._resource = resource
|
|
2159
2681
|
|
|
2160
2682
|
@cached_property
|
|
2161
|
-
def entry(self) ->
|
|
2162
|
-
"""
|
|
2163
|
-
return
|
|
2683
|
+
def entry(self) -> AsyncSessionInstructionsEntryResourceWithStreamingResponse:
|
|
2684
|
+
"""``client.session.instructions.entry.with_streaming_response``."""
|
|
2685
|
+
return AsyncSessionInstructionsEntryResourceWithStreamingResponse(self._resource.entry)
|
|
2164
2686
|
|
|
2165
2687
|
|
|
2166
2688
|
class AsyncSessionMessageResource(AsyncAPIResource):
|
|
2167
2689
|
"""Operations under ``client.session.message`` (OpenCode ``session.message``)."""
|
|
2168
2690
|
|
|
2691
|
+
@cached_property
|
|
2692
|
+
def with_raw_response(self) -> AsyncSessionMessageResourceWithRawResponse:
|
|
2693
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
2694
|
+
return AsyncSessionMessageResourceWithRawResponse(self)
|
|
2695
|
+
|
|
2696
|
+
@cached_property
|
|
2697
|
+
def with_streaming_response(self) -> AsyncSessionMessageResourceWithStreamingResponse:
|
|
2698
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
2699
|
+
return AsyncSessionMessageResourceWithStreamingResponse(self)
|
|
2700
|
+
|
|
2169
2701
|
async def get(
|
|
2170
2702
|
self,
|
|
2171
2703
|
session_id: SessionID,
|
|
@@ -2205,9 +2737,35 @@ class AsyncSessionMessageResource(AsyncAPIResource):
|
|
|
2205
2737
|
)
|
|
2206
2738
|
|
|
2207
2739
|
|
|
2740
|
+
class AsyncSessionMessageResourceWithRawResponse:
|
|
2741
|
+
"""``client.session.message.with_raw_response``."""
|
|
2742
|
+
|
|
2743
|
+
def __init__(self, resource: AsyncSessionMessageResource) -> None:
|
|
2744
|
+
self._resource = resource
|
|
2745
|
+
self.get = async_to_raw_response_wrapper(resource.get)
|
|
2746
|
+
|
|
2747
|
+
|
|
2748
|
+
class AsyncSessionMessageResourceWithStreamingResponse:
|
|
2749
|
+
"""``client.session.message.with_streaming_response``."""
|
|
2750
|
+
|
|
2751
|
+
def __init__(self, resource: AsyncSessionMessageResource) -> None:
|
|
2752
|
+
self._resource = resource
|
|
2753
|
+
self.get = async_to_streamed_response_wrapper(resource.get)
|
|
2754
|
+
|
|
2755
|
+
|
|
2208
2756
|
class AsyncSessionFormResource(AsyncAPIResource):
|
|
2209
2757
|
"""Operations under ``client.session.form`` (OpenCode ``session.form``)."""
|
|
2210
2758
|
|
|
2759
|
+
@cached_property
|
|
2760
|
+
def with_raw_response(self) -> AsyncSessionFormResourceWithRawResponse:
|
|
2761
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
2762
|
+
return AsyncSessionFormResourceWithRawResponse(self)
|
|
2763
|
+
|
|
2764
|
+
@cached_property
|
|
2765
|
+
def with_streaming_response(self) -> AsyncSessionFormResourceWithStreamingResponse:
|
|
2766
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
2767
|
+
return AsyncSessionFormResourceWithStreamingResponse(self)
|
|
2768
|
+
|
|
2211
2769
|
async def list(
|
|
2212
2770
|
self,
|
|
2213
2771
|
session_id: str,
|
|
@@ -2353,17 +2911,20 @@ class AsyncSessionFormResource(AsyncAPIResource):
|
|
|
2353
2911
|
|
|
2354
2912
|
``POST /api/session/:sessionID/form/:formID/reply``
|
|
2355
2913
|
"""
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2914
|
+
return cast(
|
|
2915
|
+
"None",
|
|
2916
|
+
await self._client.request(
|
|
2917
|
+
RequestOptions(
|
|
2918
|
+
method="POST",
|
|
2919
|
+
path=f"/api/session/{encode_path_segment(session_id)}/form/{encode_path_segment(form_id)}/reply",
|
|
2920
|
+
body={"answer": answer},
|
|
2921
|
+
extra_headers=extra_headers,
|
|
2922
|
+
extra_query=extra_query,
|
|
2923
|
+
extra_body=extra_body,
|
|
2924
|
+
timeout=timeout,
|
|
2925
|
+
),
|
|
2926
|
+
kind="void",
|
|
2365
2927
|
),
|
|
2366
|
-
kind="void",
|
|
2367
2928
|
)
|
|
2368
2929
|
|
|
2369
2930
|
async def cancel(
|
|
@@ -2391,20 +2952,47 @@ class AsyncSessionFormResource(AsyncAPIResource):
|
|
|
2391
2952
|
|
|
2392
2953
|
``DELETE /api/session/:sessionID/form/:formID``
|
|
2393
2954
|
"""
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2955
|
+
return cast(
|
|
2956
|
+
"None",
|
|
2957
|
+
await self._client.request(
|
|
2958
|
+
RequestOptions(
|
|
2959
|
+
method="DELETE",
|
|
2960
|
+
path=f"/api/session/{encode_path_segment(session_id)}/form/{encode_path_segment(form_id)}",
|
|
2961
|
+
query={"message": message},
|
|
2962
|
+
extra_headers=extra_headers,
|
|
2963
|
+
extra_query=extra_query,
|
|
2964
|
+
extra_body=extra_body,
|
|
2965
|
+
timeout=timeout,
|
|
2966
|
+
),
|
|
2967
|
+
kind="void",
|
|
2403
2968
|
),
|
|
2404
|
-
kind="void",
|
|
2405
2969
|
)
|
|
2406
2970
|
|
|
2407
2971
|
|
|
2972
|
+
class AsyncSessionFormResourceWithRawResponse:
|
|
2973
|
+
"""``client.session.form.with_raw_response``."""
|
|
2974
|
+
|
|
2975
|
+
def __init__(self, resource: AsyncSessionFormResource) -> None:
|
|
2976
|
+
self._resource = resource
|
|
2977
|
+
self.list = async_to_raw_response_wrapper(resource.list)
|
|
2978
|
+
self.create = async_to_raw_response_wrapper(resource.create)
|
|
2979
|
+
self.get = async_to_raw_response_wrapper(resource.get)
|
|
2980
|
+
self.reply = async_to_raw_response_wrapper(resource.reply)
|
|
2981
|
+
self.cancel = async_to_raw_response_wrapper(resource.cancel)
|
|
2982
|
+
|
|
2983
|
+
|
|
2984
|
+
class AsyncSessionFormResourceWithStreamingResponse:
|
|
2985
|
+
"""``client.session.form.with_streaming_response``."""
|
|
2986
|
+
|
|
2987
|
+
def __init__(self, resource: AsyncSessionFormResource) -> None:
|
|
2988
|
+
self._resource = resource
|
|
2989
|
+
self.list = async_to_streamed_response_wrapper(resource.list)
|
|
2990
|
+
self.create = async_to_streamed_response_wrapper(resource.create)
|
|
2991
|
+
self.get = async_to_streamed_response_wrapper(resource.get)
|
|
2992
|
+
self.reply = async_to_streamed_response_wrapper(resource.reply)
|
|
2993
|
+
self.cancel = async_to_streamed_response_wrapper(resource.cancel)
|
|
2994
|
+
|
|
2995
|
+
|
|
2408
2996
|
class AsyncSessionResource(AsyncSessionHelpers):
|
|
2409
2997
|
"""Operations under ``client.session`` (OpenCode ``session``)."""
|
|
2410
2998
|
|
|
@@ -2433,6 +3021,16 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
2433
3021
|
"""Operations under ``client.session.form``."""
|
|
2434
3022
|
return AsyncSessionFormResource(self._client)
|
|
2435
3023
|
|
|
3024
|
+
@cached_property
|
|
3025
|
+
def with_raw_response(self) -> AsyncSessionResourceWithRawResponse:
|
|
3026
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
3027
|
+
return AsyncSessionResourceWithRawResponse(self)
|
|
3028
|
+
|
|
3029
|
+
@cached_property
|
|
3030
|
+
def with_streaming_response(self) -> AsyncSessionResourceWithStreamingResponse:
|
|
3031
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
3032
|
+
return AsyncSessionResourceWithStreamingResponse(self)
|
|
3033
|
+
|
|
2436
3034
|
def list(
|
|
2437
3035
|
self,
|
|
2438
3036
|
*,
|
|
@@ -2758,16 +3356,19 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
2758
3356
|
|
|
2759
3357
|
``DELETE /api/session/:sessionID``
|
|
2760
3358
|
"""
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
3359
|
+
return cast(
|
|
3360
|
+
"None",
|
|
3361
|
+
await self._client.request(
|
|
3362
|
+
RequestOptions(
|
|
3363
|
+
method="DELETE",
|
|
3364
|
+
path=f"/api/session/{encode_path_segment(session_id)}",
|
|
3365
|
+
extra_headers=extra_headers,
|
|
3366
|
+
extra_query=extra_query,
|
|
3367
|
+
extra_body=extra_body,
|
|
3368
|
+
timeout=timeout,
|
|
3369
|
+
),
|
|
3370
|
+
kind="void",
|
|
2769
3371
|
),
|
|
2770
|
-
kind="void",
|
|
2771
3372
|
)
|
|
2772
3373
|
|
|
2773
3374
|
async def fork(
|
|
@@ -2832,17 +3433,20 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
2832
3433
|
|
|
2833
3434
|
``POST /api/session/:sessionID/agent``
|
|
2834
3435
|
"""
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
3436
|
+
return cast(
|
|
3437
|
+
"None",
|
|
3438
|
+
await self._client.request(
|
|
3439
|
+
RequestOptions(
|
|
3440
|
+
method="POST",
|
|
3441
|
+
path=f"/api/session/{encode_path_segment(session_id)}/agent",
|
|
3442
|
+
body={"agent": agent},
|
|
3443
|
+
extra_headers=extra_headers,
|
|
3444
|
+
extra_query=extra_query,
|
|
3445
|
+
extra_body=extra_body,
|
|
3446
|
+
timeout=timeout,
|
|
3447
|
+
),
|
|
3448
|
+
kind="void",
|
|
2844
3449
|
),
|
|
2845
|
-
kind="void",
|
|
2846
3450
|
)
|
|
2847
3451
|
|
|
2848
3452
|
async def switch_model(
|
|
@@ -2867,17 +3471,20 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
2867
3471
|
|
|
2868
3472
|
``POST /api/session/:sessionID/model``
|
|
2869
3473
|
"""
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
3474
|
+
return cast(
|
|
3475
|
+
"None",
|
|
3476
|
+
await self._client.request(
|
|
3477
|
+
RequestOptions(
|
|
3478
|
+
method="POST",
|
|
3479
|
+
path=f"/api/session/{encode_path_segment(session_id)}/model",
|
|
3480
|
+
body={"model": model},
|
|
3481
|
+
extra_headers=extra_headers,
|
|
3482
|
+
extra_query=extra_query,
|
|
3483
|
+
extra_body=extra_body,
|
|
3484
|
+
timeout=timeout,
|
|
3485
|
+
),
|
|
3486
|
+
kind="void",
|
|
2879
3487
|
),
|
|
2880
|
-
kind="void",
|
|
2881
3488
|
)
|
|
2882
3489
|
|
|
2883
3490
|
async def update(
|
|
@@ -2908,17 +3515,20 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
2908
3515
|
|
|
2909
3516
|
``PATCH /api/session/:sessionID``
|
|
2910
3517
|
"""
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
3518
|
+
return cast(
|
|
3519
|
+
"None",
|
|
3520
|
+
await self._client.request(
|
|
3521
|
+
RequestOptions(
|
|
3522
|
+
method="PATCH",
|
|
3523
|
+
path=f"/api/session/{encode_path_segment(session_id)}",
|
|
3524
|
+
body={"title": title, "metadata": metadata, "permissions": permissions, "archived": archived},
|
|
3525
|
+
extra_headers=extra_headers,
|
|
3526
|
+
extra_query=extra_query,
|
|
3527
|
+
extra_body=extra_body,
|
|
3528
|
+
timeout=timeout,
|
|
3529
|
+
),
|
|
3530
|
+
kind="void",
|
|
2920
3531
|
),
|
|
2921
|
-
kind="void",
|
|
2922
3532
|
)
|
|
2923
3533
|
|
|
2924
3534
|
async def move(
|
|
@@ -2943,17 +3553,20 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
2943
3553
|
|
|
2944
3554
|
``POST /api/session/:sessionID/move``
|
|
2945
3555
|
"""
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
3556
|
+
return cast(
|
|
3557
|
+
"None",
|
|
3558
|
+
await self._client.request(
|
|
3559
|
+
RequestOptions(
|
|
3560
|
+
method="POST",
|
|
3561
|
+
path=f"/api/session/{encode_path_segment(session_id)}/move",
|
|
3562
|
+
body={"directory": directory, "delivery": delivery},
|
|
3563
|
+
extra_headers=extra_headers,
|
|
3564
|
+
extra_query=extra_query,
|
|
3565
|
+
extra_body=extra_body,
|
|
3566
|
+
timeout=timeout,
|
|
3567
|
+
),
|
|
3568
|
+
kind="void",
|
|
2955
3569
|
),
|
|
2956
|
-
kind="void",
|
|
2957
3570
|
)
|
|
2958
3571
|
|
|
2959
3572
|
async def prompt(
|
|
@@ -3041,24 +3654,27 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
3041
3654
|
|
|
3042
3655
|
``POST /api/session/:sessionID/command``
|
|
3043
3656
|
"""
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
"
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3657
|
+
return cast(
|
|
3658
|
+
"None",
|
|
3659
|
+
await self._client.request(
|
|
3660
|
+
RequestOptions(
|
|
3661
|
+
method="POST",
|
|
3662
|
+
path=f"/api/session/{encode_path_segment(session_id)}/command",
|
|
3663
|
+
body={
|
|
3664
|
+
"name": name,
|
|
3665
|
+
"text": text,
|
|
3666
|
+
"files": files,
|
|
3667
|
+
"agents": agents,
|
|
3668
|
+
"skills": skills,
|
|
3669
|
+
"delivery": delivery,
|
|
3670
|
+
},
|
|
3671
|
+
extra_headers=extra_headers,
|
|
3672
|
+
extra_query=extra_query,
|
|
3673
|
+
extra_body=extra_body,
|
|
3674
|
+
timeout=timeout,
|
|
3675
|
+
),
|
|
3676
|
+
kind="void",
|
|
3060
3677
|
),
|
|
3061
|
-
kind="void",
|
|
3062
3678
|
)
|
|
3063
3679
|
|
|
3064
3680
|
async def skill(
|
|
@@ -3087,17 +3703,20 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
3087
3703
|
|
|
3088
3704
|
``POST /api/experimental/session/:sessionID/skill``
|
|
3089
3705
|
"""
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3706
|
+
return cast(
|
|
3707
|
+
"None",
|
|
3708
|
+
await self._client.request(
|
|
3709
|
+
RequestOptions(
|
|
3710
|
+
method="POST",
|
|
3711
|
+
path=f"/api/experimental/session/{encode_path_segment(session_id)}/skill",
|
|
3712
|
+
body={"id": id, "resume": resume},
|
|
3713
|
+
extra_headers=extra_headers,
|
|
3714
|
+
extra_query=extra_query,
|
|
3715
|
+
extra_body=extra_body,
|
|
3716
|
+
timeout=timeout,
|
|
3717
|
+
),
|
|
3718
|
+
kind="void",
|
|
3099
3719
|
),
|
|
3100
|
-
kind="void",
|
|
3101
3720
|
)
|
|
3102
3721
|
|
|
3103
3722
|
async def synthetic(
|
|
@@ -3175,17 +3794,20 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
3175
3794
|
|
|
3176
3795
|
``POST /api/session/:sessionID/shell``
|
|
3177
3796
|
"""
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3797
|
+
return cast(
|
|
3798
|
+
"None",
|
|
3799
|
+
await self._client.request(
|
|
3800
|
+
RequestOptions(
|
|
3801
|
+
method="POST",
|
|
3802
|
+
path=f"/api/session/{encode_path_segment(session_id)}/shell",
|
|
3803
|
+
body={"id": id, "command": command},
|
|
3804
|
+
extra_headers=extra_headers,
|
|
3805
|
+
extra_query=extra_query,
|
|
3806
|
+
extra_body=extra_body,
|
|
3807
|
+
timeout=timeout,
|
|
3808
|
+
),
|
|
3809
|
+
kind="void",
|
|
3187
3810
|
),
|
|
3188
|
-
kind="void",
|
|
3189
3811
|
)
|
|
3190
3812
|
|
|
3191
3813
|
async def compact(
|
|
@@ -3253,16 +3875,19 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
3253
3875
|
|
|
3254
3876
|
``POST /api/experimental/session/:sessionID/wait``
|
|
3255
3877
|
"""
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3878
|
+
return cast(
|
|
3879
|
+
"None",
|
|
3880
|
+
await self._client.request(
|
|
3881
|
+
RequestOptions(
|
|
3882
|
+
method="POST",
|
|
3883
|
+
path=f"/api/experimental/session/{encode_path_segment(session_id)}/wait",
|
|
3884
|
+
extra_headers=extra_headers,
|
|
3885
|
+
extra_query=extra_query,
|
|
3886
|
+
extra_body=extra_body,
|
|
3887
|
+
timeout=timeout,
|
|
3888
|
+
),
|
|
3889
|
+
kind="void",
|
|
3264
3890
|
),
|
|
3265
|
-
kind="void",
|
|
3266
3891
|
)
|
|
3267
3892
|
|
|
3268
3893
|
async def context(
|
|
@@ -3486,16 +4111,19 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
3486
4111
|
|
|
3487
4112
|
``POST /api/session/:sessionID/background``
|
|
3488
4113
|
"""
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
4114
|
+
return cast(
|
|
4115
|
+
"None",
|
|
4116
|
+
await self._client.request(
|
|
4117
|
+
RequestOptions(
|
|
4118
|
+
method="POST",
|
|
4119
|
+
path=f"/api/session/{encode_path_segment(session_id)}/background",
|
|
4120
|
+
extra_headers=extra_headers,
|
|
4121
|
+
extra_query=extra_query,
|
|
4122
|
+
extra_body=extra_body,
|
|
4123
|
+
timeout=timeout,
|
|
4124
|
+
),
|
|
4125
|
+
kind="void",
|
|
3497
4126
|
),
|
|
3498
|
-
kind="void",
|
|
3499
4127
|
)
|
|
3500
4128
|
|
|
3501
4129
|
async def environment(
|
|
@@ -3519,17 +4147,20 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
3519
4147
|
|
|
3520
4148
|
``PUT /api/session/:sessionID/environment``
|
|
3521
4149
|
"""
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
4150
|
+
return cast(
|
|
4151
|
+
"None",
|
|
4152
|
+
await self._client.request(
|
|
4153
|
+
RequestOptions(
|
|
4154
|
+
method="PUT",
|
|
4155
|
+
path=f"/api/session/{encode_path_segment(session_id)}/environment",
|
|
4156
|
+
body={"variables": variables},
|
|
4157
|
+
extra_headers=extra_headers,
|
|
4158
|
+
extra_query=extra_query,
|
|
4159
|
+
extra_body=extra_body,
|
|
4160
|
+
timeout=timeout,
|
|
4161
|
+
),
|
|
4162
|
+
kind="void",
|
|
3531
4163
|
),
|
|
3532
|
-
kind="void",
|
|
3533
4164
|
)
|
|
3534
4165
|
|
|
3535
4166
|
async def view(
|
|
@@ -3553,15 +4184,138 @@ class AsyncSessionResource(AsyncSessionHelpers):
|
|
|
3553
4184
|
|
|
3554
4185
|
``POST /api/session/:sessionID/view``
|
|
3555
4186
|
"""
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
4187
|
+
return cast(
|
|
4188
|
+
"None",
|
|
4189
|
+
await self._client.request(
|
|
4190
|
+
RequestOptions(
|
|
4191
|
+
method="POST",
|
|
4192
|
+
path=f"/api/session/{encode_path_segment(session_id)}/view",
|
|
4193
|
+
body={"idle": idle},
|
|
4194
|
+
extra_headers=extra_headers,
|
|
4195
|
+
extra_query=extra_query,
|
|
4196
|
+
extra_body=extra_body,
|
|
4197
|
+
timeout=timeout,
|
|
4198
|
+
),
|
|
4199
|
+
kind="void",
|
|
3565
4200
|
),
|
|
3566
|
-
kind="void",
|
|
3567
4201
|
)
|
|
4202
|
+
|
|
4203
|
+
|
|
4204
|
+
class AsyncSessionResourceWithRawResponse:
|
|
4205
|
+
"""``client.session.with_raw_response``."""
|
|
4206
|
+
|
|
4207
|
+
def __init__(self, resource: AsyncSessionResource) -> None:
|
|
4208
|
+
self._resource = resource
|
|
4209
|
+
self.list = async_to_raw_response_wrapper(resource.list)
|
|
4210
|
+
self.stats = async_to_raw_response_wrapper(resource.stats)
|
|
4211
|
+
self.create = async_to_raw_response_wrapper(resource.create)
|
|
4212
|
+
self.import_ = async_to_raw_response_wrapper(resource.import_)
|
|
4213
|
+
self.export = async_to_raw_response_wrapper(resource.export)
|
|
4214
|
+
self.active = async_to_raw_response_wrapper(resource.active)
|
|
4215
|
+
self.get = async_to_raw_response_wrapper(resource.get)
|
|
4216
|
+
self.remove = async_to_raw_response_wrapper(resource.remove)
|
|
4217
|
+
self.fork = async_to_raw_response_wrapper(resource.fork)
|
|
4218
|
+
self.switch_agent = async_to_raw_response_wrapper(resource.switch_agent)
|
|
4219
|
+
self.switch_model = async_to_raw_response_wrapper(resource.switch_model)
|
|
4220
|
+
self.update = async_to_raw_response_wrapper(resource.update)
|
|
4221
|
+
self.move = async_to_raw_response_wrapper(resource.move)
|
|
4222
|
+
self.prompt = async_to_raw_response_wrapper(resource.prompt)
|
|
4223
|
+
self.command = async_to_raw_response_wrapper(resource.command)
|
|
4224
|
+
self.skill = async_to_raw_response_wrapper(resource.skill)
|
|
4225
|
+
self.synthetic = async_to_raw_response_wrapper(resource.synthetic)
|
|
4226
|
+
self.shell = async_to_raw_response_wrapper(resource.shell)
|
|
4227
|
+
self.compact = async_to_raw_response_wrapper(resource.compact)
|
|
4228
|
+
self.wait = async_to_raw_response_wrapper(resource.wait)
|
|
4229
|
+
self.context = async_to_raw_response_wrapper(resource.context)
|
|
4230
|
+
self.diff = async_to_raw_response_wrapper(resource.diff)
|
|
4231
|
+
self.generate = async_to_raw_response_wrapper(resource.generate)
|
|
4232
|
+
self.log = async_to_raw_response_wrapper(resource.log)
|
|
4233
|
+
self.interrupt = async_to_raw_response_wrapper(resource.interrupt)
|
|
4234
|
+
self.background = async_to_raw_response_wrapper(resource.background)
|
|
4235
|
+
self.environment = async_to_raw_response_wrapper(resource.environment)
|
|
4236
|
+
self.view = async_to_raw_response_wrapper(resource.view)
|
|
4237
|
+
|
|
4238
|
+
@cached_property
|
|
4239
|
+
def revert(self) -> AsyncSessionRevertResourceWithRawResponse:
|
|
4240
|
+
"""``client.session.revert.with_raw_response``."""
|
|
4241
|
+
return AsyncSessionRevertResourceWithRawResponse(self._resource.revert)
|
|
4242
|
+
|
|
4243
|
+
@cached_property
|
|
4244
|
+
def inbox(self) -> AsyncSessionInboxResourceWithRawResponse:
|
|
4245
|
+
"""``client.session.inbox.with_raw_response``."""
|
|
4246
|
+
return AsyncSessionInboxResourceWithRawResponse(self._resource.inbox)
|
|
4247
|
+
|
|
4248
|
+
@cached_property
|
|
4249
|
+
def instructions(self) -> AsyncSessionInstructionsResourceWithRawResponse:
|
|
4250
|
+
"""``client.session.instructions.with_raw_response``."""
|
|
4251
|
+
return AsyncSessionInstructionsResourceWithRawResponse(self._resource.instructions)
|
|
4252
|
+
|
|
4253
|
+
@cached_property
|
|
4254
|
+
def message(self) -> AsyncSessionMessageResourceWithRawResponse:
|
|
4255
|
+
"""``client.session.message.with_raw_response``."""
|
|
4256
|
+
return AsyncSessionMessageResourceWithRawResponse(self._resource.message)
|
|
4257
|
+
|
|
4258
|
+
@cached_property
|
|
4259
|
+
def form(self) -> AsyncSessionFormResourceWithRawResponse:
|
|
4260
|
+
"""``client.session.form.with_raw_response``."""
|
|
4261
|
+
return AsyncSessionFormResourceWithRawResponse(self._resource.form)
|
|
4262
|
+
|
|
4263
|
+
|
|
4264
|
+
class AsyncSessionResourceWithStreamingResponse:
|
|
4265
|
+
"""``client.session.with_streaming_response``."""
|
|
4266
|
+
|
|
4267
|
+
def __init__(self, resource: AsyncSessionResource) -> None:
|
|
4268
|
+
self._resource = resource
|
|
4269
|
+
self.list = async_to_streamed_response_wrapper(resource.list)
|
|
4270
|
+
self.stats = async_to_streamed_response_wrapper(resource.stats)
|
|
4271
|
+
self.create = async_to_streamed_response_wrapper(resource.create)
|
|
4272
|
+
self.import_ = async_to_streamed_response_wrapper(resource.import_)
|
|
4273
|
+
self.export = async_to_streamed_response_wrapper(resource.export)
|
|
4274
|
+
self.active = async_to_streamed_response_wrapper(resource.active)
|
|
4275
|
+
self.get = async_to_streamed_response_wrapper(resource.get)
|
|
4276
|
+
self.remove = async_to_streamed_response_wrapper(resource.remove)
|
|
4277
|
+
self.fork = async_to_streamed_response_wrapper(resource.fork)
|
|
4278
|
+
self.switch_agent = async_to_streamed_response_wrapper(resource.switch_agent)
|
|
4279
|
+
self.switch_model = async_to_streamed_response_wrapper(resource.switch_model)
|
|
4280
|
+
self.update = async_to_streamed_response_wrapper(resource.update)
|
|
4281
|
+
self.move = async_to_streamed_response_wrapper(resource.move)
|
|
4282
|
+
self.prompt = async_to_streamed_response_wrapper(resource.prompt)
|
|
4283
|
+
self.command = async_to_streamed_response_wrapper(resource.command)
|
|
4284
|
+
self.skill = async_to_streamed_response_wrapper(resource.skill)
|
|
4285
|
+
self.synthetic = async_to_streamed_response_wrapper(resource.synthetic)
|
|
4286
|
+
self.shell = async_to_streamed_response_wrapper(resource.shell)
|
|
4287
|
+
self.compact = async_to_streamed_response_wrapper(resource.compact)
|
|
4288
|
+
self.wait = async_to_streamed_response_wrapper(resource.wait)
|
|
4289
|
+
self.context = async_to_streamed_response_wrapper(resource.context)
|
|
4290
|
+
self.diff = async_to_streamed_response_wrapper(resource.diff)
|
|
4291
|
+
self.generate = async_to_streamed_response_wrapper(resource.generate)
|
|
4292
|
+
self.log = async_to_streamed_response_wrapper(resource.log)
|
|
4293
|
+
self.interrupt = async_to_streamed_response_wrapper(resource.interrupt)
|
|
4294
|
+
self.background = async_to_streamed_response_wrapper(resource.background)
|
|
4295
|
+
self.environment = async_to_streamed_response_wrapper(resource.environment)
|
|
4296
|
+
self.view = async_to_streamed_response_wrapper(resource.view)
|
|
4297
|
+
|
|
4298
|
+
@cached_property
|
|
4299
|
+
def revert(self) -> AsyncSessionRevertResourceWithStreamingResponse:
|
|
4300
|
+
"""``client.session.revert.with_streaming_response``."""
|
|
4301
|
+
return AsyncSessionRevertResourceWithStreamingResponse(self._resource.revert)
|
|
4302
|
+
|
|
4303
|
+
@cached_property
|
|
4304
|
+
def inbox(self) -> AsyncSessionInboxResourceWithStreamingResponse:
|
|
4305
|
+
"""``client.session.inbox.with_streaming_response``."""
|
|
4306
|
+
return AsyncSessionInboxResourceWithStreamingResponse(self._resource.inbox)
|
|
4307
|
+
|
|
4308
|
+
@cached_property
|
|
4309
|
+
def instructions(self) -> AsyncSessionInstructionsResourceWithStreamingResponse:
|
|
4310
|
+
"""``client.session.instructions.with_streaming_response``."""
|
|
4311
|
+
return AsyncSessionInstructionsResourceWithStreamingResponse(self._resource.instructions)
|
|
4312
|
+
|
|
4313
|
+
@cached_property
|
|
4314
|
+
def message(self) -> AsyncSessionMessageResourceWithStreamingResponse:
|
|
4315
|
+
"""``client.session.message.with_streaming_response``."""
|
|
4316
|
+
return AsyncSessionMessageResourceWithStreamingResponse(self._resource.message)
|
|
4317
|
+
|
|
4318
|
+
@cached_property
|
|
4319
|
+
def form(self) -> AsyncSessionFormResourceWithStreamingResponse:
|
|
4320
|
+
"""``client.session.form.with_streaming_response``."""
|
|
4321
|
+
return AsyncSessionFormResourceWithStreamingResponse(self._resource.form)
|