Skip to content

Commit c21ef88

Browse files
committed
chore(api): update docs (#703)
1 parent 18d9cb7 commit c21ef88

File tree

7 files changed

+39
-26
lines changed

7 files changed

+39
-26
lines changed

src/resources/audio/speech.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@ export interface SpeechCreateParams {
3535
voice: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
3636

3737
/**
38-
* The format to return audio in. Supported formats are `mp3`, `opus`, `aac`,
39-
* `flac`, `pcm`, and `wav`.
40-
*
41-
* The `pcm` audio format, similar to `wav` but without a header, utilizes a 24kHz
42-
* sample rate, mono channel, and 16-bit depth in signed little-endian format.
38+
* The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,
39+
* `wav`, and `pcm`.
4340
*/
44-
response_format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'pcm' | 'wav';
41+
response_format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm';
4542

4643
/**
4744
* The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is

src/resources/audio/transcriptions.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ export class Transcriptions extends APIResource {
1414
}
1515
}
1616

17+
/**
18+
* Represents a transcription response returned by model, based on the provided
19+
* input.
20+
*/
1721
export interface Transcription {
22+
/**
23+
* The transcribed text.
24+
*/
1825
text: string;
1926
}
2027

@@ -26,7 +33,8 @@ export interface TranscriptionCreateParams {
2633
file: Uploadable;
2734

2835
/**
29-
* ID of the model to use. Only `whisper-1` is currently available.
36+
* ID of the model to use. Only `whisper-1` (which is powered by our open source
37+
* Whisper V2 model) is currently available.
3038
*/
3139
model: (string & {}) | 'whisper-1';
3240

@@ -61,9 +69,11 @@ export interface TranscriptionCreateParams {
6169
temperature?: number;
6270

6371
/**
64-
* The timestamp granularities to populate for this transcription. Any of these
65-
* options: `word`, or `segment`. Note: There is no additional latency for segment
66-
* timestamps, but generating word timestamps incurs additional latency.
72+
* The timestamp granularities to populate for this transcription.
73+
* `response_format` must be set `verbose_json` to use timestamp granularities.
74+
* Either or both of these options are supported: `word`, or `segment`. Note: There
75+
* is no additional latency for segment timestamps, but generating word timestamps
76+
* incurs additional latency.
6777
*/
6878
timestamp_granularities?: Array<'word' | 'segment'>;
6979
}

src/resources/audio/translations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export interface TranslationCreateParams {
2626
file: Uploadable;
2727

2828
/**
29-
* ID of the model to use. Only `whisper-1` is currently available.
29+
* ID of the model to use. Only `whisper-1` (which is powered by our open source
30+
* Whisper V2 model) is currently available.
3031
*/
3132
model: (string & {}) | 'whisper-1';
3233

src/resources/beta/threads/runs/runs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ export namespace Run {
270270
*/
271271
export interface LastError {
272272
/**
273-
* One of `server_error` or `rate_limit_exceeded`.
273+
* One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.
274274
*/
275-
code: 'server_error' | 'rate_limit_exceeded';
275+
code: 'server_error' | 'rate_limit_exceeded' | 'invalid_prompt';
276276

277277
/**
278278
* A human-readable description of the error.

src/resources/chat/completions.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,9 @@ export interface ChatCompletionTokenLogprob {
546546
bytes: Array<number> | null;
547547

548548
/**
549-
* The log probability of this token.
549+
* The log probability of this token, if it is within the top 20 most likely
550+
* tokens. Otherwise, the value `-9999.0` is used to signify that the token is very
551+
* unlikely.
550552
*/
551553
logprob: number;
552554

@@ -574,7 +576,9 @@ export namespace ChatCompletionTokenLogprob {
574576
bytes: Array<number> | null;
575577

576578
/**
577-
* The log probability of this token.
579+
* The log probability of this token, if it is within the top 20 most likely
580+
* tokens. Otherwise, the value `-9999.0` is used to signify that the token is very
581+
* unlikely.
578582
*/
579583
logprob: number;
580584
}
@@ -827,9 +831,9 @@ export interface ChatCompletionCreateParamsBase {
827831
tools?: Array<ChatCompletionTool>;
828832

829833
/**
830-
* An integer between 0 and 5 specifying the number of most likely tokens to return
831-
* at each token position, each with an associated log probability. `logprobs` must
832-
* be set to `true` if this parameter is used.
834+
* An integer between 0 and 20 specifying the number of most likely tokens to
835+
* return at each token position, each with an associated log probability.
836+
* `logprobs` must be set to `true` if this parameter is used.
833837
*/
834838
top_logprobs?: number | null;
835839

src/resources/images.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export interface ImageCreateVariationParams {
8080

8181
/**
8282
* The format in which the generated images are returned. Must be one of `url` or
83-
* `b64_json`.
83+
* `b64_json`. URLs are only valid for 60 minutes after the image has been
84+
* generated.
8485
*/
8586
response_format?: 'url' | 'b64_json' | null;
8687

@@ -131,7 +132,8 @@ export interface ImageEditParams {
131132

132133
/**
133134
* The format in which the generated images are returned. Must be one of `url` or
134-
* `b64_json`.
135+
* `b64_json`. URLs are only valid for 60 minutes after the image has been
136+
* generated.
135137
*/
136138
response_format?: 'url' | 'b64_json' | null;
137139

@@ -176,7 +178,8 @@ export interface ImageGenerateParams {
176178

177179
/**
178180
* The format in which the generated images are returned. Must be one of `url` or
179-
* `b64_json`.
181+
* `b64_json`. URLs are only valid for 60 minutes after the image has been
182+
* generated.
180183
*/
181184
response_format?: 'url' | 'b64_json' | null;
182185

src/resources/moderations.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as ModerationsAPI from 'openai/resources/moderations';
66

77
export class Moderations extends APIResource {
88
/**
9-
* Classifies if text violates OpenAI's Content Policy
9+
* Classifies if text is potentially harmful.
1010
*/
1111
create(
1212
body: ModerationCreateParams,
@@ -28,8 +28,7 @@ export interface Moderation {
2828
category_scores: Moderation.CategoryScores;
2929

3030
/**
31-
* Whether the content violates
32-
* [OpenAI's usage policies](/policies/usage-policies).
31+
* Whether any of the below categories are flagged.
3332
*/
3433
flagged: boolean;
3534
}
@@ -170,8 +169,7 @@ export namespace Moderation {
170169
}
171170

172171
/**
173-
* Represents policy compliance report by OpenAI's content moderation model against
174-
* a given input.
172+
* Represents if a given text input is potentially harmful.
175173
*/
176174
export interface ModerationCreateResponse {
177175
/**

0 commit comments

Comments
 (0)