Skip to content

Commit 18a5eaf

Browse files
feat(api): api update
1 parent 8f09ac8 commit 18a5eaf

File tree

10 files changed

+29
-2
lines changed

10 files changed

+29
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 96
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-e016b9102a8314050cfff60bd371d2ff4b2a737122c261279e1a03f0a88ebe5c.yml
3-
openapi_spec_hash: 6d997fcedcb4db1962c2d688cc92341c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-c69602c033b50a9e3b770858aaa45bd0cc6578dfbd8bf0130d11e15a18edb3b4.yml
3+
openapi_spec_hash: 82eb79d2638703a11db4890a0014f75b
44
config_hash: a572ab842ea60ce13f1d1a1358440cbe

src/asktable/resources/datasources/datasources.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def create(
113113
"selectdb",
114114
"databend",
115115
"sqlserver",
116+
"mogdb",
116117
],
117118
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
118119
name: Optional[str] | NotGiven = NOT_GIVEN,
@@ -218,6 +219,7 @@ def update(
218219
"selectdb",
219220
"databend",
220221
"sqlserver",
222+
"mogdb",
221223
]
222224
]
223225
| NotGiven = NOT_GIVEN,
@@ -605,6 +607,7 @@ async def create(
605607
"selectdb",
606608
"databend",
607609
"sqlserver",
610+
"mogdb",
608611
],
609612
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
610613
name: Optional[str] | NotGiven = NOT_GIVEN,
@@ -710,6 +713,7 @@ async def update(
710713
"selectdb",
711714
"databend",
712715
"sqlserver",
716+
"mogdb",
713717
]
714718
]
715719
| NotGiven = NOT_GIVEN,

src/asktable/resources/sqls.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def create(
5151
question: str,
5252
role_id: Optional[str] | NotGiven = NOT_GIVEN,
5353
role_variables: Optional[object] | NotGiven = NOT_GIVEN,
54+
separate_params: bool | NotGiven = NOT_GIVEN,
5455
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5556
# The extra values given here take precedence over values defined on the client or passed to this method.
5657
extra_headers: Headers | None = None,
@@ -71,6 +72,8 @@ def create(
7172
7273
role_variables: 在扮演这个角色时需要传递的变量值,用 Key-Value 形式传递
7374
75+
separate_params: 是否将参数分开传递
76+
7477
extra_headers: Send extra headers
7578
7679
extra_query: Add additional query parameters to the request
@@ -87,6 +90,7 @@ def create(
8790
"question": question,
8891
"role_id": role_id,
8992
"role_variables": role_variables,
93+
"separate_params": separate_params,
9094
},
9195
sql_create_params.SqlCreateParams,
9296
),
@@ -175,6 +179,7 @@ async def create(
175179
question: str,
176180
role_id: Optional[str] | NotGiven = NOT_GIVEN,
177181
role_variables: Optional[object] | NotGiven = NOT_GIVEN,
182+
separate_params: bool | NotGiven = NOT_GIVEN,
178183
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
179184
# The extra values given here take precedence over values defined on the client or passed to this method.
180185
extra_headers: Headers | None = None,
@@ -195,6 +200,8 @@ async def create(
195200
196201
role_variables: 在扮演这个角色时需要传递的变量值,用 Key-Value 形式传递
197202
203+
separate_params: 是否将参数分开传递
204+
198205
extra_headers: Send extra headers
199206
200207
extra_query: Add additional query parameters to the request
@@ -211,6 +218,7 @@ async def create(
211218
"question": question,
212219
"role_id": role_id,
213220
"role_variables": role_variables,
221+
"separate_params": separate_params,
214222
},
215223
sql_create_params.SqlCreateParams,
216224
),

src/asktable/types/datasource.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Datasource(BaseModel):
3737
"selectdb",
3838
"databend",
3939
"sqlserver",
40+
"mogdb",
4041
]
4142
"""数据源引擎"""
4243

src/asktable/types/datasource_create_params.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class DatasourceCreateParams(TypedDict, total=False):
3636
"selectdb",
3737
"databend",
3838
"sqlserver",
39+
"mogdb",
3940
]
4041
]
4142
"""数据源引擎"""

src/asktable/types/datasource_retrieve_response.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class DatasourceRetrieveResponse(BaseModel):
9292
"selectdb",
9393
"databend",
9494
"sqlserver",
95+
"mogdb",
9596
]
9697
"""数据源引擎"""
9798

src/asktable/types/datasource_update_params.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class DatasourceUpdateParams(TypedDict, total=False):
4343
"selectdb",
4444
"databend",
4545
"sqlserver",
46+
"mogdb",
4647
]
4748
]
4849
"""数据源引擎"""

src/asktable/types/query_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class Query(BaseModel):
1212
sql: str
1313
"""SQL 语句"""
1414

15+
params: Optional[object] = None
16+
"""参数"""
17+
1518

1619
class Request(BaseModel):
1720
datasource_id: str
@@ -29,6 +32,9 @@ class Request(BaseModel):
2932
role_variables: Optional[object] = None
3033
"""在扮演这个角色时需要传递的变量值,用 Key-Value 形式传递"""
3134

35+
separate_params: Optional[bool] = None
36+
"""是否将参数分开传递"""
37+
3238

3339
class QueryResponse(BaseModel):
3440
id: str

src/asktable/types/sql_create_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ class SqlCreateParams(TypedDict, total=False):
2323

2424
role_variables: Optional[object]
2525
"""在扮演这个角色时需要传递的变量值,用 Key-Value 形式传递"""
26+
27+
separate_params: bool
28+
"""是否将参数分开传递"""

tests/api_resources/test_sqls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
3333
question="question",
3434
role_id="role_id",
3535
role_variables={},
36+
separate_params=True,
3637
)
3738
assert_matches_type(QueryResponse, sql, path=["response"])
3839

@@ -115,6 +116,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
115116
question="question",
116117
role_id="role_id",
117118
role_variables={},
119+
separate_params=True,
118120
)
119121
assert_matches_type(QueryResponse, sql, path=["response"])
120122

0 commit comments

Comments
 (0)