Skip to content

Commit 68d1cf5

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#127)
1 parent 3c753b3 commit 68d1cf5

26 files changed

+516
-126
lines changed

.stats.yml

+1-1
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-1f0d266ba97b03672f10d33a6dc6e324af9a95646f978ffbff6a31f3907bbfe7.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-e832198c20514199804ae71f3213d3747cfea8dbae37304e852fd58912abb2c1.yml

CONTRIBUTING.md

+28-24
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
### With Rye
44

5-
We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
5+
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
66

7-
After installing Rye, you'll just have to run this command:
7+
```sh
8+
$ ./scripts/bootstrap
9+
```
10+
11+
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
812

913
```sh
1014
$ rye sync --all-features
@@ -31,25 +35,25 @@ $ pip install -r requirements-dev.lock
3135

3236
## Modifying/Adding code
3337

34-
Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
35-
`src/groq/lib/` and `examples/` directories are exceptions and will never be overridden.
38+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
39+
result in merge conflicts between manual patches and changes from the generator. The generator will never
40+
modify the contents of the `src/groq/lib/` and `examples/` directories.
3641

3742
## Adding and running examples
3843

39-
All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or
40-
added to.
44+
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
4145

42-
```bash
46+
```py
4347
# add an example to examples/<your-example>.py
4448

4549
#!/usr/bin/env -S rye run python
4650
4751
```
4852

49-
```
50-
chmod +x examples/<your-example>.py
53+
```sh
54+
$ chmod +x examples/<your-example>.py
5155
# run the example against your api
52-
./examples/<your-example>.py
56+
$ ./examples/<your-example>.py
5357
```
5458

5559
## Using the repository from source
@@ -58,8 +62,8 @@ If you’d like to use the repository from source, you can either install from g
5862

5963
To install via git:
6064

61-
```bash
62-
pip install git+ssh://git@github.com/groq/groq-python#main.git
65+
```sh
66+
$ pip install git+ssh://git@github.com/groq/groq-python#main.git
6367
```
6468

6569
Alternatively, you can build from source and install the wheel file:
@@ -68,29 +72,29 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
6872

6973
To create a distributable version of the library, all you have to do is run this command:
7074

71-
```bash
72-
rye build
75+
```sh
76+
$ rye build
7377
# or
74-
python -m build
78+
$ python -m build
7579
```
7680

7781
Then to install:
7882

7983
```sh
80-
pip install ./path-to-wheel-file.whl
84+
$ pip install ./path-to-wheel-file.whl
8185
```
8286

8387
## Running tests
8488

8589
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
8690

87-
```bash
91+
```sh
8892
# you will need npm installed
89-
npx prism mock path/to/your/openapi.yml
93+
$ npx prism mock path/to/your/openapi.yml
9094
```
9195

92-
```bash
93-
rye run pytest
96+
```sh
97+
$ ./scripts/test
9498
```
9599

96100
## Linting and formatting
@@ -100,14 +104,14 @@ This repository uses [ruff](https://github.com/astral-sh/ruff) and
100104

101105
To lint:
102106

103-
```bash
104-
rye run lint
107+
```sh
108+
$ ./scripts/lint
105109
```
106110

107111
To format and fix all ruff issues automatically:
108112

