Skip to content

Commit

Permalink
fix: incorrect typing on extra metadata in schema (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeocodes authored Feb 6, 2024
1 parent 9316d91 commit 25111e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 12 additions & 1 deletion src/lib/types/AnalyzeSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
* Options for read analysis
*/
interface AnalyzeSchema extends Record<string, unknown> {
/**
* @see https://developers.deepgram.com/docs/callback
*/
callback?: string;

callback_method?: string;
/**
* @see https://developers.deepgram.com/docs/callback#results
*/
callback_method?: "put" | "post";

custom_intent?: string | string[];

Expand All @@ -23,6 +29,11 @@ interface AnalyzeSchema extends Record<string, unknown> {
sentiment?: boolean;

topics?: boolean;

/**
* @see https://developers.deepgram.com/docs/extra-metadata
*/
extra?: string[] | string;
}

export type { AnalyzeSchema };
6 changes: 3 additions & 3 deletions src/lib/types/TranscriptionSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ interface TranscriptionSchema extends Record<string, unknown> {
/**
* @see https://developers.deepgram.com/docs/callback#results
*/
callback_method?: string;
callback_method?: "put" | "post";

/**
* @see https://developers.deepgram.com/docs/keywords
Expand Down Expand Up @@ -135,9 +135,9 @@ interface TranscriptionSchema extends Record<string, unknown> {
custom_topic_mode?: "strict" | "extended";

/**
* @see https://developers.deepgram.com/docs/extra
* @see https://developers.deepgram.com/docs/extra-metadata
*/
extra?: boolean;
extra?: string[] | string;

[key: string]: unknown;
}
Expand Down

0 comments on commit 25111e9

Please sign in to comment.