opencode-python-sdk 0.0.1.dev1__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/.generated.json +39 -0
- opencode/__init__.py +221 -0
- opencode/_base_client.py +539 -0
- opencode/_client.py +255 -0
- opencode/_constants.py +27 -0
- opencode/_errors.py +547 -0
- opencode/_events.py +732 -0
- opencode/_exceptions.py +271 -0
- opencode/_models.py +54 -0
- opencode/_pagination.py +192 -0
- opencode/_pty.py +586 -0
- opencode/_qs.py +95 -0
- opencode/_resource.py +42 -0
- opencode/_rpc.py +489 -0
- opencode/_server.py +335 -0
- opencode/_streaming.py +248 -0
- opencode/_types.py +77 -0
- opencode/_unions.py +46 -0
- opencode/_version.py +8 -0
- opencode/lib/__init__.py +5 -0
- opencode/lib/_ready.py +91 -0
- opencode/lib/_session.py +231 -0
- opencode/py.typed +0 -0
- opencode/resources/__init__.py +364 -0
- opencode/resources/agent.py +179 -0
- opencode/resources/command.py +100 -0
- opencode/resources/config.py +240 -0
- opencode/resources/credential.py +384 -0
- opencode/resources/debug.py +178 -0
- opencode/resources/event.py +88 -0
- opencode/resources/experimental.py +765 -0
- opencode/resources/file.py +355 -0
- opencode/resources/form.py +100 -0
- opencode/resources/generate.py +110 -0
- opencode/resources/integration.py +1033 -0
- opencode/resources/location.py +162 -0
- opencode/resources/mcp.py +492 -0
- opencode/resources/message.py +152 -0
- opencode/resources/migration.py +118 -0
- opencode/resources/model.py +177 -0
- opencode/resources/permission.py +704 -0
- opencode/resources/plugin.py +250 -0
- opencode/resources/project.py +187 -0
- opencode/resources/provider.py +183 -0
- opencode/resources/pty.py +522 -0
- opencode/resources/reference.py +100 -0
- opencode/resources/rpc.py +113 -0
- opencode/resources/server.py +230 -0
- opencode/resources/session.py +3567 -0
- opencode/resources/shell.py +412 -0
- opencode/resources/skill.py +100 -0
- opencode/resources/vcs.py +500 -0
- opencode/resources/voice.py +113 -0
- opencode/resources/websearch.py +184 -0
- opencode/resources/worktree.py +336 -0
- opencode/testing.py +508 -0
- opencode/types/__init__.py +1462 -0
- opencode/types/_generated.py +8540 -0
- opencode_python_sdk-0.0.1.dev1.dist-info/METADATA +468 -0
- opencode_python_sdk-0.0.1.dev1.dist-info/RECORD +62 -0
- opencode_python_sdk-0.0.1.dev1.dist-info/WHEEL +4 -0
- opencode_python_sdk-0.0.1.dev1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# This file is generated by `python -m codegen` from spec/contract.json. Do not edit it by hand.
|
|
2
|
+
# OpenCode 2.1.2
|
|
3
|
+
|
|
4
|
+
"""The ``message`` resource."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from typing import TYPE_CHECKING, Literal
|
|
9
|
+
|
|
10
|
+
from .._base_client import RequestOptions
|
|
11
|
+
from .._pagination import AsyncPaginator, SyncCursorPage
|
|
12
|
+
from .._qs import encode_path_segment
|
|
13
|
+
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
14
|
+
from .._types import NOT_GIVEN, Body, Headers, NotGiven, OpenEnum, Query, Timeout
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..types import (
|
|
18
|
+
SessionID,
|
|
19
|
+
SessionMessageInfo,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
__all__ = ["MessageResource", "AsyncMessageResource"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class MessageResource(SyncAPIResource):
|
|
26
|
+
"""Operations under ``client.message`` (OpenCode ``message``)."""
|
|
27
|
+
|
|
28
|
+
def list(
|
|
29
|
+
self,
|
|
30
|
+
session_id: SessionID,
|
|
31
|
+
*,
|
|
32
|
+
limit: int | NotGiven | None = NOT_GIVEN,
|
|
33
|
+
order: OpenEnum[Literal["asc", "desc"]] | NotGiven | None = NOT_GIVEN,
|
|
34
|
+
cursor: str | NotGiven | None = NOT_GIVEN,
|
|
35
|
+
type: OpenEnum[
|
|
36
|
+
Literal[
|
|
37
|
+
"agent-switched",
|
|
38
|
+
"model-switched",
|
|
39
|
+
"location-switched",
|
|
40
|
+
"user",
|
|
41
|
+
"synthetic",
|
|
42
|
+
"system",
|
|
43
|
+
"skill",
|
|
44
|
+
"shell",
|
|
45
|
+
"assistant",
|
|
46
|
+
"compaction",
|
|
47
|
+
"idle",
|
|
48
|
+
]
|
|
49
|
+
]
|
|
50
|
+
| NotGiven
|
|
51
|
+
| None = NOT_GIVEN,
|
|
52
|
+
extra_headers: Headers | None = None,
|
|
53
|
+
extra_query: Query | None = None,
|
|
54
|
+
extra_body: Body | None = None,
|
|
55
|
+
timeout: Timeout | NotGiven = NOT_GIVEN,
|
|
56
|
+
) -> SyncCursorPage[SessionMessageInfo]:
|
|
57
|
+
"""Get session messages.
|
|
58
|
+
|
|
59
|
+
Retrieve projected messages for a session, optionally filtered by type. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline, passing the same type filter on each page.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
limit: Maximum number of messages to return. When omitted, the endpoint returns its default page size.
|
|
63
|
+
order: Message order for the first page. Use desc for newest first or asc for oldest first.
|
|
64
|
+
cursor: Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order.
|
|
65
|
+
type: Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.
|
|
66
|
+
|
|
67
|
+
Raises:
|
|
68
|
+
InvalidCursorError: The server answered 400.
|
|
69
|
+
InvalidRequestError: The server answered 400.
|
|
70
|
+
UnauthorizedError: The server answered 401.
|
|
71
|
+
SessionNotFoundError: The server answered 404.
|
|
72
|
+
UnknownError: The server answered 500.
|
|
73
|
+
|
|
74
|
+
``GET /api/session/:sessionID/message``
|
|
75
|
+
"""
|
|
76
|
+
return self._client.page(
|
|
77
|
+
RequestOptions(
|
|
78
|
+
method="GET",
|
|
79
|
+
path=f"/api/session/{encode_path_segment(session_id)}/message",
|
|
80
|
+
query={"limit": limit, "order": order, "cursor": cursor, "type": type},
|
|
81
|
+
extra_headers=extra_headers,
|
|
82
|
+
extra_query=extra_query,
|
|
83
|
+
extra_body=extra_body,
|
|
84
|
+
timeout=timeout,
|
|
85
|
+
),
|
|
86
|
+
response_type="SessionMessagesResponse",
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class AsyncMessageResource(AsyncAPIResource):
|
|
91
|
+
"""Operations under ``client.message`` (OpenCode ``message``)."""
|
|
92
|
+
|
|
93
|
+
def list(
|
|
94
|
+
self,
|
|
95
|
+
session_id: SessionID,
|
|
96
|
+
*,
|
|
97
|
+
limit: int | NotGiven | None = NOT_GIVEN,
|
|
98
|
+
order: OpenEnum[Literal["asc", "desc"]] | NotGiven | None = NOT_GIVEN,
|
|
99
|
+
cursor: str | NotGiven | None = NOT_GIVEN,
|
|
100
|
+
type: OpenEnum[
|
|
101
|
+
Literal[
|
|
102
|
+
"agent-switched",
|
|
103
|
+
"model-switched",
|
|
104
|
+
"location-switched",
|
|
105
|
+
"user",
|
|
106
|
+
"synthetic",
|
|
107
|
+
"system",
|
|
108
|
+
"skill",
|
|
109
|
+
"shell",
|
|
110
|
+
"assistant",
|
|
111
|
+
"compaction",
|
|
112
|
+
"idle",
|
|
113
|
+
]
|
|
114
|
+
]
|
|
115
|
+
| NotGiven
|
|
116
|
+
| None = NOT_GIVEN,
|
|
117
|
+
extra_headers: Headers | None = None,
|
|
118
|
+
extra_query: Query | None = None,
|
|
119
|
+
extra_body: Body | None = None,
|
|
120
|
+
timeout: Timeout | NotGiven = NOT_GIVEN,
|
|
121
|
+
) -> AsyncPaginator[SessionMessageInfo]:
|
|
122
|
+
"""Get session messages.
|
|
123
|
+
|
|
124
|
+
Retrieve projected messages for a session, optionally filtered by type. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline, passing the same type filter on each page.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
limit: Maximum number of messages to return. When omitted, the endpoint returns its default page size.
|
|
128
|
+
order: Message order for the first page. Use desc for newest first or asc for oldest first.
|
|
129
|
+
cursor: Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order.
|
|
130
|
+
type: Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
InvalidCursorError: The server answered 400.
|
|
134
|
+
InvalidRequestError: The server answered 400.
|
|
135
|
+
UnauthorizedError: The server answered 401.
|
|
136
|
+
SessionNotFoundError: The server answered 404.
|
|
137
|
+
UnknownError: The server answered 500.
|
|
138
|
+
|
|
139
|
+
``GET /api/session/:sessionID/message``
|
|
140
|
+
"""
|
|
141
|
+
return self._client.page(
|
|
142
|
+
RequestOptions(
|
|
143
|
+
method="GET",
|
|
144
|
+
path=f"/api/session/{encode_path_segment(session_id)}/message",
|
|
145
|
+
query={"limit": limit, "order": order, "cursor": cursor, "type": type},
|
|
146
|
+
extra_headers=extra_headers,
|
|
147
|
+
extra_query=extra_query,
|
|
148
|
+
extra_body=extra_body,
|
|
149
|
+
timeout=timeout,
|
|
150
|
+
),
|
|
151
|
+
response_type="SessionMessagesResponse",
|
|
152
|
+
)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# This file is generated by `python -m codegen` from spec/contract.json. Do not edit it by hand.
|
|
2
|
+
# OpenCode 2.1.2
|
|
3
|
+
|
|
4
|
+
"""The ``migration`` resource."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from functools import cached_property
|
|
9
|
+
from typing import TYPE_CHECKING, cast
|
|
10
|
+
|
|
11
|
+
from .._base_client import RequestOptions
|
|
12
|
+
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
13
|
+
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..types import (
|
|
17
|
+
MigrationV1StatusResponseOption1,
|
|
18
|
+
MigrationV1StatusResponseOption2,
|
|
19
|
+
MigrationV1StatusResponseOption3,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
__all__ = ["MigrationResource", "AsyncMigrationResource"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class MigrationV1Resource(SyncAPIResource):
|
|
26
|
+
"""Operations under ``client.migration.v1`` (OpenCode ``migration.v1``)."""
|
|
27
|
+
|
|
28
|
+
def status(
|
|
29
|
+
self,
|
|
30
|
+
*,
|
|
31
|
+
extra_headers: Headers | None = None,
|
|
32
|
+
extra_query: Query | None = None,
|
|
33
|
+
extra_body: Body | None = None,
|
|
34
|
+
timeout: Timeout | NotGiven = NOT_GIVEN,
|
|
35
|
+
) -> MigrationV1StatusResponseOption1 | MigrationV1StatusResponseOption2 | MigrationV1StatusResponseOption3:
|
|
36
|
+
"""Get V1 migration status.
|
|
37
|
+
|
|
38
|
+
Return the progress of the V1 to V2 session history migration.
|
|
39
|
+
|
|
40
|
+
This endpoint is experimental in OpenCode and may change without notice.
|
|
41
|
+
|
|
42
|
+
Raises:
|
|
43
|
+
InvalidRequestError: The server answered 400.
|
|
44
|
+
UnauthorizedError: The server answered 401.
|
|
45
|
+
|
|
46
|
+
``GET /api/experimental/migration/v1``
|
|
47
|
+
"""
|
|
48
|
+
return cast(
|
|
49
|
+
"MigrationV1StatusResponseOption1 | MigrationV1StatusResponseOption2 | MigrationV1StatusResponseOption3",
|
|
50
|
+
self._client.request(
|
|
51
|
+
RequestOptions(
|
|
52
|
+
method="GET",
|
|
53
|
+
path="/api/experimental/migration/v1",
|
|
54
|
+
extra_headers=extra_headers,
|
|
55
|
+
extra_query=extra_query,
|
|
56
|
+
extra_body=extra_body,
|
|
57
|
+
timeout=timeout,
|
|
58
|
+
),
|
|
59
|
+
response_type="MigrationV1StatusResponseOption1 | MigrationV1StatusResponseOption2 | MigrationV1StatusResponseOption3",
|
|
60
|
+
),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class MigrationResource(SyncAPIResource):
|
|
65
|
+
"""Operations under ``client.migration`` (OpenCode ``migration``)."""
|
|
66
|
+
|
|
67
|
+
@cached_property
|
|
68
|
+
def v1(self) -> MigrationV1Resource:
|
|
69
|
+
"""Operations under ``client.migration.v1``."""
|
|
70
|
+
return MigrationV1Resource(self._client)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class AsyncMigrationV1Resource(AsyncAPIResource):
|
|
74
|
+
"""Operations under ``client.migration.v1`` (OpenCode ``migration.v1``)."""
|
|
75
|
+
|
|
76
|
+
async def status(
|
|
77
|
+
self,
|
|
78
|
+
*,
|
|
79
|
+
extra_headers: Headers | None = None,
|
|
80
|
+
extra_query: Query | None = None,
|
|
81
|
+
extra_body: Body | None = None,
|
|
82
|
+
timeout: Timeout | NotGiven = NOT_GIVEN,
|
|
83
|
+
) -> MigrationV1StatusResponseOption1 | MigrationV1StatusResponseOption2 | MigrationV1StatusResponseOption3:
|
|
84
|
+
"""Get V1 migration status.
|
|
85
|
+
|
|
86
|
+
Return the progress of the V1 to V2 session history migration.
|
|
87
|
+
|
|
88
|
+
This endpoint is experimental in OpenCode and may change without notice.
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
InvalidRequestError: The server answered 400.
|
|
92
|
+
UnauthorizedError: The server answered 401.
|
|
93
|
+
|
|
94
|
+
``GET /api/experimental/migration/v1``
|
|
95
|
+
"""
|
|
96
|
+
return cast(
|
|
97
|
+
"MigrationV1StatusResponseOption1 | MigrationV1StatusResponseOption2 | MigrationV1StatusResponseOption3",
|
|
98
|
+
await self._client.request(
|
|
99
|
+
RequestOptions(
|
|
100
|
+
method="GET",
|
|
101
|
+
path="/api/experimental/migration/v1",
|
|
102
|
+
extra_headers=extra_headers,
|
|
103
|
+
extra_query=extra_query,
|
|
104
|
+
extra_body=extra_body,
|
|
105
|
+
timeout=timeout,
|
|
106
|
+
),
|
|
107
|
+
response_type="MigrationV1StatusResponseOption1 | MigrationV1StatusResponseOption2 | MigrationV1StatusResponseOption3",
|
|
108
|
+
),
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class AsyncMigrationResource(AsyncAPIResource):
|
|
113
|
+
"""Operations under ``client.migration`` (OpenCode ``migration``)."""
|
|
114
|
+
|
|
115
|
+
@cached_property
|
|
116
|
+
def v1(self) -> AsyncMigrationV1Resource:
|
|
117
|
+
"""Operations under ``client.migration.v1``."""
|
|
118
|
+
return AsyncMigrationV1Resource(self._client)
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# This file is generated by `python -m codegen` from spec/contract.json. Do not edit it by hand.
|
|
2
|
+
# OpenCode 2.1.2
|
|
3
|
+
|
|
4
|
+
"""The ``model`` resource."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from typing import TYPE_CHECKING, cast
|
|
9
|
+
|
|
10
|
+
from .._base_client import RequestOptions
|
|
11
|
+
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
12
|
+
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..types import (
|
|
16
|
+
Location,
|
|
17
|
+
ModelDefaultResponse,
|
|
18
|
+
ModelListResponse,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__all__ = ["ModelResource", "AsyncModelResource"]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ModelResource(SyncAPIResource):
|
|
25
|
+
"""Operations under ``client.model`` (OpenCode ``model``)."""
|
|
26
|
+
|
|
27
|
+
def list(
|
|
28
|
+
self,
|
|
29
|
+
*,
|
|
30
|
+
location: Location | NotGiven | None = NOT_GIVEN,
|
|
31
|
+
extra_headers: Headers | None = None,
|
|
32
|
+
extra_query: Query | None = None,
|
|
33
|
+
extra_body: Body | None = None,
|
|
34
|
+
timeout: Timeout | NotGiven = NOT_GIVEN,
|
|
35
|
+
) -> ModelListResponse:
|
|
36
|
+
"""List models.
|
|
37
|
+
|
|
38
|
+
Retrieve the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.
|
|
39
|
+
|
|
40
|
+
Raises:
|
|
41
|
+
InvalidRequestError: The server answered 400.
|
|
42
|
+
UnauthorizedError: The server answered 401.
|
|
43
|
+
LocationNotFoundError: The server answered 404.
|
|
44
|
+
ServiceUnavailableError: The server answered 503.
|
|
45
|
+
|
|
46
|
+
``GET /api/model``
|
|
47
|
+
"""
|
|
48
|
+
return cast(
|
|
49
|
+
"ModelListResponse",
|
|
50
|
+
self._client.request(
|
|
51
|
+
RequestOptions(
|
|
52
|
+
method="GET",
|
|
53
|
+
path="/api/model",
|
|
54
|
+
query={"location": self._location(location)},
|
|
55
|
+
extra_headers=extra_headers,
|
|
56
|
+
extra_query=extra_query,
|
|
57
|
+
extra_body=extra_body,
|
|
58
|
+
timeout=timeout,
|
|
59
|
+
),
|
|
60
|
+
response_type="ModelListResponse",
|
|
61
|
+
),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
def default(
|
|
65
|
+
self,
|
|
66
|
+
*,
|
|
67
|
+
location: Location | NotGiven | None = NOT_GIVEN,
|
|
68
|
+
extra_headers: Headers | None = None,
|
|
69
|
+
extra_query: Query | None = None,
|
|
70
|
+
extra_body: Body | None = None,
|
|
71
|
+
timeout: Timeout | NotGiven = NOT_GIVEN,
|
|
72
|
+
) -> ModelDefaultResponse:
|
|
73
|
+
"""Get default model.
|
|
74
|
+
|
|
75
|
+
Retrieve the model used when a session has no explicit model selection.
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
InvalidRequestError: The server answered 400.
|
|
79
|
+
UnauthorizedError: The server answered 401.
|
|
80
|
+
LocationNotFoundError: The server answered 404.
|
|
81
|
+
ServiceUnavailableError: The server answered 503.
|
|
82
|
+
|
|
83
|
+
``GET /api/model/default``
|
|
84
|
+
"""
|
|
85
|
+
return cast(
|
|
86
|
+
"ModelDefaultResponse",
|
|
87
|
+
self._client.request(
|
|
88
|
+
RequestOptions(
|
|
89
|
+
method="GET",
|
|
90
|
+
path="/api/model/default",
|
|
91
|
+
query={"location": self._location(location)},
|
|
92
|
+
extra_headers=extra_headers,
|
|
93
|
+
extra_query=extra_query,
|
|
94
|
+
extra_body=extra_body,
|
|
95
|
+
timeout=timeout,
|
|
96
|
+
),
|
|
97
|
+
response_type="ModelDefaultResponse",
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class AsyncModelResource(AsyncAPIResource):
|
|
103
|
+
"""Operations under ``client.model`` (OpenCode ``model``)."""
|
|
104
|
+
|
|
105
|
+
async def list(
|
|
106
|
+
self,
|
|
107
|
+
*,
|
|
108
|
+
location: Location | NotGiven | None = NOT_GIVEN,
|
|
109
|
+
extra_headers: Headers | None = None,
|
|
110
|
+
extra_query: Query | None = None,
|
|
111
|
+
extra_body: Body | None = None,
|
|
112
|
+
timeout: Timeout | NotGiven = NOT_GIVEN,
|
|
113
|
+
) -> ModelListResponse:
|
|
114
|
+
"""List models.
|
|
115
|
+
|
|
116
|
+
Retrieve the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
InvalidRequestError: The server answered 400.
|
|
120
|
+
UnauthorizedError: The server answered 401.
|
|
121
|
+
LocationNotFoundError: The server answered 404.
|
|
122
|
+
ServiceUnavailableError: The server answered 503.
|
|
123
|
+
|
|
124
|
+
``GET /api/model``
|
|
125
|
+
"""
|
|
126
|
+
return cast(
|
|
127
|
+
"ModelListResponse",
|
|
128
|
+
await self._client.request(
|
|
129
|
+
RequestOptions(
|
|
130
|
+
method="GET",
|
|
131
|
+
path="/api/model",
|
|
132
|
+
query={"location": self._location(location)},
|
|
133
|
+
extra_headers=extra_headers,
|
|
134
|
+
extra_query=extra_query,
|
|
135
|
+
extra_body=extra_body,
|
|
136
|
+
timeout=timeout,
|
|
137
|
+
),
|
|
138
|
+
response_type="ModelListResponse",
|
|
139
|
+
),
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
async def default(
|
|
143
|
+
self,
|
|
144
|
+
*,
|
|
145
|
+
location: Location | NotGiven | None = NOT_GIVEN,
|
|
146
|
+
extra_headers: Headers | None = None,
|
|
147
|
+
extra_query: Query | None = None,
|
|
148
|
+
extra_body: Body | None = None,
|
|
149
|
+
timeout: Timeout | NotGiven = NOT_GIVEN,
|
|
150
|
+
) -> ModelDefaultResponse:
|
|
151
|
+
"""Get default model.
|
|
152
|
+
|
|
153
|
+
Retrieve the model used when a session has no explicit model selection.
|
|
154
|
+
|
|
155
|
+
Raises:
|
|
156
|
+
InvalidRequestError: The server answered 400.
|
|
157
|
+
UnauthorizedError: The server answered 401.
|
|
158
|
+
LocationNotFoundError: The server answered 404.
|
|
159
|
+
ServiceUnavailableError: The server answered 503.
|
|
160
|
+
|
|
161
|
+
``GET /api/model/default``
|
|
162
|
+
"""
|
|
163
|
+
return cast(
|
|
164
|
+
"ModelDefaultResponse",
|
|
165
|
+
await self._client.request(
|
|
166
|
+
RequestOptions(
|
|
167
|
+
method="GET",
|
|
168
|
+
path="/api/model/default",
|
|
169
|
+
query={"location": self._location(location)},
|
|
170
|
+
extra_headers=extra_headers,
|
|
171
|
+
extra_query=extra_query,
|
|
172
|
+
extra_body=extra_body,
|
|
173
|
+
timeout=timeout,
|
|
174
|
+
),
|
|
175
|
+
response_type="ModelDefaultResponse",
|
|
176
|
+
),
|
|
177
|
+
)
|