Skip to content

Commit 7d19610

Browse files
release: 0.16.0 (#181)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 9d0bb04 commit 7d19610

11 files changed

+113
-61
lines changed

.devcontainer/Dockerfile

-23
This file was deleted.

.devcontainer/devcontainer.json

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
33
{
4-
"name": "Debian",
5-
"build": {
6-
"dockerfile": "Dockerfile"
4+
"name": "Development",
5+
"image": "mcr.microsoft.com/devcontainers/typescript-node:latest",
6+
"features": {
7+
"ghcr.io/devcontainers/features/node:1": {}
8+
},
9+
"postCreateCommand": "yarn install",
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"esbenp.prettier-vscode"
14+
]
15+
}
716
}
8-
9-
// Features to add to the dev container. More info: https://containers.dev/features.
10-
// "features": {},
11-
12-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13-
// "forwardPorts": [],
14-
15-
// Configure tool-specific properties.
16-
// "customizations": {},
17-
18-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
19-
// "remoteUser": "root"
2017
}

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.15.0"
2+
".": "0.16.0"
33
}

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 15
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-d1588e103a6ae0234752b8e54a746fb1e4c93a0ee51ede294017bcd4f0ee4ac0.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-21e2668d8b211239f9b1019b09a89fcbc00855284b2434a52d80abf32de2e8f7.yml

CHANGELOG.md

+28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Changelog
22

