Skip to content

Commit f6e2c46

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

17 files changed

+99
-22
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.1"
2+
".": "0.14.0"
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-a711d22c2283945608fc5ab6a399805da8961d6b9e0e068637d389ed611230c0.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-33be0d612b9f1153b86f53e95bf7c571af2f1e466bda2330b632e6c05832e2a6.yml

CHANGELOG.md

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

3+
## 0.14.0 (2025-01-09)
4+
5+
Full Changelog: [v0.13.1...v0.14.0](https://github.com/groq/groq-python/compare/v0.13.1...v0.14.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#163](https://github.com/groq/groq-python/issues/163)) ([43a7a5b](https://github.com/groq/groq-python/commit/43a7a5b048b22f4a5edba53ec31b2b8967681708))
10+
* **api:** api update ([#167](https://github.com/groq/groq-python/issues/167)) ([5016206](https://github.com/groq/groq-python/commit/5016206e461c384806ac3c68b8dfab3d342ba93c))
11+
* **api:** api update ([#170](https://github.com/groq/groq-python/issues/170)) ([2b35e95](https://github.com/groq/groq-python/commit/2b35e952e12020116adc45e40007c3fd61db1bb7))
12+
13+
14+
### Bug Fixes
15+
16+
* **client:** only call .close() when needed ([#169](https://github.com/groq/groq-python/issues/169)) ([6a0ec57](https://github.com/groq/groq-python/commit/6a0ec576de707ed90a4a536ff206e9ee07fc5a3a))
17+
18+
19+
### Chores
20+
21+
* add missing isclass check ([#166](https://github.com/groq/groq-python/issues/166)) ([9cb1e72](https://github.com/groq/groq-python/commit/9cb1e727377c93c92d1bbd49f1c5b8613730c3a6))
22+
* **internal:** bump httpx dependency ([#168](https://github.com/groq/groq-python/issues/168)) ([c260ae9](https://github.com/groq/groq-python/commit/c260ae969caa5f4e7b48dd558802b933da98bed6))
23+
* **internal:** codegen related update ([#158](https://github.com/groq/groq-python/issues/158)) ([85b5765](https://github.com/groq/groq-python/commit/85b5765b2b6cfa9560c763600699fd05f7b2a632))
24+
* **internal:** codegen related update ([#160](https://github.com/groq/groq-python/issues/160)) ([8b87c4d](https://github.com/groq/groq-python/commit/8b87c4d657e0a9d2296323eff6d298ec98b34b3e))
25+
* **internal:** codegen related update ([#164](https://github.com/groq/groq-python/issues/164)) ([d7b6be5](https://github.com/groq/groq-python/commit/d7b6be5f4bba87002409330644045ba630856880))
26+
* **internal:** fix some typos ([#162](https://github.com/groq/groq-python/issues/162)) ([32482ae](https://github.com/groq/groq-python/commit/32482ae691f24fdbd5c80282c597a299a48a247d))
27+
28+
29+
### Documentation
30+
31+
* **readme:** example snippet for client context manager ([#161](https://github.com/groq/groq-python/issues/161)) ([b7bfd15](https://github.com/groq/groq-python/commit/b7bfd15768d60beb2059ab3d326bae1b19c6bf17))
32+
333
## 0.13.1 (2024-12-14)
434

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2024 Groq
189+
Copyright 2025 Groq
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,16 @@ client.with_options(http_client=DefaultHttpxClient(...))
363363

364364
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
365365

366+
```py
367+
from groq import Groq
368+
369+
with Groq() as client:
370+
# make requests here
371+
...
372+
373+
# HTTP client is now closed
374+
```
375+
366376
## Versioning
367377

368378
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

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.1"
3+
version = "0.14.0"
44
description = "The official Python library for the groq API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -54,7 +54,7 @@ dev-dependencies = [
5454
"dirty-equals>=0.6.0",
5555
"importlib-metadata>=6.7.0",
5656
"rich>=13.7.1",
57-
"nest_asyncio==1.6.0"
57+
"nest_asyncio==1.6.0",
5858
]
5959

6060
[tool.rye.scripts]

requirements-dev.lock

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ h11==0.14.0
3535
# via httpcore
3636
httpcore==1.0.2
3737
# via httpx
38-
httpx==0.25.2
38+
httpx==0.28.1
3939
# via groq
4040
# via respx
4141
idna==3.4
@@ -76,7 +76,7 @@ python-dateutil==2.8.2
7676
# via time-machine
7777
pytz==2023.3.post1
7878
# via dirty-equals
79-
respx==0.20.2
79+
respx==0.22.0
8080
rich==13.7.1
8181
ruff==0.6.9
8282
setuptools==68.2.2
@@ -86,7 +86,6 @@ six==1.16.0
8686
sniffio==1.3.0
8787
# via anyio
8888
# via groq
89-
# via httpx
9089
time-machine==2.9.0
9190
tomli==2.0.2
9291
# via mypy

requirements.lock

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ h11==0.14.0
2525
# via httpcore
2626
httpcore==1.0.2
2727
# via httpx
28-
httpx==0.25.2
28+
httpx==0.28.1
2929
# via groq
3030
idna==3.4
3131
# via anyio
@@ -37,7 +37,6 @@ pydantic-core==2.27.1
3737
sniffio==1.3.0
3838
# via anyio
3939
# via groq
40-
# via httpx
4140
typing-extensions==4.12.2
4241
# via anyio
4342
# via groq

src/groq/_base_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,9 @@ def __init__(self, **kwargs: Any) -> None:
767767

768768
class SyncHttpxClientWrapper(DefaultHttpxClient):
769769
def __del__(self) -> None:
770+
if self.is_closed:
771+
return
772+
770773
try:
771774
self.close()
772775
except Exception:
@@ -1334,6 +1337,9 @@ def __init__(self, **kwargs: Any) -> None:
13341337

13351338
class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient):
13361339
def __del__(self) -> None:
1340+
if self.is_closed:
1341+
return
1342+
13371343
try:
13381344
# TODO(someday): support non asyncio runtimes here
13391345
asyncio.get_running_loop().create_task(self.aclose())

src/groq/_models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,11 @@ def construct_type(*, value: object, type_: object) -> object:
488488
_, items_type = get_args(type_) # Dict[_, items_type]
489489
return {key: construct_type(value=item, type_=items_type) for key, item in value.items()}
490490

491-
if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)):
491+
if (
492+
not is_literal_type(type_)
493+
and inspect.isclass(origin)
494+
and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel))
495+
):
492496
if is_list(value):
493497
return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value]
494498

0 commit comments

Comments
 (0)