Skip to content

Commit e5b4763

Browse files
feat(api): api update
1 parent d1ef26f commit e5b4763

23 files changed

+72
-1300
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 105
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-7997d2aebc04c657a434b6b1114b61de06f0d873868ee376ac82f5c50d20884f.yml
3-
openapi_spec_hash: 08977f6ad1332cbeb03d95dad748f20a
1+
configured_endpoints: 101
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-09c2a1858834d1a4a69bf9c6ac04c236bdc0763873aa14eae4553222afa08ab2.yml
3+
openapi_spec_hash: aab62076e3b4591fa2def5485c7ddeca
44
config_hash: acdf4142177ed1932c2d82372693f811

api.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -290,21 +290,6 @@ Methods:
290290
- <code title="patch /v1/preference">client.preferences.<a href="./src/asktable/resources/preferences.py">update</a>(\*\*<a href="src/asktable/types/preference_update_params.py">params</a>) -> <a href="./src/asktable/types/preference_update_response.py">PreferenceUpdateResponse</a></code>
291291
- <code title="delete /v1/preference">client.preferences.<a href="./src/asktable/resources/preferences.py">delete</a>() -> object</code>
292292

293-
# Trainings
294-
295-
Types:
296-
297-
```python
298-
from asktable.types import TrainingCreateResponse, TrainingUpdateResponse, TrainingListResponse
299-
```
300-
301-
Methods:
302-
303-
- <code title="post /v1/training">client.trainings.<a href="./src/asktable/resources/trainings.py">create</a>(\*\*<a href="src/asktable/types/training_create_params.py">params</a>) -> <a href="./src/asktable/types/training_create_response.py">TrainingCreateResponse</a></code>
304-
- <code title="patch /v1/training/{id}">client.trainings.<a href="./src/asktable/resources/trainings.py">update</a>(id, \*\*<a href="src/asktable/types/training_update_params.py">params</a>) -> <a href="./src/asktable/types/training_update_response.py">TrainingUpdateResponse</a></code>
305-
- <code title="get /v1/training">client.trainings.<a href="./src/asktable/resources/trainings.py">list</a>(\*\*<a href="src/asktable/types/training_list_params.py">params</a>) -> <a href="./src/asktable/types/training_list_response.py">SyncPage[TrainingListResponse]</a></code>
306-
- <code title="delete /v1/training/{id}">client.trainings.<a href="./src/asktable/resources/trainings.py">delete</a>(id, \*\*<a href="src/asktable/types/training_delete_params.py">params</a>) -> object</code>
307-
308293
# Project
309294

310295
Types:

src/asktable/_client.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
answers,
4747
project,
4848
policies,
49-
trainings,
5049
dataframes,
5150
datasources,
5251
integration,
@@ -66,7 +65,6 @@
6665
from .resources.project import ProjectResource, AsyncProjectResource
6766
from .resources.sys.sys import SysResource, AsyncSysResource
6867
from .resources.policies import PoliciesResource, AsyncPoliciesResource
69-
from .resources.trainings import TrainingsResource, AsyncTrainingsResource
7068
from .resources.user.user import UserResource, AsyncUserResource
7169
from .resources.dataframes import DataframesResource, AsyncDataframesResource
7270
from .resources.chats.chats import ChatsResource, AsyncChatsResource
@@ -233,13 +231,6 @@ def preferences(self) -> PreferencesResource:
233231

234232
return PreferencesResource(self)
235233

236-
@cached_property
237-
def trainings(self) -> TrainingsResource:
238-
"""训练数据管理"""
239-
from .resources.trainings import TrainingsResource
240-
241-
return TrainingsResource(self)
242-
243234
@cached_property
244235
def project(self) -> ProjectResource:
245236
"""我的项目"""
@@ -545,13 +536,6 @@ def preferences(self) -> AsyncPreferencesResource:
545536

546537
return AsyncPreferencesResource(self)
547538

548-
@cached_property
549-
def trainings(self) -> AsyncTrainingsResource:
550-
"""训练数据管理"""
551-
from .resources.trainings import AsyncTrainingsResource
552-
553-
return AsyncTrainingsResource(self)
554-
555539
@cached_property
556540
def project(self) -> AsyncProjectResource:
557541
"""我的项目"""
@@ -808,13 +792,6 @@ def preferences(self) -> preferences.PreferencesResourceWithRawResponse:
808792