109-
```bash
110-
rye run format
113+
```sh
114+
$ ./scripts/format
111115
```
112116

113117
## Publishing and releases

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,21 @@ We take backwards-compatibility seriously and work hard to ensure you can rely o
374374

375375
We are keen for your feedback; please open an [issue](https://github.com/groq/groq-python/issues) with questions, bugs, or suggestions.
376376

377+
### Determining the installed version
378+
379+
If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.
380+
381+
You can determine the version that is being used at runtime with:
382+
383+
```py
384+
import groq
385+
print(groq.__version__)
386+
```
387+
377388
## Requirements
378389

379390
Python 3.7 or higher.
391+
392+
## Contributing
393+
394+
See [the contributing documentation](./CONTRIBUTING.md).

pyproject.toml

+2-10
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dependencies = [
1515
"distro>=1.7.0, <2",
1616
"sniffio",
1717
"cached-property; python_version < '3.8'",
18-
1918
]
2019
requires-python = ">= 3.7"
2120
classifiers = [
@@ -36,8 +35,6 @@ classifiers = [
3635
"License :: OSI Approved :: Apache Software License"
3736
]
3837

39-
40-
4138
[project.urls]
4239
Homepage = "https://github.com/groq/groq-python"
4340
Repository = "https://github.com/groq/groq-python"
@@ -59,19 +56,18 @@ dev-dependencies = [
5956
"dirty-equals>=0.6.0",
6057
"importlib-metadata>=6.7.0",
6158
"rich>=13.7.1",
62-
6359
]
6460

6561
[tool.rye.scripts]
6662
format = { chain = [
6763
"format:ruff",
6864
"format:docs",
6965
"fix:ruff",
66+
# run formatting again to fix any inconsistencies when imports are stripped
67+
"format:ruff",
7068
]}
71-
"format:black" = "black ."
7269
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
7370
"format:ruff" = "ruff format"
74-
"format:isort" = "isort ."
7571

7672
"lint" = { chain = [
7773
"check:ruff",
@@ -129,10 +125,6 @@ path = "README.md"
129125
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
130126
replacement = '[\1](https://github.com/groq/groq-python/tree/main/\g<2>)'
131127

132-
[tool.black]
133-
line-length = 120
134-
target-version = ["py37"]
135-
136128
[tool.pytest.ini_options]
137129
testpaths = ["tests"]
138130
addopts = "--tb=short"

requirements-dev.lock

+12-15
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ anyio==4.4.0
1616
# via httpx
1717
argcomplete==3.1.2
1818
# via nox
19-
attrs==23.1.0
20-
# via pytest
2119
certifi==2023.7.22
2220
# via httpcore
2321
# via httpx
@@ -28,8 +26,9 @@ distlib==0.3.7
2826
# via virtualenv
2927
distro==1.8.0
3028
# via groq
31-
exceptiongroup==1.1.3
29+
exceptiongroup==1.2.2
3230
# via anyio
31+
# via pytest
3332
filelock==3.12.4
3433
# via virtualenv
3534
h11==0.14.0
@@ -49,7 +48,7 @@ markdown-it-py==3.0.0
4948
# via rich
5049
mdurl==0.1.2
5150
# via markdown-it-py
52-
mypy==1.10.1
51+
mypy==1.11.2
5352
mypy-extensions==1.0.0
5453
# via mypy
5554
nodeenv==1.8.0
@@ -60,27 +59,25 @@ packaging==23.2
6059
# via pytest
6160
platformdirs==3.11.0
6261
# via virtualenv
63-
pluggy==1.3.0
64-
# via pytest
65-
py==1.11.0
62+
pluggy==1.5.0
6663
# via pytest
67-
pydantic==2.7.1
64+
pydantic==2.9.2
6865
# via groq
69-
pydantic-core==2.18.2
66+
pydantic-core==2.23.4
7067
# via pydantic
7168
pygments==2.18.0
7269
# via rich
73-
pyright==1.1.374
74-
pytest==7.1.1
70+
pyright==1.1.380
71+
pytest==8.3.3
7572
# via pytest-asyncio
76-
pytest-asyncio==0.21.1
73+
pytest-asyncio==0.24.0
7774
python-dateutil==2.8.2
7875
# via time-machine
7976
pytz==2023.3.post1
8077
# via dirty-equals
8178
respx==0.20.2
8279
rich==13.7.1
83-
ruff==0.5.6
80+
ruff==0.6.9
8481
setuptools==68.2.2
8582
# via nodeenv
8683
six==1.16.0
@@ -90,10 +87,10 @@ sniffio==1.3.0
9087
# via groq
9188
# via httpx
9289
time-machine==2.9.0
93-
tomli==2.0.1
90+
tomli==2.0.2
9491
# via mypy
9592
# via pytest
96-
typing-extensions==4.8.0
93+
typing-extensions==4.12.2
9794
# via anyio
9895
# via groq
9996
# via mypy

requirements.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ certifi==2023.7.22
1919
# via httpx
2020
distro==1.8.0
2121
# via groq
22-
exceptiongroup==1.1.3
22+
exceptiongroup==1.2.2
2323
# via anyio
2424
h11==0.14.0
2525
# via httpcore
@@ -30,15 +30,15 @@ httpx==0.25.2
3030
idna==3.4
3131
# via anyio
3232
# via httpx
33-
pydantic==2.7.1
33+
pydantic==2.9.2
3434
# via groq
35-
pydantic-core==2.18.2
35+
pydantic-core==2.23.4
3636
# via pydantic
3737
sniffio==1.3.0
3838
# via anyio
3939
# via groq
4040
# via httpx
41-
typing-extensions==4.8.0
41+
typing-extensions==4.12.2
4242
# via anyio
4343
# via groq
4444
# via pydantic

0 commit comments

Comments
 (0)