Skip to content

Commit 1fc7614

Browse files
release: 0.32.0 (#251)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Graden Rea <grea@groq.com>
1 parent ba00a6e commit 1fc7614

30 files changed

+539
-484
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.31.1"
2+
".": "0.32.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-7b46be9995c02d5d7f1e18b2f29704c54a25664c6c9b36330d133883d1ad3fce.yml
3-
openapi_spec_hash: 210b0cc34ee0750530d872c12e39cc31
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-626e11caa9a9d011fb76829cd69007eb36ff75d5739cd487ce6ed2a0527037fc.yml
3+
openapi_spec_hash: d7460def3f498d17bb75ab935a2ff2e0
44
config_hash: 961b4995e909aef11a454befa56ad3d2

CHANGELOG.md

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

3+
## 0.32.0 (2025-09-27)
4+
5+
Full Changelog: [v0.31.1...v0.32.0](https://github.com/groq/groq-python/compare/v0.31.1...v0.32.0)
6+
7+
### Features
8+
9+
* **api:** api update ([5d3f1db](https://github.com/groq/groq-python/commit/5d3f1dbe12828c92fcee1c4340e2f1ee9f5764b0))
10+
* **api:** api update ([5b48116](https://github.com/groq/groq-python/commit/5b4811685c7e81cc2933ebc521184fff9c55e267))
11+
12+
13+
### Bug Fixes
14+
15+
* chat stream overloads ([42f9396](https://github.com/groq/groq-python/commit/42f9396959f205f3a439932f1811f82091d0e7f5))
16+
* GitHub Terraform: Create/Update .github/workflows/stale.yaml [skip ci] ([ba00a6e](https://github.com/groq/groq-python/commit/ba00a6e71b7559da44a2d9b2a4babcdfa6d70b85))
17+
18+
19+
### Chores
20+
21+
* **internal:** move mypy configurations to `pyproject.toml` file ([a8113a5](https://github.com/groq/groq-python/commit/a8113a56fc7a57c3c07231fa6925708d038c028f))
22+
* **internal:** update pydantic dependency ([0d8773d](https://github.com/groq/groq-python/commit/0d8773d7520fe91d6eb721b00dbff0dcd850e69c))
23+
* **tests:** simplify `get_platform` test ([a257487](https://github.com/groq/groq-python/commit/a257487327c3601743d49a8d96f74bef4a6c24f7))
24+
* **types:** change optional parameter type from NotGiven to Omit ([882ffc0](https://github.com/groq/groq-python/commit/882ffc0f1f6b1e529b2cd6c3252f75b225fa514a))
25+
326
## 0.31.1 (2025-09-04)
427

528
Full Changelog: [v0.31.0...v0.31.1](https://github.com/groq/groq-python/compare/v0.31.0...v0.31.1)

mypy.ini

Lines changed: 0 additions & 50 deletions
This file was deleted.

pyproject.toml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "groq"
3-
version = "0.31.1"
3+
version = "0.32.0"
44
description = "The official Python library for the groq API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -56,7 +56,6 @@ dev-dependencies = [
5656
"dirty-equals>=0.6.0",
5757
"importlib-metadata>=6.7.0",
5858
"rich>=13.7.1",
59-
"nest_asyncio==1.6.0",
6059
"pytest-xdist>=3.6.1",
6160
]
6261

@@ -157,6 +156,58 @@ reportOverlappingOverload = false
157156
reportImportCycles = false
158157
reportPrivateUsage = false
159158

159+
[tool.mypy]
160+
pretty = true
161+
show_error_codes = true
162+
163+
# Exclude _files.py because mypy isn't smart enough to apply
164+
# the correct type narrowing and as this is an internal module
165+
# it's fine to just use Pyright.
166+
#
167+
# We also exclude our `tests` as mypy doesn't always infer
168+
# types correctly and Pyright will still catch any type errors.
169+
exclude = ['src/groq/_files.py', '_dev/.*.py', 'tests/.*']
170+
171+
strict_equality = true
172+
implicit_reexport = true
173+
check_untyped_defs = true
174+
no_implicit_optional = true
175+
176+
warn_return_any = true
177+
warn_unreachable = true
178+
warn_unused_configs = true
179+
180+
# Turn these options off as it could cause conflicts
181+
# with the Pyright options.
182+
warn_unused_ignores = false
183+
warn_redundant_casts = false
184+
185+
disallow_any_generics = true
186+
disallow_untyped_defs = true
187+
disallow_untyped_calls = true
188+
disallow_subclassing_any = true
189+
disallow_incomplete_defs = true
190+
disallow_untyped_decorators = true
191+
cache_fine_grained = true
192+
193+
# By default, mypy reports an error if you assign a value to the result
194+
# of a function call that doesn't return anything. We do this in our test
195+
# cases:
196+
# ```
197+
# result = ...
198+
# assert result is None
199+
# ```
200+
# Changing this codegen to make mypy happy would increase complexity
201+
# and would not be worth it.
202+
disable_error_code = "func-returns-value,overload-cannot-match"
203+
204+
# https://github.com/python/mypy/issues/12162
205+
[[tool.mypy.overrides]]
206+
module = "black.files.*"
207+
ignore_errors = true
208+
ignore_missing_imports = true
209+
210+
160211
[tool.ruff]
161212
line-length = 120
162213
output-format = "grouped"

requirements-dev.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ multidict==6.4.4
7575
mypy==1.14.1
7676
mypy-extensions==1.0.0
7777
# via mypy
78-
nest-asyncio==1.6.0
7978
nodeenv==1.8.0
8079
# via pyright
8180
nox==2023.4.22
@@ -89,9 +88,9 @@ pluggy==1.5.0
8988
propcache==0.3.1
9089
# via aiohttp
9190
# via yarl
92-
pydantic==2.10.3
91+
pydantic==2.11.9
9392
# via groq
94-
pydantic-core==2.27.1
93+
pydantic-core==2.33.2
9594
# via pydantic
9695
pygments==2.18.0
9796
# via rich
@@ -127,6 +126,9 @@ typing-extensions==4.12.2
127126
# via pydantic
128127
# via pydantic-core
129128
# via pyright
129+
# via typing-inspection
130+
typing-inspection==0.4.1
131+
# via pydantic
130132
virtualenv==20.24.5
131133
# via nox
132134
yarl==1.20.0

requirements.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ multidict==6.4.4
5555
propcache==0.3.1
5656
# via aiohttp
5757
# via yarl
58-
pydantic==2.10.3
58+
pydantic==2.11.9
5959
# via groq
60-
pydantic-core==2.27.1
60+
pydantic-core==2.33.2
6161
# via pydantic
6262
sniffio==1.3.0
6363
# via anyio
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
6868
# via multidict
6969
# via pydantic
7070
# via pydantic-core
71+
# via typing-inspection
72+
typing-inspection==0.4.1
73+
# via pydantic
7174
yarl==1.20.0
7275
# via aiohttp

src/groq/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import typing as _t
44

55
from . import types
6-
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
6+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
77
from ._utils import file_from_path
88
from ._client import Groq, Client, Stream, Timeout, AsyncGroq, Transport, AsyncClient, AsyncStream, RequestOptions
99
from ._models import BaseModel
@@ -38,7 +38,9 @@
3838
"ProxiesTypes",
3939
"NotGiven",
4040
"NOT_GIVEN",
41+
"not_given",
4142
"Omit",
43+
"omit",
4244
"GroqError",
4345
"APIError",
4446
"APIStatusError",

src/groq/_base_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from ._qs import Querystring
4343
from ._files import to_httpx_files, async_to_httpx_files
4444
from ._types import (
45-
NOT_GIVEN,
4645
Body,
4746
Omit,
4847
Query,
@@ -57,6 +56,7 @@
5756
RequestOptions,
5857
HttpxRequestFiles,
5958
ModelBuilderProtocol,
59+
not_given,
6060
)
6161
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
6262
from ._compat import PYDANTIC_V1, model_copy, model_dump
@@ -145,9 +145,9 @@ def __init__(
145145
def __init__(
146146
self,
147147
*,
148-
url: URL | NotGiven = NOT_GIVEN,
149-
json: Body | NotGiven = NOT_GIVEN,
150-
params: Query | NotGiven = NOT_GIVEN,
148+
url: URL | NotGiven = not_given,
149+
json: Body | NotGiven = not_given,
150+
params: Query | NotGiven = not_given,
151151
) -> None:
152152
self.url = url
153153
self.json = json
@@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques
595595
# we internally support defining a temporary header to override the
596596
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
597597
# see _response.py for implementation details
598-
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
598+
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
599599
if is_given(override_cast_to):
600600
options.headers = headers
601601
return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +825,7 @@ def __init__(
825825
version: str,
826826
base_url: str | URL,
827827
max_retries: int = DEFAULT_MAX_RETRIES,
828-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
828+
timeout: float | Timeout | None | NotGiven = not_given,
829829
http_client: httpx.Client | None = None,
830830
custom_headers: Mapping[str, str] | None = None,
831831
custom_query: Mapping[str, object] | None = None,
@@ -1356,7 +1356,7 @@ def __init__(
13561356
base_url: str | URL,
13571357
_strict_response_validation: bool,
13581358
max_retries: int = DEFAULT_MAX_RETRIES,
1359-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
1359+
timeout: float | Timeout | None | NotGiven = not_given,
13601360
http_client: httpx.AsyncClient | None = None,
13611361
custom_headers: Mapping[str, str] | None = None,
13621362
custom_query: Mapping[str, object] | None = None,
@@ -1818,8 +1818,8 @@ def make_request_options(
18181818
extra_query: Query | None = None,
18191819
extra_body: Body | None = None,
18201820
idempotency_key: str | None = None,
1821-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1822-
post_parser: PostParser | NotGiven = NOT_GIVEN,
1821+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1822+
post_parser: PostParser | NotGiven = not_given,
18231823
) -> RequestOptions:
18241824
"""Create a dict of type RequestOptions without keys of NotGiven values."""
18251825
options: RequestOptions = {}

src/groq/_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
from __future__ import annotations
44

55
import os
6-
from typing import TYPE_CHECKING, Any, Union, Mapping
6+
from typing import TYPE_CHECKING, Any, Mapping
77
from typing_extensions import Self, override
88

99
import httpx
1010

1111
from . import _exceptions
1212
from ._qs import Querystring
1313
from ._types import (
14-
NOT_GIVEN,
1514
Omit,
1615
Timeout,
1716
NotGiven,
1817
Transport,
1918
ProxiesTypes,
2019
RequestOptions,
20+
not_given,
2121
)
2222
from ._utils import is_given, get_async_library
2323
from ._compat import cached_property
@@ -51,7 +51,7 @@ def __init__(
5151
*,
5252
api_key: str | None = None,
5353
base_url: str | httpx.URL | None = None,
54-
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
54+
timeout: float | Timeout | None | NotGiven = not_given,
5555
max_retries: int = DEFAULT_MAX_RETRIES,
5656
default_headers: Mapping[str, str] | None = None,
5757
default_query: Mapping[str, object] | None = None,
@@ -166,9 +166,9 @@ def copy(
166166
*,
167167
api_key: str | None = None,
168168
base_url: str | httpx.URL | None = None,
169-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
169+
timeout: float | Timeout | None | NotGiven = not_given,
170170
http_client: httpx.Client | None = None,
171-
max_retries: int | NotGiven = NOT_GIVEN,
171+
max_retries: int | NotGiven = not_given,
172172
default_headers: Mapping[str, str] | None = None,
173173
set_default_headers: Mapping[str, str] | None = None,
174174
default_query: Mapping[str, object] | None = None,
@@ -255,7 +255,7 @@ def __init__(
255255
*,
256256
api_key: str | None = None,
257257
base_url: str | httpx.URL | None = None,
258-
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
258+
timeout: float | Timeout | None | NotGiven = not_given,
259259
max_retries: int = DEFAULT_MAX_RETRIES,
260260
default_headers: Mapping[str, str] | None = None,
261261
default_query: Mapping[str, object] | None = None,
@@ -370,9 +370,9 @@ def copy(
370370
*,
371371
api_key: str | None = None,
372372
base_url: str | httpx.URL | None = None,
373-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
373+
timeout: float | Timeout | None | NotGiven = not_given,
374374
http_client: httpx.AsyncClient | None = None,
375-
max_retries: int | NotGiven = NOT_GIVEN,
375+
max_retries: int | NotGiven = not_given,
376376
default_headers: Mapping[str, str] | None = None,
377377
set_default_headers: Mapping[str, str] | None = None,
378378
default_query: Mapping[str, object] | None = None,

0 commit comments

Comments
 (0)