Skip to content

Commit 17a1b10

Browse files
release: 0.13.1 (#146)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent fa2e13b commit 17a1b10

17 files changed

+141
-74
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-
".": "0.13.0"
2+
".": "0.13.1"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 7
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-98874226a7dcad763f5fb96534de25a43f9187733a5293fa278b0b61bf71a9b3.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-a711d22c2283945608fc5ab6a399805da8961d6b9e0e068637d389ed611230c0.yml

CHANGELOG.md

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

3+
## 0.13.1 (2024-12-14)
4+
5+
Full Changelog: [v0.13.0...v0.13.1](https://github.com/groq/groq-python/compare/v0.13.0...v0.13.1)
6+
7+
### Chores
8+
9+
* **internal:** add support for TypeAliasType ([#153](https://github.com/groq/groq-python/issues/153)) ([c5ca4fc](https://github.com/groq/groq-python/commit/c5ca4fc7c1ced7e49f06d05e67924f702e5e021d))
10+
* **internal:** bump pydantic dependency ([#150](https://github.com/groq/groq-python/issues/150)) ([63e5754](https://github.com/groq/groq-python/commit/63e5754857bcbc137350971520cf9997e4d78da3))
11+
* **internal:** bump pyright ([#145](https://github.com/groq/groq-python/issues/145)) ([8f2b3a0](https://github.com/groq/groq-python/commit/8f2b3a0d70dad49b652a61f549979c1c5125d9d4))
12+
* **internal:** bump pyright ([#152](https://github.com/groq/groq-python/issues/152)) ([75476cd](https://github.com/groq/groq-python/commit/75476cd26c33e48220ab8760e129cd3f70413df5))
13+
* **internal:** codegen related update ([#154](https://github.com/groq/groq-python/issues/154)) ([db44bd6](https://github.com/groq/groq-python/commit/db44bd6adfb1eddfee9ee06cc63d4c594713eebc))
14+
* **internal:** codegen related update ([#155](https://github.com/groq/groq-python/issues/155)) ([7f303c3](https://github.com/groq/groq-python/commit/7f303c31dbebfe97b97388ff7f29238fc917da43))
15+
* **internal:** updated imports ([#156](https://github.com/groq/groq-python/issues/156)) ([3f41c12](https://github.com/groq/groq-python/commit/3f41c12bd36e13eba37d2bd7fd4f3f595bda4602))
16+
* make the `Omit` type public ([#147](https://github.com/groq/groq-python/issues/147)) ([0613ae1](https://github.com/groq/groq-python/commit/0613ae1e9f9dede7cb951d2d0591017894576b3a))
17+
18+
19+
### Documentation
20+
21+
* **readme:** fix http client proxies example ([#151](https://github.com/groq/groq-python/issues/151)) ([b858c4f](https://github.com/groq/groq-python/commit/b858c4f742bdd7aae79f17981cb9d3b001ed009b))
22+
323
## 0.13.0 (2024-11-28)
424

525
Full Changelog: [v0.12.0...v0.13.0](https://github.com/groq/groq-python/compare/v0.12.0...v0.13.0)

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,18 +335,19 @@ can also get all the extra fields on the Pydantic model as a dict with
335335

336336
You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
337337

338-
- Support for proxies
339-
- Custom transports
338+
- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)
339+
- Custom [transports](https://www.python-httpx.org/advanced/transports/)
340340
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
341341

342342
```python
343+
import httpx
343344
from groq import Groq, DefaultHttpxClient
344345

345346
client = Groq(
346347
# Or use the `GROQ_BASE_URL` env var
347348
base_url="http://my.test.server.example.com:8083",
348349
http_client=DefaultHttpxClient(
349-
proxies="http://my.test.proxy.example.com",
350+
proxy="http://my.test.proxy.example.com",
350351
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
351352
),
352353
)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "groq"
3-
version = "0.13.0"
3+
version = "0.13.1"
44
description = "The official Python library for the groq 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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ platformdirs==3.11.0
6262
# via virtualenv
6363
pluggy==1.5.0
6464
# via pytest
65-
pydantic==2.9.2
65+
pydantic==2.10.3
6666
# via groq
67-
pydantic-core==2.23.4
67+
pydantic-core==2.27.1
6868
# via pydantic
6969
pygments==2.18.0
7070
# via rich
71-
pyright==1.1.380
71+
pyright==1.1.390
7272
pytest==8.3.3
7373
# via pytest-asyncio
7474
pytest-asyncio==0.24.0
@@ -97,6 +97,7 @@ typing-extensions==4.12.2
9797
# via mypy
9898
# via pydantic
9999
# via pydantic-core
100+
# via pyright
100101
virtualenv==20.24.5
101102
# via nox
102103
zipp==3.17.0

requirements.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ httpx==0.25.2
3030
idna==3.4
3131
# via anyio
3232
# via httpx
33-
pydantic==2.9.2
33+
pydantic==2.10.3
3434
# via groq
35-
pydantic-core==2.23.4
35+
pydantic-core==2.27.1
3636
# via pydantic
3737
sniffio==1.3.0
3838
# via anyio

src/groq/__init__.py

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

33
from . import types
4-
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
4+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
55
from ._utils import file_from_path
66
from ._client import Groq, Client, Stream, Timeout, AsyncGroq, Transport, AsyncClient, AsyncStream, RequestOptions
77
from ._models import BaseModel
@@ -36,6 +36,7 @@
3636
"ProxiesTypes",
3737
"NotGiven",
3838
"NOT_GIVEN",
39+
"Omit",
3940
"GroqError",
4041
"APIError",
4142
"APIStatusError",

src/groq/_client.py

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import httpx
1010

11-
from . import resources, _exceptions
11+
from . import _exceptions
1212
from ._qs import Querystring
1313
from ._types import (
1414
NOT_GIVEN,
@@ -24,32 +24,25 @@
2424
get_async_library,
2525
)
2626
from ._version import __version__
27+
from .resources import models, embeddings
2728
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2829
from ._exceptions import GroqError, APIStatusError
2930
from ._base_client import (
3031
DEFAULT_MAX_RETRIES,
3132
SyncAPIClient,
3233
AsyncAPIClient,
3334
)
35+
from .resources.chat import chat
36+
from .resources.audio import audio
3437

35-
__all__ = [
36-
"Timeout",
37-
"Transport",
38-
"ProxiesTypes",
39-
"RequestOptions",
40-
"resources",
41-
"Groq",
42-
"AsyncGroq",
43-
"Client",
44-
"AsyncClient",
45-
]
38+
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Groq", "AsyncGroq", "Client", "AsyncClient"]
4639

4740

4841
class Groq(SyncAPIClient):
49-
chat: resources.Chat
50-
embeddings: resources.Embeddings
51-
audio: resources.Audio
52-
models: resources.Models
42+
chat: chat.Chat
43+
embeddings: embeddings.Embeddings
44+
audio: audio.Audio
45+
models: models.Models
5346
with_raw_response: GroqWithRawResponse
5447
with_streaming_response: GroqWithStreamedResponse
5548

@@ -107,10 +100,10 @@ def __init__(
107100
_strict_response_validation=_strict_response_validation,
108101
)
109102

110-
self.chat = resources.Chat(self)
111-
self.embeddings = resources.Embeddings(self)
112-
self.audio = resources.Audio(self)
113-
self.models = resources.Models(self)
103+
self.chat = chat.Chat(self)
104+
self.embeddings = embeddings.Embeddings(self)
105+
self.audio = audio.Audio(self)
106+
self.models = models.Models(self)
114107
self.with_raw_response = GroqWithRawResponse(self)
115108
self.with_streaming_response = GroqWithStreamedResponse(self)
116109

@@ -220,10 +213,10 @@ def _make_status_error(
220213

221214

222215
class AsyncGroq(AsyncAPIClient):
223-
chat: resources.AsyncChat
224-
embeddings: resources.AsyncEmbeddings
225-
audio: resources.AsyncAudio
226-
models: resources.AsyncModels
216+
chat: chat.AsyncChat
217+
embeddings: embeddings.AsyncEmbeddings
218+
audio: audio.AsyncAudio
219+
models: models.AsyncModels
227220
with_raw_response: AsyncGroqWithRawResponse
228221
with_streaming_response: AsyncGroqWithStreamedResponse
229222

@@ -281,10 +274,10 @@ def __init__(
281274
_strict_response_validation=_strict_response_validation,
282275
)
283276

284-
self.chat = resources.AsyncChat(self)
285-
self.embeddings = resources.AsyncEmbeddings(self)
286-
self.audio = resources.AsyncAudio(self)
287-
self.models = resources.AsyncModels(self)
277+
self.chat = chat.AsyncChat(self)
278+
self.embeddings = embeddings.AsyncEmbeddings(self)
279+
self.audio = audio.AsyncAudio(self)
280+
self.models = models.AsyncModels(self)
288281
self.with_raw_response = AsyncGroqWithRawResponse(self)
289282
self.with_streaming_response = AsyncGroqWithStreamedResponse(self)
290283

@@ -395,34 +388,34 @@ def _make_status_error(
395388

396389
class GroqWithRawResponse:
397390
def __init__(self, client: Groq) -> None:
398-
self.chat = resources.ChatWithRawResponse(client.chat)
399-
self.embeddings = resources.EmbeddingsWithRawResponse(client.embeddings)
400-
self.audio = resources.AudioWithRawResponse(client.audio)
401-
self.models = resources.ModelsWithRawResponse(client.models)
391+
self.chat = chat.ChatWithRawResponse(client.chat)
392+
self.embeddings = embeddings.EmbeddingsWithRawResponse(client.embeddings)
393+
self.audio = audio.AudioWithRawResponse(client.audio)
394+
self.models = models.ModelsWithRawResponse(client.models)
402395

403396

404397
class AsyncGroqWithRawResponse:
405398
def __init__(self, client: AsyncGroq) -> None:
406-
self.chat = resources.AsyncChatWithRawResponse(client.chat)
407-
self.embeddings = resources.AsyncEmbeddingsWithRawResponse(client.embeddings)
408-
self.audio = resources.AsyncAudioWithRawResponse(client.audio)
409-
self.models = resources.AsyncModelsWithRawResponse(client.models)
399+
self.chat = chat.AsyncChatWithRawResponse(client.chat)
400+
self.embeddings = embeddings.AsyncEmbeddingsWithRawResponse(client.embeddings)
401+
self.audio = audio.AsyncAudioWithRawResponse(client.audio)
402+
self.models = models.AsyncModelsWithRawResponse(client.models)
410403

411404

412405
class GroqWithStreamedResponse:
413406
def __init__(self, client: Groq) -> None:
414-
self.chat = resources.ChatWithStreamingResponse(client.chat)
415-
self.embeddings = resources.EmbeddingsWithStreamingResponse(client.embeddings)
416-
self.audio = resources.AudioWithStreamingResponse(client.audio)
417-
self.models = resources.ModelsWithStreamingResponse(client.models)
407+
self.chat = chat.ChatWithStreamingResponse(client.chat)
408+
self.embeddings = embeddings.EmbeddingsWithStreamingResponse(client.embeddings)
409+
self.audio = audio.AudioWithStreamingResponse(client.audio)
410+
self.models = models.ModelsWithStreamingResponse(client.models)
418411

419412

420413
class AsyncGroqWithStreamedResponse:
421414
def __init__(self, client: AsyncGroq) -> None:
422-
self.chat = resources.AsyncChatWithStreamingResponse(client.chat)
423-
self.embeddings = resources.AsyncEmbeddingsWithStreamingResponse(client.embeddings)
424-
self.audio = resources.AsyncAudioWithStreamingResponse(client.audio)
425-
self.models = resources.AsyncModelsWithStreamingResponse(client.models)
415+
self.chat = chat.AsyncChatWithStreamingResponse(client.chat)
416+
self.embeddings = embeddings.AsyncEmbeddingsWithStreamingResponse(client.embeddings)
417+
self.audio = audio.AsyncAudioWithStreamingResponse(client.audio)
418+
self.models = models.AsyncModelsWithStreamingResponse(client.models)
426419

427420

428421
Client = Groq

src/groq/_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_):

0 commit comments

Comments
 (0)