809793
return PreferencesResourceWithRawResponse(self._client.preferences)
810794

811-
@cached_property
812-
def trainings(self) -> trainings.TrainingsResourceWithRawResponse:
813-
"""训练数据管理"""
814-
from .resources.trainings import TrainingsResourceWithRawResponse
815-
816-
return TrainingsResourceWithRawResponse(self._client.trainings)
817-
818795
@cached_property
819796
def project(self) -> project.ProjectResourceWithRawResponse:
820797
"""我的项目"""
@@ -959,13 +936,6 @@ def preferences(self) -> preferences.AsyncPreferencesResourceWithRawResponse:
959936

960937
return AsyncPreferencesResourceWithRawResponse(self._client.preferences)
961938

962-
@cached_property
963-
def trainings(self) -> trainings.AsyncTrainingsResourceWithRawResponse:
964-
"""训练数据管理"""
965-
from .resources.trainings import AsyncTrainingsResourceWithRawResponse
966-
967-
return AsyncTrainingsResourceWithRawResponse(self._client.trainings)
968-
969939
@cached_property
970940
def project(self) -> project.AsyncProjectResourceWithRawResponse:
971941
"""我的项目"""
@@ -1110,13 +1080,6 @@ def preferences(self) -> preferences.PreferencesResourceWithStreamingResponse:
11101080

11111081
return PreferencesResourceWithStreamingResponse(self._client.preferences)
11121082

1113-
@cached_property
1114-
def trainings(self) -> trainings.TrainingsResourceWithStreamingResponse:
1115-
"""训练数据管理"""
1116-
from .resources.trainings import TrainingsResourceWithStreamingResponse
1117-
1118-
return TrainingsResourceWithStreamingResponse(self._client.trainings)
1119-
11201083
@cached_property
11211084
def project(self) -> project.ProjectResourceWithStreamingResponse:
11221085
"""我的项目"""
@@ -1261,13 +1224,6 @@ def preferences(self) -> preferences.AsyncPreferencesResourceWithStreamingRespon
12611224

12621225
return AsyncPreferencesResourceWithStreamingResponse(self._client.preferences)
12631226

1264-
@cached_property
1265-
def trainings(self) -> trainings.AsyncTrainingsResourceWithStreamingResponse:
1266-
"""训练数据管理"""
1267-
from .resources.trainings import AsyncTrainingsResourceWithStreamingResponse
1268-
1269-
return AsyncTrainingsResourceWithStreamingResponse(self._client.trainings)
1270-
12711227
@cached_property
12721228
def project(self) -> project.AsyncProjectResourceWithStreamingResponse:
12731229
"""我的项目"""

