Skip to content

Commit b74ce9e

Browse files
release: 0.18.0 (#189)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 3cee54e commit b74ce9e

27 files changed

+2087
-11
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.17.0"
2+
".": "0.18.0"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 7
1+
configured_endpoints: 15
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-d1588e103a6ae0234752b8e54a746fb1e4c93a0ee51ede294017bcd4f0ee4ac0.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+
## 0.18.0 (2025-02-05)
4+
5+
Full Changelog: [v0.17.0...v0.18.0](https://github.com/groq/groq-python/compare/v0.17.0...v0.18.0)
6+
7+
### Features
8+
9+
* **api:** Add batch API ([#191](https://github.com/groq/groq-python/issues/191)) ([367a744](https://github.com/groq/groq-python/commit/367a744f461ec82353b916c7d95224d9baa78737))
10+
11+
12+
### Chores
13+
14+
* **internal:** bummp ruff dependency ([#190](https://github.com/groq/groq-python/issues/190)) ([61678fc](https://github.com/groq/groq-python/commit/61678fc5fd4eb42e42d88057934b6204d19086af))
15+
* **internal:** change default timeout to an int ([#188](https://github.com/groq/groq-python/issues/188)) ([348e152](https://github.com/groq/groq-python/commit/348e1526711e4d162379dcd80a9b201572508376))
16+
317
## 0.17.0 (2025-02-03)
418

519
Full Changelog: [v0.16.0...v0.17.0](https://github.com/groq/groq-python/compare/v0.16.0...v0.17.0)

api.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,39 @@ Methods:
9797
- <code title="get /openai/v1/models/{model}">client.models.<a href="./src/groq/resources/models.py">retrieve</a>(model) -> <a href="./src/groq/types/model.py">Model</a></code>
9898
- <code title="get /openai/v1/models">client.models.<a href="./src/groq/resources/models.py">list</a>() -> <a href="./src/groq/types/model_list_response.py">ModelListResponse</a></code>
9999
- <code title="delete /openai/v1/models/{model}">client.models.<a href="./src/groq/resources/models.py">delete</a>(model) -> <a href="./src/groq/types/model_deleted.py">ModelDeleted</a></code>
100+
101+
# Batches
102+
103+
Types:
104+
105+
```python
106+
from groq.types import BatchCreateResponse, BatchRetrieveResponse, BatchListResponse
107+
```
108+
109+
Methods:
110+
111+
- <code title="post /openai/v1/batches">client.batches.<a href="./src/groq/resources/batches.py">create</a>(\*\*<a href="src/groq/types/batch_create_params.py">params</a>) -> <a href="./src/groq/types/batch_create_response.py">BatchCreateResponse</a></code>
112+
- <code title="get /openai/v1/batches/{batch_id}">client.batches.<a href="./src/groq/resources/batches.py">retrieve</a>(batch_id) -> <a href="./src/groq/types/batch_retrieve_response.py">BatchRetrieveResponse</a></code>
113+
- <code title="get /openai/v1/batches">client.batches.<a href="./src/groq/resources/batches.py">list</a>() -> <a href="./src/groq/types/batch_list_response.py">BatchListResponse</a></code>
114+
115+
# Files
116+
117+
Types:
118+
119+
```python
120+
from groq.types import (
121+
FileCreateResponse,
122+
FileListResponse,
123+
FileDeleteResponse,
124+
FileContentResponse,
125+
FileInfoResponse,
126+
)
127+
```
128+
129+
Methods:
130+
131+
- <code title="post /openai/v1/files">client.files.<a href="./src/groq/resources/files.py">create</a>(\*\*<a href="src/groq/types/file_create_params.py">params</a>) -> <a href="./src/groq/types/file_create_response.py">FileCreateResponse</a></code>
132+
- <code title="get /openai/v1/files">client.files.<a href="./src/groq/resources/files.py">list</a>() -> <a href="./src/groq/types/file_list_response.py">FileListResponse</a></code>
133+
- <code title="delete /openai/v1/files/{file_id}">client.files.<a href="./src/groq/resources/files.py">delete</a>(file_id) -> <a href="./src/groq/types/file_delete_response.py">FileDeleteResponse</a></code>
134+
- <code title="get /openai/v1/files/{file_id}/content">client.files.<a href="./src/groq/resources/files.py">content</a>(file_id) -> str</code>
135+
- <code title="get /openai/v1/files/{file_id}">client.files.<a href="./src/groq/resources/files.py">info</a>(file_id) -> <a href="./src/groq/types/file_info_response.py">FileInfoResponse</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 = "groq"
3-
version = "0.17.0"
3+
version = "0.18.0"
44
description = "The official Python library for the groq API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -177,7 +177,7 @@ select = [
177177
"T201",
178178
"T203",
179179
# misuse of typing.TYPE_CHECKING
180-
"TCH004",
180+
"TC004",
181181
# import rules
182182
"TID251",
183183
]

requirements-dev.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pytz==2023.3.post1
7878
# via dirty-equals
7979
respx==0.22.0
8080
rich==13.7.1
81-
ruff==0.6.9
81+
ruff==0.9.4
8282
setuptools==68.2.2
8383
# via nodeenv
8484
six==1.16.0

scripts/utils/ruffen-docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str:
4747
with _collect_error(match):
4848
code = format_code_block(code)
4949
code = textwrap.indent(code, match["indent"])
50-
return f'{match["before"]}{code}{match["after"]}'
50+
return f"{match['before']}{code}{match['after']}"
5151

5252
def _pycon_match(match: Match[str]) -> str:
5353
code = ""
@@ -97,7 +97,7 @@ def finish_fragment() -> None:
9797
def _md_pycon_match(match: Match[str]) -> str:
9898
code = _pycon_match(match)
9999
code = textwrap.indent(code, match["indent"])
100-
return f'{match["before"]}{code}{match["after"]}'
100+
return f"{match['before']}{code}{match['after']}"
101101

102102
src = MD_RE.sub(_md_match, src)
103103
src = MD_PYCON_RE.sub(_md_pycon_match, src)

src/groq/_client.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
get_async_library,
2525
)
2626
from ._version import __version__
27-
from .resources import models, embeddings
27+
from .resources import files, models, batches, embeddings
2828
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2929
from ._exceptions import GroqError, APIStatusError
3030
from ._base_client import (
@@ -43,6 +43,8 @@ class Groq(SyncAPIClient):
4343
embeddings: embeddings.Embeddings
4444
audio: audio.Audio
4545
models: models.Models
46+
batches: batches.Batches
47+
files: files.Files
4648
with_raw_response: GroqWithRawResponse
4749
with_streaming_response: GroqWithStreamedResponse
4850

@@ -104,6 +106,8 @@ def __init__(
104106
self.embeddings = embeddings.Embeddings(self)
105107
self.audio = audio.Audio(self)
106108
self.models = models.Models(self)
109+
self.batches = batches.Batches(self)
110+
self.files = files.Files(self)
107111
self.with_raw_response = GroqWithRawResponse(self)
108112
self.with_streaming_response = GroqWithStreamedResponse(self)
109113

@@ -217,6 +221,8 @@ class AsyncGroq(AsyncAPIClient):
217221
embeddings: embeddings.AsyncEmbeddings
218222
audio: audio.AsyncAudio
219223
models: models.AsyncModels
224+
batches: batches.AsyncBatches
225+
files: files.AsyncFiles
220226
with_raw_response: AsyncGroqWithRawResponse
221227
with_streaming_response: AsyncGroqWithStreamedResponse
222228

@@ -278,6 +284,8 @@ def __init__(
278284
self.embeddings = embeddings.AsyncEmbeddings(self)
279285
self.audio = audio.AsyncAudio(self)
280286
self.models = models.AsyncModels(self)
287+
self.batches = batches.AsyncBatches(self)
288+
self.files = files.AsyncFiles(self)
281289
self.with_raw_response = AsyncGroqWithRawResponse(self)
282290
self.with_streaming_response = AsyncGroqWithStreamedResponse(self)
283291

@@ -392,6 +400,8 @@ def __init__(self, client: Groq) -> None:
392400
self.embeddings = embeddings.EmbeddingsWithRawResponse(client.embeddings)
393401
self.audio = audio.AudioWithRawResponse(client.audio)
394402
self.models = models.ModelsWithRawResponse(client.models)
403+
self.batches = batches.BatchesWithRawResponse(client.batches)
404+
self.files = files.FilesWithRawResponse(client.files)
395405

396406

397407
class AsyncGroqWithRawResponse:
@@ -400,6 +410,8 @@ def __init__(self, client: AsyncGroq) -> None:
400410
self.embeddings = embeddings.AsyncEmbeddingsWithRawResponse(client.embeddings)
401411
self.audio = audio.AsyncAudioWithRawResponse(client.audio)
402412
self.models = models.AsyncModelsWithRawResponse(client.models)
413+
self.batches = batches.AsyncBatchesWithRawResponse(client.batches)
414+
self.files = files.AsyncFilesWithRawResponse(client.files)
403415

404416

405417
class GroqWithStreamedResponse:
@@ -408,6 +420,8 @@ def __init__(self, client: Groq) -> None:
408420
self.embeddings = embeddings.EmbeddingsWithStreamingResponse(client.embeddings)
409421
self.audio = audio.AudioWithStreamingResponse(client.audio)
410422
self.models = models.ModelsWithStreamingResponse(client.models)
423+
self.batches = batches.BatchesWithStreamingResponse(client.batches)
424+
self.files = files.FilesWithStreamingResponse(client.files)
411425

412426

413427
class AsyncGroqWithStreamedResponse:
@@ -416,6 +430,8 @@ def __init__(self, client: AsyncGroq) -> None:
416430
self.embeddings = embeddings.AsyncEmbeddingsWithStreamingResponse(client.embeddings)
417431
self.audio = audio.AsyncAudioWithStreamingResponse(client.audio)
418432
self.models = models.AsyncModelsWithStreamingResponse(client.models)
433+
self.batches = batches.AsyncBatchesWithStreamingResponse(client.batches)
434+
self.files = files.AsyncFilesWithStreamingResponse(client.files)
419435

420436

421437
Client = Groq

src/groq/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"
77

88
# default timeout is 1 minute
9-
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0)
9+
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
1010
DEFAULT_MAX_RETRIES = 2
1111
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
1212

src/groq/_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def to_json(
172172
@override
173173
def __str__(self) -> str:
174174
# mypy complains about an invalid self arg
175-
return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc]
175+
return f"{self.__repr_name__()}({self.__repr_str__(', ')})" # type: ignore[misc]
176176

177177
# Override the 'construct' method in a way that supports recursive parsing without validation.
178178
# Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836.

0 commit comments

Comments
 (0)