diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ff1c7af5..2437b419 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.3.0" + ".": "3.4.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index e3f9c0f6..e8c62aed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 62e70dd4..4898c759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pyproject.toml b/pyproject.toml index dc93b544..93364c21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/asktable/_version.py b/src/asktable/_version.py index 7d946cc1..6b97d994 100644 --- a/src/asktable/_version.py +++ b/src/asktable/_version.py @@ -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 diff --git a/src/asktable/resources/datasources/datasources.py b/src/asktable/resources/datasources/datasources.py index 976019e6..360dcdca 100644 --- a/src/asktable/resources/datasources/datasources.py +++ b/src/asktable/resources/datasources/datasources.py @@ -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. @@ -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, @@ -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, @@ -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, ), @@ -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. @@ -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, @@ -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, @@ -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, ), diff --git a/src/asktable/resources/datasources/meta.py b/src/asktable/resources/datasources/meta.py index 559131d8..bc7f1e66 100644 --- a/src/asktable/resources/datasources/meta.py +++ b/src/asktable/resources/datasources/meta.py @@ -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. @@ -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, @@ -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. @@ -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, ) @@ -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. @@ -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, @@ -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. @@ -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, ) diff --git a/src/asktable/resources/integration.py b/src/asktable/resources/integration.py index 0e332418..85a2167f 100644 --- a/src/asktable/resources/integration.py +++ b/src/asktable/resources/integration.py @@ -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, @@ -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, @@ -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. @@ -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, ) @@ -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, @@ -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, @@ -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. @@ -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, ) diff --git a/src/asktable/resources/sys/projects/projects.py b/src/asktable/resources/sys/projects/projects.py index 6275b274..9ce9ecba 100644 --- a/src/asktable/resources/sys/projects/projects.py +++ b/src/asktable/resources/sys/projects/projects.py @@ -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. @@ -143,6 +144,8 @@ def update( Update Project Args: + llm_model_group: 模型组 + locked: 是否锁定 name: 项目名称 @@ -161,6 +164,7 @@ def update( f"/sys/projects/{project_id}", body=maybe_transform( { + "llm_model_group": llm_model_group, "locked": locked, "name": name, }, @@ -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. @@ -365,6 +370,8 @@ async def update( Update Project Args: + llm_model_group: 模型组 + locked: 是否锁定 name: 项目名称 @@ -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, }, diff --git a/src/asktable/types/datasource_create_from_file_params.py b/src/asktable/types/datasource_create_from_file_params.py index 98aff51a..4ddeba6c 100644 --- a/src/asktable/types/datasource_create_from_file_params.py +++ b/src/asktable/types/datasource_create_from_file_params.py @@ -15,3 +15,5 @@ class DatasourceCreateFromFileParams(TypedDict, total=False): async_process_meta: bool name: str + + value_index: bool diff --git a/src/asktable/types/datasource_create_params.py b/src/asktable/types/datasource_create_params.py index 5f495b55..cf563292 100644 --- a/src/asktable/types/datasource_create_params.py +++ b/src/asktable/types/datasource_create_params.py @@ -14,6 +14,8 @@ class DatasourceCreateParams(TypedDict, total=False): async_process_meta: bool + value_index: bool + access_config: Optional[AccessConfig] """不同引擎有不同的配置""" diff --git a/src/asktable/types/datasources/meta_create_params.py b/src/asktable/types/datasources/meta_create_params.py index a8102bf6..a27d3efa 100644 --- a/src/asktable/types/datasources/meta_create_params.py +++ b/src/asktable/types/datasources/meta_create_params.py @@ -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] @@ -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] diff --git a/src/asktable/types/integration_create_excel_ds_params.py b/src/asktable/types/integration_create_excel_ds_params.py index 44032d27..05e3e2fa 100644 --- a/src/asktable/types/integration_create_excel_ds_params.py +++ b/src/asktable/types/integration_create_excel_ds_params.py @@ -9,3 +9,5 @@ class IntegrationCreateExcelDsParams(TypedDict, total=False): file_url: Required[str] + + value_index: bool diff --git a/src/asktable/types/integration_excel_csv_ask_params.py b/src/asktable/types/integration_excel_csv_ask_params.py index 4d6f6051..0dd97f5b 100644 --- a/src/asktable/types/integration_excel_csv_ask_params.py +++ b/src/asktable/types/integration_excel_csv_ask_params.py @@ -15,5 +15,7 @@ class IntegrationExcelCsvAskParams(TypedDict, total=False): question: Required[str] """用户问题""" + value_index: bool + with_json: Optional[bool] """是否将数据作为 json 附件返回""" diff --git a/src/asktable/types/sys/project.py b/src/asktable/types/sys/project.py index 050079e2..c1e4abe4 100644 --- a/src/asktable/types/sys/project.py +++ b/src/asktable/types/sys/project.py @@ -14,6 +14,9 @@ class Project(BaseModel): created_at: datetime """创建时间""" + llm_model_group: str + """模型组""" + locked: int """是否锁定""" diff --git a/src/asktable/types/sys/project_update_params.py b/src/asktable/types/sys/project_update_params.py index 2571868f..312fe6f8 100644 --- a/src/asktable/types/sys/project_update_params.py +++ b/src/asktable/types/sys/project_update_params.py @@ -9,6 +9,9 @@ class ProjectUpdateParams(TypedDict, total=False): + llm_model_group: Optional[str] + """模型组""" + locked: Optional[bool] """是否锁定""" diff --git a/tests/api_resources/datasources/test_meta.py b/tests/api_resources/datasources/test_meta.py index 9c58e10f..66dc6221 100644 --- a/tests/api_resources/datasources/test_meta.py +++ b/tests/api_resources/datasources/test_meta.py @@ -30,6 +30,8 @@ def test_method_create_with_all_params_overload_1(self, client: Asktable) -> Non meta = client.datasources.meta.create( datasource_id="datasource_id", name="name", + async_process_meta=True, + value_index=True, schemas={ "foo": { "name": "name", @@ -96,6 +98,16 @@ def test_method_create_overload_2(self, client: Asktable) -> None: ) assert_matches_type(object, meta, path=["response"]) + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Asktable) -> None: + meta = client.datasources.meta.create( + datasource_id="datasource_id", + body=None, + async_process_meta=True, + value_index=True, + ) + assert_matches_type(object, meta, path=["response"]) + @parametrize def test_raw_response_create_overload_2(self, client: Asktable) -> None: response = client.datasources.meta.with_raw_response.create( @@ -340,6 +352,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn meta = await async_client.datasources.meta.create( datasource_id="datasource_id", name="name", + async_process_meta=True, + value_index=True, schemas={ "foo": { "name": "name", @@ -406,6 +420,16 @@ async def test_method_create_overload_2(self, async_client: AsyncAsktable) -> No ) assert_matches_type(object, meta, path=["response"]) + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncAsktable) -> None: + meta = await async_client.datasources.meta.create( + datasource_id="datasource_id", + body=None, + async_process_meta=True, + value_index=True, + ) + assert_matches_type(object, meta, path=["response"]) + @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncAsktable) -> None: response = await async_client.datasources.meta.with_raw_response.create( diff --git a/tests/api_resources/sys/test_projects.py b/tests/api_resources/sys/test_projects.py index 1808cc05..8b88bd14 100644 --- a/tests/api_resources/sys/test_projects.py +++ b/tests/api_resources/sys/test_projects.py @@ -98,6 +98,7 @@ def test_method_update(self, client: Asktable) -> None: def test_method_update_with_all_params(self, client: Asktable) -> None: project = client.sys.projects.update( project_id="project_id", + llm_model_group="llm_model_group", locked=True, name="name", ) @@ -290,6 +291,7 @@ async def test_method_update(self, async_client: AsyncAsktable) -> None: async def test_method_update_with_all_params(self, async_client: AsyncAsktable) -> None: project = await async_client.sys.projects.update( project_id="project_id", + llm_model_group="llm_model_group", locked=True, name="name", ) diff --git a/tests/api_resources/test_datasources.py b/tests/api_resources/test_datasources.py index 0cde3d96..02b182cc 100644 --- a/tests/api_resources/test_datasources.py +++ b/tests/api_resources/test_datasources.py @@ -32,6 +32,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None: datasource = client.datasources.create( engine="mysql", async_process_meta=True, + value_index=True, access_config={ "atst_link_id": "atst_link_123456", "db": "test", @@ -262,6 +263,7 @@ def test_method_create_from_file_with_all_params(self, client: Asktable) -> None file=b"raw file contents", async_process_meta=True, name="name", + value_index=True, ) assert_matches_type(Datasource, datasource, path=["response"]) @@ -305,6 +307,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable) datasource = await async_client.datasources.create( engine="mysql", async_process_meta=True, + value_index=True, access_config={ "atst_link_id": "atst_link_123456", "db": "test", @@ -535,6 +538,7 @@ async def test_method_create_from_file_with_all_params(self, async_client: Async file=b"raw file contents", async_process_meta=True, name="name", + value_index=True, ) assert_matches_type(Datasource, datasource, path=["response"]) diff --git a/tests/api_resources/test_integration.py b/tests/api_resources/test_integration.py index 335bb917..6cdf0f0a 100644 --- a/tests/api_resources/test_integration.py +++ b/tests/api_resources/test_integration.py @@ -27,6 +27,14 @@ def test_method_create_excel_ds(self, client: Asktable) -> None: ) assert_matches_type(Datasource, integration, path=["response"]) + @parametrize + def test_method_create_excel_ds_with_all_params(self, client: Asktable) -> None: + integration = client.integration.create_excel_ds( + file_url="https://example.com", + value_index=True, + ) + assert_matches_type(Datasource, integration, path=["response"]) + @parametrize def test_raw_response_create_excel_ds(self, client: Asktable) -> None: response = client.integration.with_raw_response.create_excel_ds( @@ -64,6 +72,7 @@ def test_method_excel_csv_ask_with_all_params(self, client: Asktable) -> None: integration = client.integration.excel_csv_ask( file_url="https://example.com", question="question", + value_index=True, with_json=True, ) assert_matches_type(FileAskResponse, integration, path=["response"]) @@ -105,6 +114,14 @@ async def test_method_create_excel_ds(self, async_client: AsyncAsktable) -> None ) assert_matches_type(Datasource, integration, path=["response"]) + @parametrize + async def test_method_create_excel_ds_with_all_params(self, async_client: AsyncAsktable) -> None: + integration = await async_client.integration.create_excel_ds( + file_url="https://example.com", + value_index=True, + ) + assert_matches_type(Datasource, integration, path=["response"]) + @parametrize async def test_raw_response_create_excel_ds(self, async_client: AsyncAsktable) -> None: response = await async_client.integration.with_raw_response.create_excel_ds( @@ -142,6 +159,7 @@ async def test_method_excel_csv_ask_with_all_params(self, async_client: AsyncAsk integration = await async_client.integration.excel_csv_ask( file_url="https://example.com", question="question", + value_index=True, with_json=True, ) assert_matches_type(FileAskResponse, integration, path=["response"])