Skip to content

Commit c37f243

Browse files
release: 0.10.0 (#148)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 82d0903 commit c37f243

12 files changed

+67
-15
lines changed

.release-please-manifest.json

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

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

CHANGELOG.md

+27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## 0.10.0 (2025-01-07)
4+
5+
Full Changelog: [v0.9.1...v0.10.0](https://github.com/groq/groq-typescript/compare/v0.9.1...v0.10.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#157](https://github.com/groq/groq-typescript/issues/157)) ([3551087](https://github.com/groq/groq-typescript/commit/35510876e2e5c5295502bec56d09cbf759955bd2))
10+
* **api:** api update ([#159](https://github.com/groq/groq-typescript/issues/159)) ([e0cbb97](https://github.com/groq/groq-typescript/commit/e0cbb978af53e25ba48b768d465c61fd08085f92))
11+
12+
13+
### Bug Fixes
14+
15+
* **client:** normalize method ([#155](https://github.com/groq/groq-typescript/issues/155)) ([c3ba88c](https://github.com/groq/groq-typescript/commit/c3ba88c2f457c057b64331f5153a64d7051a65cf))
16+
17+
18+
### Chores
19+
20+
* **internal:** codegen related update ([#149](https://github.com/groq/groq-typescript/issues/149)) ([4b1115b](https://github.com/groq/groq-typescript/commit/4b1115bc7dad629e6cbfd305d1f02c5d83c08cb4))
21+
* **internal:** codegen related update ([#150](https://github.com/groq/groq-typescript/issues/150)) ([d582c40](https://github.com/groq/groq-typescript/commit/d582c40dfe47d45549a6edd91890ed7822f7af95))
22+
* **internal:** codegen related update ([#151](https://github.com/groq/groq-typescript/issues/151)) ([e153d84](https://github.com/groq/groq-typescript/commit/e153d84e5b9208acfc5b0a368f2e580900f0958d))
23+
* **internal:** codegen related update ([#152](https://github.com/groq/groq-typescript/issues/152)) ([33a4d9c](https://github.com/groq/groq-typescript/commit/33a4d9ce6b56a194001da9d75663e8498083d223))
24+
* **internal:** codegen related update ([#153](https://github.com/groq/groq-typescript/issues/153)) ([dbb9d7f](https://github.com/groq/groq-typescript/commit/dbb9d7fdf457755f2d8a223e667423634ed18cf5))
25+
* **internal:** codegen related update ([#154](https://github.com/groq/groq-typescript/issues/154)) ([579e30e](https://github.com/groq/groq-typescript/commit/579e30e19daaa9b0aaae2f9d5f268c7983f74376))
26+
* **internal:** codegen related update ([#156](https://github.com/groq/groq-typescript/issues/156)) ([05f714b](https://github.com/groq/groq-typescript/commit/05f714b65c1251938d4d75a25e319a75907cf9d0))
27+
* **internal:** codegen related update ([#158](https://github.com/groq/groq-typescript/issues/158)) ([265305a](https://github.com/groq/groq-typescript/commit/265305a5b3746b357b0bd2fe45080b373f2d1d7a))
28+
* **internal:** fix some typos ([#147](https://github.com/groq/groq-typescript/issues/147)) ([476a620](https://github.com/groq/groq-typescript/commit/476a62017698e9b766d1ac0657e1dbdfd7af0cea))
29+
330
## 0.9.1 (2024-12-12)
431

532
Full Changelog: [v0.9.0...v0.9.1](https://github.com/groq/groq-typescript/compare/v0.9.0...v0.9.1)

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Setting up the environment
22

3-
This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
3+
This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
44
Other package managers may work but are not officially supported for development.
55

66
To set up the repository, run:
@@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can
2929
3030
```
3131

32-
```
33-
chmod +x examples/<your-example>.ts
32+
```sh
33+
$ chmod +x examples/<your-example>.ts
3434
# run the example against your api
35-
yarn tsn -T examples/<your-example>.ts
35+
$ yarn tsn -T examples/<your-example>.ts
3636
```
3737

3838
## Using the repository from source

LICENSE

+1-1
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.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "groq-sdk",
3-
"version": "0.9.1",
3+
"version": "0.10.0",
44
"description": "The official TypeScript library for the Groq API",
55
"author": "Groq <[email protected]>",
66
"types": "dist/index.d.ts",

src/core.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export abstract class APIClient {
177177
maxRetries = 2,
178178
timeout = 60000, // 1 minute
179179
httpAgent,
180-
fetch: overridenFetch,
180+
fetch: overriddenFetch,
181181
}: {
182182
baseURL: string;
183183
maxRetries?: number | undefined;
@@ -190,7 +190,7 @@ export abstract class APIClient {
190190
this.timeout = validatePositiveInteger('timeout', timeout);
191191
this.httpAgent = httpAgent;
192192

193-
this.fetch = overridenFetch ?? fetch;
193+
this.fetch = overriddenFetch ?? fetch;
194194
}
195195

196196
protected authHeaders(opts: FinalRequestOptions): Headers {
@@ -536,9 +536,19 @@ export abstract class APIClient {
536536

537537
const timeout = setTimeout(() => controller.abort(), ms);
538538

539+
const fetchOptions = {
540+
signal: controller.signal as any,
541+
...options,
542+
};
543+
if (fetchOptions.method) {
544+
// Custom methods like 'patch' need to be uppercased
545+
// See https://github.com/nodejs/undici/issues/2294
546+
fetchOptions.method = fetchOptions.method.toUpperCase();
547+
}
548+
539549
return (
540550
// use undefined this binding; fetch errors if bound to something else in browser/cloudflare
541-
this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
551+
this.fetch.call(undefined, url, fetchOptions).finally(() => {
542552
clearTimeout(timeout);
543553
})
544554
);

src/resources/audio/transcriptions.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ export interface TranscriptionCreateParams {
148148

149149
/**
150150
* An optional text to guide the model's style or continue a previous audio
151-
* segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the
152-
* audio language.
151+
* segment. The [prompt](/docs/speech-text) should match the audio language.
153152
*/
154153
prompt?: string;
155154

src/resources/chat/completions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,8 @@ export interface ChatCompletionCreateParamsBase {
762762
*/
763763
seed?: number | null;
764764

765+
service_tier?: 'on_demand' | 'flex' | null;
766+
765767
/**
766768
* Up to 4 sequences where the API will stop generating further tokens. The
767769
* returned text will not contain the stop sequence.

src/version.ts

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

tests/api-resources/chat/completions.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe('resource completions', () => {
3838
presence_penalty: -2,
3939
response_format: { type: 'text' },
4040
seed: 0,
41+
service_tier: 'on_demand',
4142
stop: '\n',
4243
stream: true,
4344
temperature: 1,

tests/index.test.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,19 @@ describe('instantiate client', () => {
122122
expect(spy).toHaveBeenCalledTimes(1);
123123
});
124124

125+
test('normalized method', async () => {
126+
let capturedRequest: RequestInit | undefined;
127+
const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise<Response> => {
128+
capturedRequest = init;
129+
return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } });
130+
};
131+
132+
const client = new Groq({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch });
133+
134+
await client.patch('/foo');
135+
expect(capturedRequest?.method).toEqual('PATCH');
136+
});
137+
125138
describe('baseUrl', () => {
126139
test('trailing slash', () => {
127140
const client = new Groq({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' });
@@ -177,7 +190,7 @@ describe('instantiate client', () => {
177190
expect(client.apiKey).toBe('My API Key');
178191
});
179192

180-
test('with overriden environment variable arguments', () => {
193+
test('with overridden environment variable arguments', () => {
181194
// set options via env var
182195
process.env['GROQ_API_KEY'] = 'another My API Key';
183196
const client = new Groq({ apiKey: 'My API Key' });

0 commit comments

Comments
 (0)