From b637b105b226bef2609ab50b9e0fcc9feb3059b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 06:15:29 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 4 ++-- src/asktable/resources/chats/chats.py | 4 ++-- src/asktable/types/chat.py | 2 +- src/asktable/types/chat_create_params.py | 2 +- src/asktable/types/chat_retrieve_response.py | 2 +- tests/api_resources/test_chats.py | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index dc3397fe..97d7b1be 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 96 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-b9ad19bf46b9a414b4ff6438ad9ffa5c53c7fada3e16c499d80781588de65487.yml -openapi_spec_hash: 62e3136712b5e1451cc1aabd1b3aa7fa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-512767dff0175da9132c01730e3f35cac9f21977a1247ea5c9dd8f42748f3acc.yml +openapi_spec_hash: b9bcb2feb162291377970459d2c0dfe7 config_hash: 575ddfb316392e5f7f3c7b7999796a03 diff --git a/src/asktable/resources/chats/chats.py b/src/asktable/resources/chats/chats.py index 661ca731..123f7d69 100644 --- a/src/asktable/resources/chats/chats.py +++ b/src/asktable/resources/chats/chats.py @@ -67,7 +67,7 @@ def create( name: Optional[str] | NotGiven = NOT_GIVEN, role_id: Optional[str] | NotGiven = NOT_GIVEN, role_variables: Optional[Dict[str, Union[str, int, bool]]] | NotGiven = NOT_GIVEN, - user_profile: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + user_profile: Optional[Dict[str, Union[str, int, 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, @@ -263,7 +263,7 @@ async def create( name: Optional[str] | NotGiven = NOT_GIVEN, role_id: Optional[str] | NotGiven = NOT_GIVEN, role_variables: Optional[Dict[str, Union[str, int, bool]]] | NotGiven = NOT_GIVEN, - user_profile: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + user_profile: Optional[Dict[str, Union[str, int, 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, diff --git a/src/asktable/types/chat.py b/src/asktable/types/chat.py index 5d26c3e8..ff282d79 100644 --- a/src/asktable/types/chat.py +++ b/src/asktable/types/chat.py @@ -43,5 +43,5 @@ class Chat(BaseModel): role_variables: Optional[Dict[str, Union[str, int, bool]]] = None """在扮演这个角色时需要传递的变量值,用 Key-Value 形式传递""" - user_profile: Optional[Dict[str, str]] = None + user_profile: Optional[Dict[str, Union[str, int, bool]]] = None """用户信息,用于在对话中传递用户的信息,用 Key-Value 形式传递""" diff --git a/src/asktable/types/chat_create_params.py b/src/asktable/types/chat_create_params.py index 74302e71..ca697335 100644 --- a/src/asktable/types/chat_create_params.py +++ b/src/asktable/types/chat_create_params.py @@ -27,5 +27,5 @@ class ChatCreateParams(TypedDict, total=False): role_variables: Optional[Dict[str, Union[str, int, bool]]] """在扮演这个角色时需要传递的变量值,用 Key-Value 形式传递""" - user_profile: Optional[Dict[str, str]] + user_profile: Optional[Dict[str, Union[str, int, bool]]] """用户信息,用于在对话中传递用户的信息,用 Key-Value 形式传递""" diff --git a/src/asktable/types/chat_retrieve_response.py b/src/asktable/types/chat_retrieve_response.py index 3ade0700..3868c1a8 100644 --- a/src/asktable/types/chat_retrieve_response.py +++ b/src/asktable/types/chat_retrieve_response.py @@ -47,7 +47,7 @@ class ChatRetrieveResponse(BaseModel): sample_questions: Optional[List[str]] = None - user_profile: Optional[Dict[str, str]] = None + user_profile: Optional[Dict[str, Union[str, int, bool]]] = None """用户信息,用于在对话中传递用户的信息,用 Key-Value 形式传递""" welcome_message: Optional[str] = None diff --git a/tests/api_resources/test_chats.py b/tests/api_resources/test_chats.py index 5a84e9da..254fc7c6 100644 --- a/tests/api_resources/test_chats.py +++ b/tests/api_resources/test_chats.py @@ -31,8 +31,8 @@ def test_method_create_with_all_params(self, client: Asktable) -> None: role_id="role_42", role_variables={"id": "123123123"}, user_profile={ - "age": "string", - "is_male": "string", + "age": 18, + "is_male": True, "name": "张三", }, ) @@ -184,8 +184,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable) role_id="role_42", role_variables={"id": "123123123"}, user_profile={ - "age": "string", - "is_male": "string", + "age": 18, + "is_male": True, "name": "张三", }, )