Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.3.0"
".": "3.4.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 81
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-f78191153cae54be3e273ca76fbb91453dec4696f00fc6d679ca2ffc3d533ede.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-4bee800ad604492e6ee5776c10e1668037755aeaae6ff6faa2d09a0c3763eeee.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.4.0 (2024-11-24)

Full Changelog: [v3.3.0...v3.4.0](https://github.com/DataMini/asktable-python/compare/v3.3.0...v3.4.0)

### Features

* **api:** api update ([#46](https://github.com/DataMini/asktable-python/issues/46)) ([328bd3d](https://github.com/DataMini/asktable-python/commit/328bd3d8c4cc07718f3acacb22541eedf97b4a7c))

## 3.3.0 (2024-11-24)

Full Changelog: [v3.2.0...v3.3.0](https://github.com/DataMini/asktable-python/compare/v3.2.0...v3.3.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "asktable"
version = "3.3.0"
version = "3.4.0"
description = "The official Python library for the asktable API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/asktable/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "asktable"
__version__ = "3.3.0" # x-release-please-version
__version__ = "3.4.0" # x-release-please-version
18 changes: 16 additions & 2 deletions src/asktable/resources/datasources/datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def create(
*,
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks"],
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -139,7 +140,11 @@ def create(
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{"async_process_meta": async_process_meta}, datasource_create_params.DatasourceCreateParams
{
"async_process_meta": async_process_meta,
"value_index": value_index,
},
datasource_create_params.DatasourceCreateParams,
),
),
cast_to=Datasource,
Expand Down Expand Up @@ -340,6 +345,7 @@ def create_from_file(
file: FileTypes,
async_process_meta: bool | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -378,6 +384,7 @@ def create_from_file(
{
"async_process_meta": async_process_meta,
"name": name,
"value_index": value_index,
},
datasource_create_from_file_params.DatasourceCreateFromFileParams,
),
Expand Down Expand Up @@ -423,6 +430,7 @@ async def create(
*,
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks"],
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -466,7 +474,11 @@ async def create(
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"async_process_meta": async_process_meta}, datasource_create_params.DatasourceCreateParams
{
"async_process_meta": async_process_meta,
"value_index": value_index,
},
datasource_create_params.DatasourceCreateParams,
),
),
cast_to=Datasource,
Expand Down Expand Up @@ -667,6 +679,7 @@ async def create_from_file(
file: FileTypes,
async_process_meta: bool | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -705,6 +718,7 @@ async def create_from_file(
{
"async_process_meta": async_process_meta,
"name": name,
"value_index": value_index,
},
datasource_create_from_file_params.DatasourceCreateFromFileParams,
),
Expand Down
36 changes: 34 additions & 2 deletions src/asktable/resources/datasources/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def create(
datasource_id: str,
*,
name: str,
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
schemas: Dict[str, meta_create_params.MetaCreateSchemas] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -88,6 +90,8 @@ def create(
datasource_id: str,
*,
body: None,
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -119,6 +123,8 @@ def create(
datasource_id: str,
*,
name: str | NotGiven = NOT_GIVEN,
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
schemas: Dict[str, meta_create_params.MetaCreateSchemas] | NotGiven = NOT_GIVEN,
body: None | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -141,7 +147,17 @@ def create(
meta_create_params.MetaCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"async_process_meta": async_process_meta,
"value_index": value_index,
},
meta_create_params.MetaCreateParams,
),
),
cast_to=object,
)
Expand Down Expand Up @@ -331,6 +347,8 @@ async def create(
datasource_id: str,
*,
name: str,
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
schemas: Dict[str, meta_create_params.MetaCreateSchemas] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -365,6 +383,8 @@ async def create(
datasource_id: str,
*,
body: None,
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -396,6 +416,8 @@ async def create(
datasource_id: str,
*,
name: str | NotGiven = NOT_GIVEN,
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
schemas: Dict[str, meta_create_params.MetaCreateSchemas] | NotGiven = NOT_GIVEN,
body: None | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -418,7 +440,17 @@ async def create(
meta_create_params.MetaCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{
"async_process_meta": async_process_meta,
"value_index": value_index,
},
meta_create_params.MetaCreateParams,
),
),
cast_to=object,
)
Expand Down
32 changes: 28 additions & 4 deletions src/asktable/resources/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def create_excel_ds(
self,
*,
file_url: str,
value_index: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -78,7 +79,11 @@ def create_excel_ds(
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{"file_url": file_url}, integration_create_excel_ds_params.IntegrationCreateExcelDsParams
{
"file_url": file_url,
"value_index": value_index,
},
integration_create_excel_ds_params.IntegrationCreateExcelDsParams,
),
),
cast_to=Datasource,
Expand All @@ -89,6 +94,7 @@ def excel_csv_ask(
*,
file_url: str,
question: str,
value_index: bool | NotGiven = NOT_GIVEN,
with_json: Optional[bool] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -126,7 +132,13 @@ def excel_csv_ask(
integration_excel_csv_ask_params.IntegrationExcelCsvAskParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{"value_index": value_index}, integration_excel_csv_ask_params.IntegrationExcelCsvAskParams
),
),
cast_to=FileAskResponse,
)
Expand Down Expand Up @@ -156,6 +168,7 @@ async def create_excel_ds(
self,
*,
file_url: str,
value_index: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -183,7 +196,11 @@ async def create_excel_ds(
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"file_url": file_url}, integration_create_excel_ds_params.IntegrationCreateExcelDsParams
{
"file_url": file_url,
"value_index": value_index,
},
integration_create_excel_ds_params.IntegrationCreateExcelDsParams,
),
),
cast_to=Datasource,
Expand All @@ -194,6 +211,7 @@ async def excel_csv_ask(
*,
file_url: str,
question: str,
value_index: bool | NotGiven = NOT_GIVEN,
with_json: Optional[bool] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -231,7 +249,13 @@ async def excel_csv_ask(
integration_excel_csv_ask_params.IntegrationExcelCsvAskParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"value_index": value_index}, integration_excel_csv_ask_params.IntegrationExcelCsvAskParams
),
),
cast_to=FileAskResponse,
)
Expand Down
8 changes: 8 additions & 0 deletions src/asktable/resources/sys/projects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def update(
self,
project_id: str,
*,
llm_model_group: Optional[str] | NotGiven = NOT_GIVEN,
locked: Optional[bool] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -143,6 +144,8 @@ def update(
Update Project

Args:
llm_model_group: 模型组

locked: 是否锁定

name: 项目名称
Expand All @@ -161,6 +164,7 @@ def update(
f"/sys/projects/{project_id}",
body=maybe_transform(
{
"llm_model_group": llm_model_group,
"locked": locked,
"name": name,
},
Expand Down Expand Up @@ -352,6 +356,7 @@ async def update(
self,
project_id: str,
*,
llm_model_group: Optional[str] | NotGiven = NOT_GIVEN,
locked: Optional[bool] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -365,6 +370,8 @@ async def update(
Update Project

Args:
llm_model_group: 模型组

locked: 是否锁定

name: 项目名称
Expand All @@ -383,6 +390,7 @@ async def update(
f"/sys/projects/{project_id}",
body=await async_maybe_transform(
{
"llm_model_group": llm_model_group,
"locked": locked,
"name": name,
},
Expand Down
2 changes: 2 additions & 0 deletions src/asktable/types/datasource_create_from_file_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ class DatasourceCreateFromFileParams(TypedDict, total=False):
async_process_meta: bool

name: str

value_index: bool
2 changes: 2 additions & 0 deletions src/asktable/types/datasource_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class DatasourceCreateParams(TypedDict, total=False):

async_process_meta: bool

value_index: bool

access_config: Optional[AccessConfig]
"""不同引擎有不同的配置"""

Expand Down
8 changes: 8 additions & 0 deletions src/asktable/types/datasources/meta_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class MetaCreate(TypedDict, total=False):
name: Required[str]
"""metadata_name"""

async_process_meta: bool

value_index: bool

schemas: Dict[str, MetaCreateSchemas]


Expand Down Expand Up @@ -62,5 +66,9 @@ class MetaCreateSchemas(TypedDict, total=False):
class Variant1(TypedDict, total=False):
body: Required[None]

async_process_meta: bool

value_index: bool


MetaCreateParams: TypeAlias = Union[MetaCreate, Variant1]
2 changes: 2 additions & 0 deletions src/asktable/types/integration_create_excel_ds_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@

class IntegrationCreateExcelDsParams(TypedDict, total=False):
file_url: Required[str]

value_index: bool
2 changes: 2 additions & 0 deletions src/asktable/types/integration_excel_csv_ask_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ class IntegrationExcelCsvAskParams(TypedDict, total=False):
question: Required[str]
"""用户问题"""

value_index: bool

with_json: Optional[bool]
"""是否将数据作为 json 附件返回"""
Loading