Skip to content

Commit 37b724e

Browse files
authored
Merge pull request #67 from DataMini/release-please--branches--main--changes--next
release: 3.7.0
2 parents 2d3a56a + cc21ceb commit 37b724e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2467
-155
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-
".": "3.6.0"
2+
".": "3.7.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: 82
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-8e9dc6bfba12f2eba83e978265436d2d6daabb89b04188ee749a32b3e2a6f55d.yml
1+
configured_endpoints: 90
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-f4eb4b4f84901ac48b5fbfbde2712cf15833c5824a01aa2e164524465819a2e8.yml

CHANGELOG.md

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

3+
## 3.7.0 (2024-12-16)
4+
5+
Full Changelog: [v3.6.0...v3.7.0](https://github.com/DataMini/asktable-python/compare/v3.6.0...v3.7.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#66](https://github.com/DataMini/asktable-python/issues/66)) ([6594f10](https://github.com/DataMini/asktable-python/commit/6594f1034b276bb3001540d114d02267c1794b6e))
10+
* **api:** api update ([#68](https://github.com/DataMini/asktable-python/issues/68)) ([5fe3dcb](https://github.com/DataMini/asktable-python/commit/5fe3dcb932fd23f19b086540e9fa9153da05760b))
11+
* **api:** api update ([#73](https://github.com/DataMini/asktable-python/issues/73)) ([76b3810](https://github.com/DataMini/asktable-python/commit/76b3810c6f74f12314041abff16e09052f2fa515))
12+
* **api:** manual updates ([#74](https://github.com/DataMini/asktable-python/issues/74)) ([2735ed4](https://github.com/DataMini/asktable-python/commit/2735ed4040e9b0d9adc0b46bc6cd9330269b8787))
13+
14+
15+
### Chores
16+
17+
* **internal:** add support for TypeAliasType ([#70](https://github.com/DataMini/asktable-python/issues/70)) ([c0046ed](https://github.com/DataMini/asktable-python/commit/c0046ed398c750087a03659a92a10240e32d0829))
18+
* **internal:** bump pyright ([#69](https://github.com/DataMini/asktable-python/issues/69)) ([3bd5327](https://github.com/DataMini/asktable-python/commit/3bd5327773c10649284d0e95c55d9ba4a06c0ee4))
19+
* **internal:** codegen related update ([#71](https://github.com/DataMini/asktable-python/issues/71)) ([ef36085](https://github.com/DataMini/asktable-python/commit/ef3608545a5e58e405226176a907dab1b73fc9fd))
20+
* **internal:** codegen related update ([#72](https://github.com/DataMini/asktable-python/issues/72)) ([6a363c3](https://github.com/DataMini/asktable-python/commit/6a363c3cf0964cf648422dd06a13fb4fa7d98808))
21+
322
## 3.6.0 (2024-12-10)
423

524
Full Changelog: [v3.5.0...v3.6.0](https://github.com/DataMini/asktable-python/compare/v3.5.0...v3.6.0)

api.md

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

105105
```python
106-
from asktable.types import Chat, Message
106+
from asktable.types import AIMessage, Chat, ToolMessage, UserMessage, ChatSendMessageResponse
107107
```
108108

109109
Methods:
@@ -112,15 +112,25 @@ Methods:
112112
- <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.py">Chat</a></code>
113113
- <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>
114114
- <code title="delete /chats/{chat_id}">client.chats.<a href="./src/asktable/resources/chats/chats.py">delete</a>(chat_id) -> None</code>
115-
- <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/message.py">Message</a></code>
115+
- <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>
116116

117117
## Messages
118118

119+
Types:
120+
121+
```python
122+
from asktable.types.chats import (
123+
MessageRetrieveResponse,
124+
MessageListResponse,
125+
MessageSendMessageResponse,
126+
)
127+
```
128+
119129
Methods:
120130

121-
- <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/message.py">Message</a></code>
122-
- <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/message.py">SyncPage[Message]</a></code>
123-
- <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/message.py">Message</a></code>
131+
- <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>
132+
- <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>
133+
- <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>
124134

125135
# Datasources
126136

@@ -320,5 +330,51 @@ Methods:
320330
- <code title="post /business-glossary">client.business_glossary.<a href="./src/asktable/resources/business_glossary.py">create</a>(\*\*<a href="src/asktable/types/business_glossary_create_params.py">params</a>) -> <a href="./src/asktable/types/business_glossary_create_response.py">BusinessGlossaryCreateResponse</a></code>
321331
- <code title="get /business-glossary/{entry_id}">client.business_glossary.<a href="./src/asktable/resources/business_glossary.py">retrieve</a>(entry_id) -> <a href="./src/asktable/types/entry_with_definition.py">EntryWithDefinition</a></code>
322332
- <code title="patch /business-glossary/{entry_id}">client.business_glossary.<a href="./src/asktable/resources/business_glossary.py">update</a>(entry_id, \*\*<a href="src/asktable/types/business_glossary_update_params.py">params</a>) -> <a href="./src/asktable/types/entry.py">Entry</a></code>
323-
- <code title="get /business-glossary">client.business_glossary.<a href="./src/asktable/resources/business_glossary.py">list</a>(\*\*<a href="src/asktable/types/business_glossary_list_params.py">params</a>) -> <a href="./src/asktable/types/entry.py">SyncPage[Entry]</a></code>
333+
- <code title="get /business-glossary">client.business_glossary.<a href="./src/asktable/resources/business_glossary.py">list</a>(\*\*<a href="src/asktable/types/business_glossary_list_params.py">params</a>) -> <a href="./src/asktable/types/entry_with_definition.py">SyncPage[EntryWithDefinition]</a></code>
324334
- <code title="delete /business-glossary/{entry_id}">client.business_glossary.<a href="./src/asktable/resources/business_glossary.py">delete</a>(entry_id) -> <a href="./src/asktable/types/business_glossary_delete_response.py">object</a></code>
335+
336+
# Preferences
337+
338+
Types:
339+
340+
```python
341+
from asktable.types import (
342+
PreferenceCreateResponse,
343+
PreferenceRetrieveResponse,
344+
PreferenceUpdateResponse,
345+
PreferenceDeleteResponse,
346+
)
347+
```
348+
349+
Methods:
350+
351+
- <code title="post /preference">client.preferences.<a href="./src/asktable/resources/preferences.py">create</a>(\*\*<a href="src/asktable/types/preference_create_params.py">params</a>) -> <a href="./src/asktable/types/preference_create_response.py">PreferenceCreateResponse</a></code>
352+
- <code title="get /preference">client.preferences.<a href="./src/asktable/resources/preferences.py">retrieve</a>() -> <a href="./src/asktable/types/preference_retrieve_response.py">PreferenceRetrieveResponse</a></code>
353+
- <code title="patch /preference">client.preferences.<a href="./src/asktable/resources/preferences.py">update</a>(\*\*<a href="src/asktable/types/preference_update_params.py">params</a>) -> <a href="./src/asktable/types/preference_update_response.py">PreferenceUpdateResponse</a></code>
354+
- <code title="delete /preference">client.preferences.<a href="./src/asktable/resources/preferences.py">delete</a>() -> <a href="./src/asktable/types/preference_delete_response.py">object</a></code>
355+
356+
# Trainings
357+
358+
Types:
359+
360+
```python
361+
from asktable.types import TrainingCreateResponse, TrainingListResponse, TrainingDeleteResponse
362+
```
363+
364+
Methods:
365+
366+
- <code title="post /training">client.trainings.<a href="./src/asktable/resources/trainings.py">create</a>(\*\*<a href="src/asktable/types/training_create_params.py">params</a>) -> <a href="./src/asktable/types/training_create_response.py">TrainingCreateResponse</a></code>
367+
- <code title="get /training">client.trainings.<a href="./src/asktable/resources/trainings.py">list</a>(\*\*<a href="src/asktable/types/training_list_params.py">params</a>) -> <a href="./src/asktable/types/training_list_response.py">SyncPage[TrainingListResponse]</a></code>
368+
- <code title="delete /training/{id}">client.trainings.<a href="./src/asktable/resources/trainings.py">delete</a>(id, \*\*<a href="src/asktable/types/training_delete_params.py">params</a>) -> <a href="./src/asktable/types/training_delete_response.py">object</a></code>
369+
370+
# Scores
371+
372+
Types:
373+
374+
```python
375+
from asktable.types import ScoreCreateResponse
376+
```
377+
378+
Methods:
379+
380+
- <code title="post /score">client.scores.<a href="./src/asktable/resources/scores.py">create</a>(\*\*<a href="src/asktable/types/score_create_params.py">params</a>) -> <a href="./src/asktable/types/score_create_response.py">ScoreCreateResponse</a></code>

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "asktable"
3-
version = "3.6.0"
3+
version = "3.7.0"
44
description = "The official Python library for the asktable API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -10,7 +10,7 @@ authors = [
1010
dependencies = [
1111
"httpx>=0.23.0, <1",
1212
"pydantic>=1.9.0, <3",
13-
"typing-extensions>=4.7, <5",
13+
"typing-extensions>=4.10, <5",
1414
"anyio>=3.5.0, <5",
1515
"distro>=1.7.0, <2",
1616
"sniffio",

requirements-dev.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pydantic-core==2.27.1
6868
# via pydantic
6969
pygments==2.18.0
7070
# via rich
71-
pyright==1.1.389
71+
pyright==1.1.390
7272
pytest==8.3.3
7373
# via pytest-asyncio
7474
pytest-asyncio==0.24.0

src/asktable/_client.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class Asktable(SyncAPIClient):
5959
caches: resources.CachesResource
6060
integration: resources.IntegrationResource
6161
business_glossary: resources.BusinessGlossaryResource
62+
preferences: resources.PreferencesResource
63+
trainings: resources.TrainingsResource
64+
scores: resources.ScoresResource
6265
with_raw_response: AsktableWithRawResponse
6366
with_streaming_response: AsktableWithStreamedResponse
6467

@@ -129,6 +132,9 @@ def __init__(
129132
self.caches = resources.CachesResource(self)
130133
self.integration = resources.IntegrationResource(self)
131134
self.business_glossary = resources.BusinessGlossaryResource(self)
135+
self.preferences = resources.PreferencesResource(self)
136+
self.trainings = resources.TrainingsResource(self)
137+
self.scores = resources.ScoresResource(self)
132138
self.with_raw_response = AsktableWithRawResponse(self)
133139
self.with_streaming_response = AsktableWithStreamedResponse(self)
134140

@@ -251,6 +257,9 @@ class AsyncAsktable(AsyncAPIClient):
251257
caches: resources.AsyncCachesResource
252258
integration: resources.AsyncIntegrationResource
253259
business_glossary: resources.AsyncBusinessGlossaryResource
260+
preferences: resources.AsyncPreferencesResource
261+
trainings: resources.AsyncTrainingsResource
262+
scores: resources.AsyncScoresResource
254263
with_raw_response: AsyncAsktableWithRawResponse
255264
with_streaming_response: AsyncAsktableWithStreamedResponse
256265

@@ -321,6 +330,9 @@ def __init__(
321330
self.caches = resources.AsyncCachesResource(self)
322331
self.integration = resources.AsyncIntegrationResource(self)
323332
self.business_glossary = resources.AsyncBusinessGlossaryResource(self)
333+
self.preferences = resources.AsyncPreferencesResource(self)
334+
self.trainings = resources.AsyncTrainingsResource(self)
335+
self.scores = resources.AsyncScoresResource(self)
324336
self.with_raw_response = AsyncAsktableWithRawResponse(self)
325337
self.with_streaming_response = AsyncAsktableWithStreamedResponse(self)
326338

@@ -444,6 +456,9 @@ def __init__(self, client: Asktable) -> None:
444456
self.caches = resources.CachesResourceWithRawResponse(client.caches)
445457
self.integration = resources.IntegrationResourceWithRawResponse(client.integration)
446458
self.business_glossary = resources.BusinessGlossaryResourceWithRawResponse(client.business_glossary)
459+
self.preferences = resources.PreferencesResourceWithRawResponse(client.preferences)
460+
self.trainings = resources.TrainingsResourceWithRawResponse(client.trainings)
461+
self.scores = resources.ScoresResourceWithRawResponse(client.scores)
447462

448463

449464
class AsyncAsktableWithRawResponse:
@@ -461,6 +476,9 @@ def __init__(self, client: AsyncAsktable) -> None:
461476
self.caches = resources.AsyncCachesResourceWithRawResponse(client.caches)
462477
self.integration = resources.AsyncIntegrationResourceWithRawResponse(client.integration)
463478
self.business_glossary = resources.AsyncBusinessGlossaryResourceWithRawResponse(client.business_glossary)
479+
self.preferences = resources.AsyncPreferencesResourceWithRawResponse(client.preferences)
480+
self.trainings = resources.AsyncTrainingsResourceWithRawResponse(client.trainings)
481+
self.scores = resources.AsyncScoresResourceWithRawResponse(client.scores)
464482

465483

466484
class AsktableWithStreamedResponse:
@@ -478,6 +496,9 @@ def __init__(self, client: Asktable) -> None:
478496
self.caches = resources.CachesResourceWithStreamingResponse(client.caches)
479497
self.integration = resources.IntegrationResourceWithStreamingResponse(client.integration)
480498
self.business_glossary = resources.BusinessGlossaryResourceWithStreamingResponse(client.business_glossary)
499+
self.preferences = resources.PreferencesResourceWithStreamingResponse(client.preferences)
500+
self.trainings = resources.TrainingsResourceWithStreamingResponse(client.trainings)
501+
self.scores = resources.ScoresResourceWithStreamingResponse(client.scores)
481502

482503

483504
class AsyncAsktableWithStreamedResponse:
@@ -495,6 +516,9 @@ def __init__(self, client: AsyncAsktable) -> None:
495516
self.caches = resources.AsyncCachesResourceWithStreamingResponse(client.caches)
496517
self.integration = resources.AsyncIntegrationResourceWithStreamingResponse(client.integration)
497518
self.business_glossary = resources.AsyncBusinessGlossaryResourceWithStreamingResponse(client.business_glossary)
519+
self.preferences = resources.AsyncPreferencesResourceWithStreamingResponse(client.preferences)
520+
self.trainings = resources.AsyncTrainingsResourceWithStreamingResponse(client.trainings)
521+
self.scores = resources.AsyncScoresResourceWithStreamingResponse(client.scores)
498522

499523

500524
Client = Asktable

src/asktable/_models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
strip_not_given,
4747
extract_type_arg,
4848
is_annotated_type,
49+
is_type_alias_type,
4950
strip_annotated_type,
5051
)
5152
from ._compat import (
@@ -428,6 +429,8 @@ def construct_type(*, value: object, type_: object) -> object:
428429
# we allow `object` as the input type because otherwise, passing things like
429430
# `Literal['value']` will be reported as a type error by type checkers
430431
type_ = cast("type[object]", type_)
432+
if is_type_alias_type(type_):
433+
type_ = type_.__value__ # type: ignore[unreachable]
431434

432435
# unwrap `Annotated[T, ...]` -> `T`
433436
if is_annotated_type(type_):

src/asktable/_response.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import pydantic
2626

2727
from ._types import NoneType
28-
from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base
28+
from ._utils import is_given, extract_type_arg, is_annotated_type, is_type_alias_type, extract_type_var_from_base
2929
from ._models import BaseModel, is_basemodel
3030
from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER
3131
from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type
@@ -126,9 +126,15 @@ def __repr__(self) -> str:
126126
)
127127

128128
def _parse(self, *, to: type[_T] | None = None) -> R | _T:
129+
cast_to = to if to is not None else self._cast_to
130+
131+
# unwrap `TypeAlias('Name', T)` -> `T`
132+
if is_type_alias_type(cast_to):
133+
cast_to = cast_to.__value__ # type: ignore[unreachable]
134+
129135
# unwrap `Annotated[T, ...]` -> `T`
130-
if to and is_annotated_type(to):
131-
to = extract_type_arg(to, 0)
136+
if cast_to and is_annotated_type(cast_to):
137+
cast_to = extract_type_arg(cast_to, 0)
132138

133139
if self._is_sse_stream:
134140
if to:
@@ -164,18 +170,12 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
164170
return cast(
165171
R,
166172
stream_cls(
167-
cast_to=self._cast_to,
173+
cast_to=cast_to,
168174
response=self.http_response,
169175
client=cast(Any, self._client),
170176
),
171177
)
172178

173-
cast_to = to if to is not None else self._cast_to
174-
175-
# unwrap `Annotated[T, ...]` -> `T`
176-
if is_annotated_type(cast_to):
177-
cast_to = extract_type_arg(cast_to, 0)
178-
179179
if cast_to is NoneType:
180180
return cast(R, None)
181181

src/asktable/_utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
is_iterable_type as is_iterable_type,
4040
is_required_type as is_required_type,
4141
is_annotated_type as is_annotated_type,
42+
is_type_alias_type as is_type_alias_type,
4243
strip_annotated_type as strip_annotated_type,
4344
extract_type_var_from_base as extract_type_var_from_base,
4445
)

0 commit comments

Comments
 (0)