Skip to content

Commit 8e6696d

Browse files
authored
Merge pull request #123 from DataMini/release-please--branches--main--changes--next
release: 4.2.0
2 parents 7906ec1 + 9102d33 commit 8e6696d

24 files changed

+316
-401
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "4.1.0"
2+
".": "4.2.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 92
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-8db0b80dcaf777d02fd5720543576e1484e9dc93db7c1b50a11ee85c215f88b4.yml
1+
configured_endpoints: 91
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-b2fe5c35562a5dafc33b2b5441a9e199668a03c7497b6d6350a2d25332dfecb0.yml

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 4.2.0 (2025-01-10)
4+
5+
Full Changelog: [v4.1.0...v4.2.0](https://github.com/DataMini/asktable-python/compare/v4.1.0...v4.2.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#125](https://github.com/DataMini/asktable-python/issues/125)) ([af326ae](https://github.com/DataMini/asktable-python/commit/af326aec48e92faebe3cec2f5fbe20d9437c403e))
10+
* **api:** create message ([#122](https://github.com/DataMini/asktable-python/issues/122)) ([e5051af](https://github.com/DataMini/asktable-python/commit/e5051afcfbd84ea53af26b50d617dfa7cab8b22a))
11+
12+
13+
### Chores
14+
15+
* **internal:** codegen related update ([#124](https://github.com/DataMini/asktable-python/issues/124)) ([73e95d0](https://github.com/DataMini/asktable-python/commit/73e95d0fec85b50ed9396038c87084cdba7d19ca))
16+
317
## 4.1.0 (2025-01-09)
418

519
Full Changelog: [v4.0.0...v4.1.0](https://github.com/DataMini/asktable-python/compare/v4.0.0...v4.1.0)

api.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,7 @@ Methods:
103103
Types:
104104

105105
```python
106-
from asktable.types import (
107-
AIMessage,
108-
Chat,
109-
ToolMessage,
110-
UserMessage,
111-
ChatRetrieveResponse,
112-
ChatSendMessageResponse,
113-
)
106+
from asktable.types import AIMessage, Chat, ToolMessage, UserMessage, ChatRetrieveResponse
114107
```
115108

116109
Methods:
@@ -119,25 +112,20 @@ Methods:
119112
- <code title="get /chats/{chat_id}">client.chats.<a href="./src/asktable/resources/chats/chats.py">retrieve</a>(chat_id) -> <a href="./src/asktable/types/chat_retrieve_response.py">ChatRetrieveResponse</a></code>
120113
- <code title="get /chats">client.chats.<a href="./src/asktable/resources/chats/chats.py">list</a>(\*\*<a href="src/asktable/types/chat_list_params.py">params</a>) -> <a href="./src/asktable/types/chat.py">SyncPage[Chat]</a></code>
121114
- <code title="delete /chats/{chat_id}">client.chats.<a href="./src/asktable/resources/chats/chats.py">delete</a>(chat_id) -> None</code>
122-
- <code title="post /chats/{chat_id}">client.chats.<a href="./src/asktable/resources/chats/chats.py">send_message</a>(chat_id, \*\*<a href="src/asktable/types/chat_send_message_params.py">params</a>) -> <a href="./src/asktable/types/chat_send_message_response.py">ChatSendMessageResponse</a></code>
123115

124116
## Messages
125117

126118
Types:
127119

128120
```python
129-
from asktable.types.chats import (
130-
MessageRetrieveResponse,
131-
MessageListResponse,
132-
MessageSendMessageResponse,
133-
)
121+
from asktable.types.chats import MessageCreateResponse, MessageRetrieveResponse, MessageListResponse
134122
```
135123

136124
Methods:
137125

126+
- <code title="post /chats/{chat_id}/messages">client.chats.messages.<a href="./src/asktable/resources/chats/messages.py">create</a>(chat_id, \*\*<a href="src/asktable/types/chats/message_create_params.py">params</a>) -> <a href="./src/asktable/types/chats/message_create_response.py">MessageCreateResponse</a></code>
138127
- <code title="get /chats/{chat_id}/messages/{message_id}">client.chats.messages.<a href="./src/asktable/resources/chats/messages.py">retrieve</a>(message_id, \*, chat_id) -> <a href="./src/asktable/types/chats/message_retrieve_response.py">MessageRetrieveResponse</a></code>
139128
- <code title="get /chats/{chat_id}/messages">client.chats.messages.<a href="./src/asktable/resources/chats/messages.py">list</a>(chat_id, \*\*<a href="src/asktable/types/chats/message_list_params.py">params</a>) -> <a href="./src/asktable/types/chats/message_list_response.py">SyncPage[MessageListResponse]</a></code>
140-
- <code title="post /chats/{chat_id}/messages">client.chats.messages.<a href="./src/asktable/resources/chats/messages.py">send_message</a>(chat_id, \*\*<a href="src/asktable/types/chats/message_send_message_params.py">params</a>) -> <a href="./src/asktable/types/chats/message_send_message_response.py">MessageSendMessageResponse</a></code>
141129

142130
# Datasources
143131

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "asktable"
3-
version = "4.1.0"
3+
version = "4.2.0"
44
description = "The official Python library for the asktable API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/asktable/_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ def __str__(self) -> str:
179179
@classmethod
180180
@override
181181
def construct( # pyright: ignore[reportIncompatibleMethodOverride]
182-
cls: Type[ModelT],
182+
__cls: Type[ModelT],
183183
_fields_set: set[str] | None = None,
184184
**values: object,
185185
) -> ModelT:
186-
m = cls.__new__(cls)
186+
m = __cls.__new__(__cls)
187187
fields_values: dict[str, object] = {}
188188

189-
config = get_model_config(cls)
189+
config = get_model_config(__cls)
190190
populate_by_name = (
191191
config.allow_population_by_field_name
192192
if isinstance(config, _ConfigProtocol)
@@ -196,7 +196,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride]
196196
if _fields_set is None:
197197
_fields_set = set()
198198

199-
model_fields = get_model_fields(cls)
199+
model_fields = get_model_fields(__cls)
200200
for name, field in model_fields.items():
201201
key = field.alias
202202
if key is None or (key not in values and populate_by_name):

src/asktable/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "asktable"
4-
__version__ = "4.1.0" # x-release-please-version
4+
__version__ = "4.2.0" # x-release-please-version

src/asktable/resources/chats/chats.py

Lines changed: 2 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import Any, Dict, Union, Optional, cast
5+
from typing import Dict, Union, Optional
66

77
import httpx
88

9-
from ...types import chat_list_params, chat_create_params, chat_send_message_params
9+
from ...types import chat_list_params, chat_create_params
1010
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
1111
from ..._utils import (
1212
maybe_transform,
@@ -32,7 +32,6 @@
3232
from ...types.chat import Chat
3333
from ..._base_client import AsyncPaginator, make_request_options
3434
from ...types.chat_retrieve_response import ChatRetrieveResponse
35-
from ...types.chat_send_message_response import ChatSendMessageResponse
3635

3736
__all__ = ["ChatsResource", "AsyncChatsResource"]
3837

@@ -232,49 +231,6 @@ def delete(
232231
cast_to=NoneType,
233232
)
234233

235-
def send_message(
236-
self,
237-
chat_id: str,
238-
*,
239-
question: str,
240-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
241-
# The extra values given here take precedence over values defined on the client or passed to this method.
242-
extra_headers: Headers | None = None,
243-
extra_query: Query | None = None,
244-
extra_body: Body | None = None,
245-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
246-
) -> ChatSendMessageResponse:
247-
"""
248-
发消息
249-
250-
Args:
251-
extra_headers: Send extra headers
252-
253-
extra_query: Add additional query parameters to the request
254-
255-
extra_body: Add additional JSON properties to the request
256-
257-
timeout: Override the client-level default timeout for this request, in seconds
258-
"""
259-
if not chat_id:
260-
raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
261-
return cast(
262-
ChatSendMessageResponse,
263-
self._post(
264-
f"/chats/{chat_id}",
265-
options=make_request_options(
266-
extra_headers=extra_headers,
267-
extra_query=extra_query,
268-
extra_body=extra_body,
269-
timeout=timeout,
270-
query=maybe_transform({"question": question}, chat_send_message_params.ChatSendMessageParams),
271-
),
272-
cast_to=cast(
273-
Any, ChatSendMessageResponse
274-
), # Union types cannot be passed in as arguments in the type system
275-
),
276-
)
277-
278234

279235
class AsyncChatsResource(AsyncAPIResource):
280236
@cached_property
@@ -471,51 +427,6 @@ async def delete(
471427
cast_to=NoneType,
472428
)
473429

474-
async def send_message(
475-
self,
476-
chat_id: str,
477-
*,
478-
question: str,
479-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
480-
# The extra values given here take precedence over values defined on the client or passed to this method.
481-
extra_headers: Headers | None = None,
482-
extra_query: Query | None = None,
483-
extra_body: Body | None = None,
484-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
485-
) -> ChatSendMessageResponse:
486-
"""
487-
发消息
488-
489-
Args:
490-
extra_headers: Send extra headers
491-
492-
extra_query: Add additional query parameters to the request
493-
494-
extra_body: Add additional JSON properties to the request
495-
496-
timeout: Override the client-level default timeout for this request, in seconds
497-
"""
498-
if not chat_id:
499-
raise ValueError(f"Expected a non-empty value for `chat_id` but received {chat_id!r}")
500-
return cast(
501-
ChatSendMessageResponse,
502-
await self._post(
503-
f"/chats/{chat_id}",
504-
options=make_request_options(
505-
extra_headers=extra_headers,
506-
extra_query=extra_query,
507-
extra_body=extra_body,
508-
timeout=timeout,
509-
query=await async_maybe_transform(
510-
{"question": question}, chat_send_message_params.ChatSendMessageParams
511-
),
512-
),
513-
cast_to=cast(
514-
Any, ChatSendMessageResponse
515-
), # Union types cannot be passed in as arguments in the type system
516-
),
517-
)
518-
519430

520431
class ChatsResourceWithRawResponse:
521432
def __init__(self, chats: ChatsResource) -> None:
@@ -533,9 +444,6 @@ def __init__(self, chats: ChatsResource) -> None:
533444
self.delete = to_raw_response_wrapper(
534445
chats.delete,
535446
)
536-
self.send_message = to_raw_response_wrapper(
537-
chats.send_message,
538-
)
539447

540448
@cached_property
541449
def messages(self) -> MessagesResourceWithRawResponse:
@@ -558,9 +466,6 @@ def __init__(self, chats: AsyncChatsResource) -> None:
558466
self.delete = async_to_raw_response_wrapper(
559467
chats.delete,
560468
)
561-
self.send_message = async_to_raw_response_wrapper(
562-
chats.send_message,
563-
)
564469

565470
@cached_property
566471
def messages(self) -> AsyncMessagesResourceWithRawResponse:
@@ -583,9 +488,6 @@ def __init__(self, chats: ChatsResource) -> None:
583488
self.delete = to_streamed_response_wrapper(
584489
chats.delete,
585490
)
586-
self.send_message = to_streamed_response_wrapper(
587-
chats.send_message,
588-
)
589491

590492
@cached_property
591493
def messages(self) -> MessagesResourceWithStreamingResponse:
@@ -608,9 +510,6 @@ def __init__(self, chats: AsyncChatsResource) -> None:
608510
self.delete = async_to_streamed_response_wrapper(
609511
chats.delete,
610512
)
611-
self.send_message = async_to_streamed_response_wrapper(
612-
chats.send_message,
613-
)
614513

615514
@cached_property
616515
def messages(self) -> AsyncMessagesResourceWithStreamingResponse:

0 commit comments

Comments
 (0)