src/asktable/resources/__init__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,6 @@
112112
PoliciesResourceWithStreamingResponse,
113113
AsyncPoliciesResourceWithStreamingResponse,
114114
)
115-
from .trainings import (
116-
TrainingsResource,
117-
AsyncTrainingsResource,
118-
TrainingsResourceWithRawResponse,
119-
AsyncTrainingsResourceWithRawResponse,
120-
TrainingsResourceWithStreamingResponse,
121-
AsyncTrainingsResourceWithStreamingResponse,
122-
)
123115
from .dataframes import (
124116
DataframesResource,
125117
AsyncDataframesResource,
@@ -248,12 +240,6 @@
248240
"AsyncPreferencesResourceWithRawResponse",
249241
"PreferencesResourceWithStreamingResponse",
250242
"AsyncPreferencesResourceWithStreamingResponse",
251-
"TrainingsResource",
252-
"AsyncTrainingsResource",
253-
"TrainingsResourceWithRawResponse",
254-
"AsyncTrainingsResourceWithRawResponse",
255-
"TrainingsResourceWithStreamingResponse",
256-
"AsyncTrainingsResourceWithStreamingResponse",
257243
"ProjectResource",
258244
"AsyncProjectResource",
259245
"ProjectResourceWithRawResponse",

src/asktable/resources/datasources/datasources.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Dict, Optional
66
from typing_extensions import Literal
77

88
import httpx
@@ -253,11 +253,12 @@ def update(
253253
]
254254
| Omit = omit,
255255
field_count: Optional[int] | Omit = omit,
256-
meta_error: Optional[str] | Omit = omit,
257-
meta_status: Optional[Literal["processing", "failed", "success", "unprocessed"]] | Omit = omit,
256+
meta_status: Optional[Literal["unavailable", "available"]] | Omit = omit,
258257
name: Optional[str] | Omit = omit,
259258
sample_questions: Optional[str] | Omit = omit,
260259
schema_count: Optional[int] | Omit = omit,
260+
sync_error: Optional[Dict[str, object]] | Omit = omit,
261+
sync_status: Optional[Literal["processing", "success", "failed", "warning"]] | Omit = omit,
261262
table_count: Optional[int] | Omit = omit,
262263
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
263264
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -278,16 +279,18 @@ def update(
278279
279280
field_count: 字段数量
280281
281-
meta_error: 元数据处理错误
282-
283-
meta_status: 元数据处理状态
282+
meta_status: 数据源可用性
284283
285284
name: 数据源的名称
286285
287286
sample_questions: 示例问题
288287
289288
schema_count: 库数量
290289
290+
sync_error: 同步错误信息
291+
292+
sync_status: 同步状态
293+
291294
table_count: 表数量
292295
293296
extra_headers: Send extra headers
@@ -308,11 +311,12 @@ def update(
308311
"desc": desc,
309312
"engine": engine,
310313
"field_count": field_count,
311-
"meta_error": meta_error,
312314
"meta_status": meta_status,
313315
"name": name,
314316
"sample_questions": sample_questions,
315317
"schema_count": schema_count,
318+
"sync_error": sync_error,
319+
"sync_status": sync_status,
316320
"table_count": table_count,
317321
},
318322
datasource_update_params.DatasourceUpdateParams,
@@ -773,11 +777,12 @@ async def update(
773777
]
774778
| Omit = omit,
775779
field_count: Optional[int] | Omit = omit,
776-
meta_error: Optional[str] | Omit = omit,
777-
meta_status: Optional[Literal["processing", "failed", "success", "unprocessed"]] | Omit = omit,
780+
meta_status: Optional[Literal["unavailable", "available"]] | Omit = omit,
778781
name: Optional[str] | Omit = omit,
779782
sample_questions: Optional[str] | Omit = omit,
780783
schema_count: Optional[int] | Omit = omit,
784+
sync_error: Optional[Dict[str, object]] | Omit = omit,
785+
sync_status: Optional[Literal["processing", "success", "failed", "warning"]] | Omit = omit,
781786
table_count: Optional[int] | Omit = omit,
782787
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
783788
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -798,16 +803,18 @@ async def update(
798803
799804
field_count: 字段数量
800805
801-
meta_error: 元数据处理错误
802-
803-
meta_status: 元数据处理状态
806+
meta_status: 数据源可用性
804807
805808
name: 数据源的名称
806809
807810
sample_questions: 示例问题
808811
809812
schema_count: 库数量
810813
814+
sync_error: 同步错误信息
815+
816+
sync_status: 同步状态
817+
811818
table_count: 表数量
812819
813820
extra_headers: Send extra headers
@@ -828,11 +835,12 @@ async def update(
828835
"desc": desc,
829836
"engine": engine,
830837
"field_count": field_count,
831-
"meta_error": meta_error,
832838
"meta_status": meta_status,
833839
"name": name,
834840
"sample_questions": sample_questions,
835841
"schema_count": schema_count,
842+
"sync_error": sync_error,
843+
"sync_status": sync_status,
836844
"table_count": table_count,
837845
},
838846
datasource_update_params.DatasourceUpdateParams,

src/asktable/resources/datasources/meta.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ def create(
6161
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6262
) -> object:
6363
"""
64-
创建数据源的 meta,如果已经存在,则删除旧的
65-
66-
如果上传了 meta,则使用用户上传的数据创建。
67-
68-
否则从数据源中自动获取。
64+
初始化数据源的 meta。不允许覆盖已成功初始化的 meta,需使用 PUT 更新。
6965
7066
Args:
7167
extra_headers: Send extra headers
@@ -257,11 +253,7 @@ async def create(
257253
timeout: float | httpx.Timeout | None | NotGiven = not_given,
258254
) -> object:
259255
"""
260-
创建数据源的 meta,如果已经存在,则删除旧的
261-
262-
如果上传了 meta,则使用用户上传的数据创建。
263-
264-
否则从数据源中自动获取。
256+
初始化数据源的 meta。不允许覆盖已成功初始化的 meta,需使用 PUT 更新。
265257
266258
Args:
267259
extra_headers: Send extra headers

0 commit comments

Comments
 (0)