3+
## 0.16.0 (2025-03-11)
4+
5+
Full Changelog: [v0.15.0...v0.16.0](https://github.com/groq/groq-typescript/compare/v0.15.0...v0.16.0)
6+
7+
### Features
8+
9+
* add SKIP_BREW env var to ./scripts/bootstrap ([#186](https://github.com/groq/groq-typescript/issues/186)) ([7188745](https://github.com/groq/groq-typescript/commit/71887452485edb042aa49a813ca7295903641c73))
10+
* **client:** accept RFC6838 JSON content types ([#187](https://github.com/groq/groq-typescript/issues/187)) ([8cb3baa](https://github.com/groq/groq-typescript/commit/8cb3baa9f05b4013ffae5e4199ee65d68d7d9b8c))
11+
* **client:** send `X-Stainless-Timeout` header ([#180](https://github.com/groq/groq-typescript/issues/180)) ([a3372bc](https://github.com/groq/groq-typescript/commit/a3372bcccd5b68b6f9610a9e2fc5cf1d30c296d7))
12+
13+
14+
### Bug Fixes
15+
16+
* **client:** fix export map for index exports ([#182](https://github.com/groq/groq-typescript/issues/182)) ([9537350](https://github.com/groq/groq-typescript/commit/9537350b6e19af0c1213ab85f6f2b697863e163d))
17+
* GitHub Terraform: Create/Update .github/workflows/stale.yaml [skip ci] ([9d0bb04](https://github.com/groq/groq-typescript/commit/9d0bb04c153ed9584ac936956fa88c94384f8b63))
18+
* GitHub Terraform: Create/Update .github/workflows/stale.yaml [skip ci] ([5fa6983](https://github.com/groq/groq-typescript/commit/5fa6983323ea6376dfa1eb0f39906b721ea757d6))
19+
20+
21+
### Chores
22+
23+
* **internal:** codegen related update ([#183](https://github.com/groq/groq-typescript/issues/183)) ([203e3b1](https://github.com/groq/groq-typescript/commit/203e3b1102db8515143cdf536f1c9d583b85b3e5))
24+
* **internal:** fix devcontainers setup ([#184](https://github.com/groq/groq-typescript/issues/184)) ([f0df22c](https://github.com/groq/groq-typescript/commit/f0df22cb095ef79933661922c802376f65182fb6))
25+
26+
27+
### Documentation
28+
29+
* update URLs from stainlessapi.com to stainless.com ([#185](https://github.com/groq/groq-typescript/issues/185)) ([1c481a6](https://github.com/groq/groq-typescript/commit/1c481a6fa9fbc3bbe8901470022c2789cbe366e1))
30+
331
## 0.15.0 (2025-02-05)
432

533
Full Changelog: [v0.14.0...v0.15.0](https://github.com/groq/groq-typescript/compare/v0.14.0...v0.15.0)

README.md

+43-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This library provides convenient access to the Groq REST API from server-side Ty
66

77
The REST API documentation can be found on [console.groq.com](https://console.groq.com/docs). The full API of this library can be found in [api.md](api.md).
88

9-
It is generated with [Stainless](https://www.stainlessapi.com/).
9+
It is generated with [Stainless](https://www.stainless.com/).
1010

1111
## Installation
1212

@@ -66,6 +66,48 @@ main();
6666

6767
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
6868

69+
## File uploads
70+
71+
Request parameters that correspond to file uploads can be passed in many different forms:
72+
73+
- `File` (or an object with the same structure)
74+
- a `fetch` `Response` (or an object with the same structure)
75+
- an `fs.ReadStream`
76+
- the return value of our `toFile` helper
77+
78+
```ts
79+
import fs from 'fs';
80+
import fetch from 'node-fetch';
81+
import Groq, { toFile } from 'groq-sdk';
82+
83+
const client = new Groq();
84+
85+
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
86+
await client.audio.transcriptions.create({
87+
file: fs.createReadStream('/path/to/file'),
88+
model: 'whisper-large-v3',
89+
});
90+
91+
// Or if you have the web `File` API you can pass a `File` instance:
92+
await client.audio.transcriptions.create({ file: new File(['my bytes'], 'file'), model: 'whisper-large-v3' });
93+
94+
// You can also pass a `fetch` `Response`:
95+
await client.audio.transcriptions.create({
96+
file: await fetch('https://somesite/file'),
97+
model: 'whisper-large-v3',
98+
});
99+
100+
// Finally, if none of the above are convenient, you can use our `toFile` helper:
101+
await client.audio.transcriptions.create({
102+
file: await toFile(Buffer.from('my bytes'), 'file'),
103+
model: 'whisper-large-v3',
104+
});
105+
await client.audio.transcriptions.create({
106+
file: await toFile(new Uint8Array([0, 1, 2]), 'file'),
107+
model: 'whisper-large-v3',
108+
});
109+
```
110+
69111
## Handling errors
70112

71113
When the library is unable to connect to the API,

SECURITY.md

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

33
## Reporting Security Issues
44

5-
This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
5+
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
66

7-
To report a security issue, please contact the Stainless team at security@stainlessapi.com.
7+
To report a security issue, please contact the Stainless team at security@stainless.com.
88

99
## Responsible Disclosure
1010

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "groq-sdk",
3-
"version": "0.15.0",
3+
"version": "0.16.0",
44
"description": "The official TypeScript library for the Groq API",
55
"author": "Groq <support@groq.com>",
66
"types": "dist/index.d.ts",
@@ -107,17 +107,17 @@
107107
"default": "./dist/index.mjs"
108108
},
109109
"./*.mjs": {
110-
"types": "./dist/*.d.ts",
111-
"default": "./dist/*.mjs"
110+
"types": ["./dist/*.d.ts", "./dist/*/index.d.ts"],
111+
"default": ["./dist/*.mjs", "./dist/*/index.mjs"]
112112
},
113113
"./*.js": {
114-
"types": "./dist/*.d.ts",
115-
"default": "./dist/*.js"
114+
"types": ["./dist/*.d.ts", "./dist/*/index.d.ts"],
115+
"default": ["./dist/*.js", "./dist/*/index.js"]
116116
},
117117
"./*": {
118-
"types": "./dist/*.d.ts",
119-
"require": "./dist/*.js",
120-
"default": "./dist/*.mjs"
118+
"types": ["./dist/*.d.ts", "./dist/*/index.d.ts"],
119+
"require": ["./dist/*.js", "./dist/*/index.js"],
120+
"default": ["./dist/*.mjs", "./dist/*/index.mjs"]
121121
}
122122
}
123123
}

scripts/bootstrap

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
7+
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then
88
brew bundle check >/dev/null 2>&1 || {
99
echo "==> Installing Homebrew dependencies…"
1010
brew bundle

src/core.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
6262
}
6363

6464
const contentType = response.headers.get('content-type');
65-
const isJSON =
66-
contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json');
65+
const mediaType = contentType?.split(';')[0]?.trim();
66+
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
6767
if (isJSON) {
6868
const json = await response.json();
6969

@@ -294,6 +294,7 @@ export abstract class APIClient {
294294
options: FinalRequestOptions<Req>,
295295
{ retryCount = 0 }: { retryCount?: number } = {},
296296
): { req: RequestInit; url: string; timeout: number } {
297+
options = { ...options };
297298
const { method, path, query, headers: headers = {} } = options;
298299

299300
const body =
@@ -306,9 +307,9 @@ export abstract class APIClient {
306307

307308
const url = this.buildURL(path!, query);
308309
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
309-
const timeout = options.timeout ?? this.timeout;
310+
options.timeout = options.timeout ?? this.timeout;
310311
const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
311-
const minAgentTimeout = timeout + 1000;
312+
const minAgentTimeout = options.timeout + 1000;
312313
if (
313314
typeof (httpAgent as any)?.options?.timeout === 'number' &&
314315
minAgentTimeout > ((httpAgent as any).options.timeout ?? 0)
@@ -337,7 +338,7 @@ export abstract class APIClient {
337338
signal: options.signal ?? null,
338339
};
339340

340-
return { req, url, timeout };
341+
return { req, url, timeout: options.timeout };
341342
}
342343

343344
private buildHeaders({
@@ -365,15 +366,22 @@ export abstract class APIClient {
365366
delete reqHeaders['content-type'];
366367
}
367368

368-
// Don't set the retry count header if it was already set or removed through default headers or by the
369-
// caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to
370-
// account for the removal case.
369+
// Don't set theses headers if they were already set or removed through default headers or by the caller.
370+
// We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account
371+
// for the removal case.
371372
if (
372373
getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
373374
getHeader(headers, 'x-stainless-retry-count') === undefined
374375
) {
375376
reqHeaders['x-stainless-retry-count'] = String(retryCount);
376377
}
378+
if (
379+
getHeader(defaultHeaders, 'x-stainless-timeout') === undefined &&
380+
getHeader(headers, 'x-stainless-timeout') === undefined &&
381+
options.timeout
382+
) {
383+
reqHeaders['x-stainless-timeout'] = String(options.timeout);
384+
}
377385

378386
this.validateHeaders(reqHeaders, headers);
379387

src/version.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.15.0'; // x-release-please-version
1+
export const VERSION = '0.16.0'; // x-release-please-version

0 commit comments

Comments
 (0)