Skip to content

Commit ebd0446

Browse files
feat(api): api update (#188)
1 parent 645b80a commit ebd0446

File tree

7 files changed

+32
-1
lines changed

7 files changed

+32
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 96
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-10d44714ee3dc6026ddd16d5f97af6c5f5807d40d0333deb20cb458d2b79047a.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-a4c91d7713c87ff56f393709ecda79c31ce7ceee1507b9421fb92da28489a073.yml

src/asktable/resources/bots.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def create(
5959
max_rows: int | NotGiven = NOT_GIVEN,
6060
publish: bool | NotGiven = NOT_GIVEN,
6161
sample_questions: Optional[List[str]] | NotGiven = NOT_GIVEN,
62+
webhooks: List[str] | NotGiven = NOT_GIVEN,
6263
welcome_message: Optional[str] | NotGiven = NOT_GIVEN,
6364
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6465
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -89,6 +90,8 @@ def create(
8990
9091
sample_questions: 示例问题列表
9192
93+
webhooks: Webhook URL 列表
94+
9295
welcome_message: 欢迎消息
9396
9497
extra_headers: Send extra headers
@@ -112,6 +115,7 @@ def create(
112115
"max_rows": max_rows,
113116
"publish": publish,
114117
"sample_questions": sample_questions,
118+
"webhooks": webhooks,
115119
"welcome_message": welcome_message,
116120
},
117121
bot_create_params.BotCreateParams,
@@ -169,6 +173,7 @@ def update(
169173
name: Optional[str] | NotGiven = NOT_GIVEN,
170174
publish: Optional[bool] | NotGiven = NOT_GIVEN,
171175
sample_questions: Optional[List[str]] | NotGiven = NOT_GIVEN,
176+
webhooks: Optional[List[str]] | NotGiven = NOT_GIVEN,
172177
welcome_message: Optional[str] | NotGiven = NOT_GIVEN,
173178
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
174179
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -201,6 +206,8 @@ def update(
201206
202207
sample_questions: 示例问题列表
203208
209+
webhooks: Webhook URL 列表
210+
204211
welcome_message: 欢迎消息
205212
206213
extra_headers: Send extra headers
@@ -227,6 +234,7 @@ def update(
227234
"name": name,
228235
"publish": publish,
229236
"sample_questions": sample_questions,
237+
"webhooks": webhooks,
230238
"welcome_message": welcome_message,
231239
},
232240
bot_update_params.BotUpdateParams,
@@ -392,6 +400,7 @@ async def create(
392400
max_rows: int | NotGiven = NOT_GIVEN,
393401
publish: bool | NotGiven = NOT_GIVEN,
394402
sample_questions: Optional[List[str]] | NotGiven = NOT_GIVEN,
403+
webhooks: List[str] | NotGiven = NOT_GIVEN,
395404
welcome_message: Optional[str] | NotGiven = NOT_GIVEN,
396405
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
397406
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -422,6 +431,8 @@ async def create(
422431
423432
sample_questions: 示例问题列表
424433
434+
webhooks: Webhook URL 列表
435+
425436
welcome_message: 欢迎消息
426437
427438
extra_headers: Send extra headers
@@ -445,6 +456,7 @@ async def create(
445456
"max_rows": max_rows,
446457
"publish": publish,
447458
"sample_questions": sample_questions,
459+
"webhooks": webhooks,
448460
"welcome_message": welcome_message,
449461
},
450462
bot_create_params.BotCreateParams,
@@ -502,6 +514,7 @@ async def update(
502514
name: Optional[str] | NotGiven = NOT_GIVEN,
503515
publish: Optional[bool] | NotGiven = NOT_GIVEN,
504516
sample_questions: Optional[List[str]] | NotGiven = NOT_GIVEN,
517+
webhooks: Optional[List[str]] | NotGiven = NOT_GIVEN,
505518
welcome_message: Optional[str] | NotGiven = NOT_GIVEN,
506519
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
507520
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -534,6 +547,8 @@ async def update(
534547
535548
sample_questions: 示例问题列表
536549
550+
webhooks: Webhook URL 列表
551+
537552
welcome_message: 欢迎消息
538553
539554
extra_headers: Send extra headers
@@ -560,6 +575,7 @@ async def update(
560575
"name": name,
561576
"publish": publish,
562577
"sample_questions": sample_questions,
578+
"webhooks": webhooks,
563579
"welcome_message": welcome_message,
564580
},
565581
bot_update_params.BotUpdateParams,

src/asktable/types/bot_create_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@ class BotCreateParams(TypedDict, total=False):
3636
sample_questions: Optional[List[str]]
3737
"""示例问题列表"""
3838

39+
webhooks: List[str]
40+
"""Webhook URL 列表"""
41+
3942
welcome_message: Optional[str]
4043
"""欢迎消息"""

src/asktable/types/bot_update_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ class BotUpdateParams(TypedDict, total=False):
3939
sample_questions: Optional[List[str]]
4040
"""示例问题列表"""
4141

42+
webhooks: Optional[List[str]]
43+
"""Webhook URL 列表"""
44+
4245
welcome_message: Optional[str]
4346
"""欢迎消息"""

src/asktable/types/chat_retrieve_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class ChatRetrieveResponse(BaseModel):
4545
role_variables: Optional[Dict[str, Union[str, int, bool]]] = None
4646
"""在扮演这个角色时需要传递的变量值,用 Key-Value 形式传递"""
4747

48+
sample_questions: Optional[List[str]] = None
49+
4850
user_profile: Optional[Dict[str, str]] = None
4951
"""用户信息,用于在对话中传递用户的信息,用 Key-Value 形式传递"""
5052

src/asktable/types/chatbot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,8 @@ class Chatbot(BaseModel):
4747
sample_questions: Optional[List[str]] = None
4848
"""示例问题列表"""
4949

50+
webhooks: Optional[List[str]] = None
51+
"""Webhook URL 列表"""
52+
5053
welcome_message: Optional[str] = None
5154
"""欢迎消息"""

tests/api_resources/test_bots.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
3838
max_rows=50,
3939
publish=True,
4040
sample_questions=["你好!今天中午有什么适合我的午餐?"],
41+
webhooks=["string"],
4142
welcome_message="欢迎使用AskTable",
4243
)
4344
assert_matches_type(Chatbot, bot, path=["response"])
@@ -127,6 +128,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
127128
name="name",
128129
publish=True,
129130
sample_questions=["你好!今天中午有什么适合我的午餐?"],
131+
webhooks=["string"],
130132
welcome_message="欢迎使用AskTable",
131133
)
132134
assert_matches_type(Chatbot, bot, path=["response"])
@@ -300,6 +302,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
300302
max_rows=50,
301303
publish=True,
302304
sample_questions=["你好!今天中午有什么适合我的午餐?"],
305+
webhooks=["string"],
303306
welcome_message="欢迎使用AskTable",
304307
)
305308
assert_matches_type(Chatbot, bot, path=["response"])
@@ -389,6 +392,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
389392
name="name",
390393
publish=True,
391394
sample_questions=["你好!今天中午有什么适合我的午餐?"],
395+
webhooks=["string"],
392396
welcome_message="欢迎使用AskTable",
393397
)
394398
assert_matches_type(Chatbot, bot, path=["response"])

0 commit comments

Comments
 (0)