Skip to content

Commit b0bc5eb

Browse files
Merge branch 'master' into chore/remove-examples
2 parents 6757c75 + 8554a49 commit b0bc5eb

15 files changed

+85
-54
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-
".": "4.6.0"
2+
".": "4.7.0"
33
}

CHANGELOG.md

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

3+
## 4.7.0 (2023-09-14)
4+
5+
Full Changelog: [v4.6.0...v4.7.0](https://github.com/openai/openai-node/compare/v4.6.0...v4.7.0)
6+
7+
### Features
8+
9+
* **client:** retry on 408 Request Timeout ([#310](https://github.com/openai/openai-node/issues/310)) ([1f98eac](https://github.com/openai/openai-node/commit/1f98eac5be956e56d75ef5456115165b45a4763c))
10+
* make docs urls in comments absolute ([#306](https://github.com/openai/openai-node/issues/306)) ([9db3819](https://github.com/openai/openai-node/commit/9db381961e38d2280b0602447e7d91691b327bde))
11+
312
## 4.6.0 (2023-09-08)
413

514
Full Changelog: [v4.5.0...v4.6.0](https://github.com/openai/openai-node/compare/v4.5.0...v4.6.0)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ See [`@azure/openai`](https://www.npmjs.com/package/@azure/openai) for an Azure-
178178
### Retries
179179

180180
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
181-
Connection errors (for example, due to a network connectivity problem), 409 Conflict, 429 Rate Limit,
182-
and >=500 Internal errors will all be retried by default.
181+
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
182+
429 Rate Limit, and >=500 Internal errors will all be retried by default.
183183

184184
You can use the `maxRetries` option to configure or disable this:
185185

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openai",
3-
"version": "4.6.0",
3+
"version": "4.7.0",
44
"description": "Client library for the OpenAI API",
55
"author": "OpenAI <[email protected]>",
66
"types": "dist/index.d.ts",

src/core.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ export abstract class APIClient {
463463
if (shouldRetryHeader === 'true') return true;
464464
if (shouldRetryHeader === 'false') return false;
465465

466+
// Retry on request timeouts.
467+
if (response.status === 408) return true;
468+
466469
// Retry on lock timeouts.
467470
if (response.status === 409) return true;
468471

src/resources/audio/transcriptions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ export interface TranscriptionCreateParams {
3939

4040
/**
4141
* An optional text to guide the model's style or continue a previous audio
42-
* segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the
43-
* audio language.
42+
* segment. The
43+
* [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
44+
* should match the audio language.
4445
*/
4546
prompt?: string;
4647

src/resources/audio/translations.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ export interface TranslationCreateParams {
3232

3333
/**
3434
* An optional text to guide the model's style or continue a previous audio
35-
* segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in
36-
* English.
35+
* segment. The
36+
* [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
37+
* should be in English.
3738
*/
3839
prompt?: string;
3940

src/resources/chat/completions.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ export interface ChatCompletionCreateParamsBase {
304304

305305
/**
306306
* ID of the model to use. See the
307-
* [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table
308-
* for details on which models work with the Chat API.
307+
* [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility)
308+
* table for details on which models work with the Chat API.
309309
*/
310310
model:
311311
| (string & {})
@@ -326,7 +326,7 @@ export interface ChatCompletionCreateParamsBase {
326326
* existing frequency in the text so far, decreasing the model's likelihood to
327327
* repeat the same line verbatim.
328328
*
329-
* [See more information about frequency and presence penalties.](/docs/guides/gpt/parameter-details)
329+
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/gpt/parameter-details)
330330
*/
331331
frequency_penalty?: number | null;
332332

@@ -377,7 +377,7 @@ export interface ChatCompletionCreateParamsBase {
377377
* whether they appear in the text so far, increasing the model's likelihood to
378378
* talk about new topics.
379379
*
380-
* [See more information about frequency and presence penalties.](/docs/guides/gpt/parameter-details)
380+
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/gpt/parameter-details)
381381
*/
382382
presence_penalty?: number | null;
383383

@@ -416,7 +416,8 @@ export interface ChatCompletionCreateParamsBase {
416416

417417
/**
418418
* A unique identifier representing your end-user, which can help OpenAI to monitor
419-
* and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
419+
* and detect abuse.
420+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
420421
*/
421422
user?: string;
422423
}
@@ -438,7 +439,8 @@ export namespace ChatCompletionCreateParams {
438439

439440
/**
440441
* The parameters the functions accepts, described as a JSON Schema object. See the
441-
* [guide](/docs/guides/gpt/function-calling) for examples, and the
442+
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
443+
* examples, and the
442444
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
443445
* documentation about the format.
444446
*

src/resources/completions.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ export type CompletionCreateParams = CompletionCreateParamsNonStreaming | Comple
117117
export interface CompletionCreateParamsBase {
118118
/**
119119
* ID of the model to use. You can use the
120-
* [List models](/docs/api-reference/models/list) API to see all of your available
121-
* models, or see our [Model overview](/docs/models/overview) for descriptions of
122-
* them.
120+
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
121+
* see all of your available models, or see our
122+
* [Model overview](https://platform.openai.com/docs/models/overview) for
123+
* descriptions of them.
123124
*/
124125
model:
125126
| (string & {})
@@ -166,7 +167,7 @@ export interface CompletionCreateParamsBase {
166167
* existing frequency in the text so far, decreasing the model's likelihood to
167168
* repeat the same line verbatim.
168169
*
169-
* [See more information about frequency and presence penalties.](/docs/guides/gpt/parameter-details)
170+
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/gpt/parameter-details)
170171
*/
171172
frequency_penalty?: number | null;
172173

@@ -221,7 +222,7 @@ export interface CompletionCreateParamsBase {
221222
* whether they appear in the text so far, increasing the model's likelihood to
222223
* talk about new topics.
223224
*
224-
* [See more information about frequency and presence penalties.](/docs/guides/gpt/parameter-details)
225+
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/gpt/parameter-details)
225226
*/
226227
presence_penalty?: number | null;
227228

@@ -266,7 +267,8 @@ export interface CompletionCreateParamsBase {
266267

267268
/**
268269
* A unique identifier representing your end-user, which can help OpenAI to monitor
269-
* and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
270+
* and detect abuse.
271+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
270272
*/
271273
user?: string;
272274
}

src/resources/embeddings.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export namespace CreateEmbeddingResponse {
6161
export interface Embedding {
6262
/**
6363
* The embedding vector, which is a list of floats. The length of vector depends on
64-
* the model as listed in the [embedding guide](/docs/guides/embeddings).
64+
* the model as listed in the
65+
* [embedding guide](https://platform.openai.com/docs/guides/embeddings).
6566
*/
6667
embedding: Array<number>;
6768

@@ -89,15 +90,17 @@ export interface EmbeddingCreateParams {
8990

9091
/**
9192
* ID of the model to use. You can use the
92-
* [List models](/docs/api-reference/models/list) API to see all of your available
93-
* models, or see our [Model overview](/docs/models/overview) for descriptions of
94-
* them.
93+
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
94+
* see all of your available models, or see our
95+
* [Model overview](https://platform.openai.com/docs/models/overview) for
96+
* descriptions of them.
9597
*/
9698
model: (string & {}) | 'text-embedding-ada-002';
9799

98100
/**
99101
* A unique identifier representing your end-user, which can help OpenAI to monitor
100-
* and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
102+
* and detect abuse.
103+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
101104
*/
102105
user?: string;
103106
}

0 commit comments

Comments
 (0)