@deepgram/sdk
Advanced tools
Comparing version 3.5.1 to 3.6.0
@@ -1,2 +0,2 @@ | ||
import { AbstractClient, ListenClient, ManageClient, ReadClient, OnPremClient, SelfHostedRestClient, SpeakClient } from "./packages"; | ||
import { AbstractClient, ListenClient, ManageClient, ReadClient, OnPremClient, SelfHostedRestClient, SpeakClient, ModelsRestClient } from "./packages"; | ||
/** | ||
@@ -21,2 +21,8 @@ * The DeepgramClient class provides access to various Deepgram API clients, including ListenClient, ManageClient, SelfHostedRestClient, ReadClient, and SpeakClient. | ||
/** | ||
* Returns a new instance of the ModelsRestClient, which provides access to the Deepgram API's model functionality. | ||
* | ||
* @returns {ModelsRestClient} A new instance of the ModelsRestClient. | ||
*/ | ||
get models(): ModelsRestClient; | ||
/** | ||
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality. | ||
@@ -23,0 +29,0 @@ * |
@@ -28,2 +28,10 @@ "use strict"; | ||
/** | ||
* Returns a new instance of the ModelsRestClient, which provides access to the Deepgram API's model functionality. | ||
* | ||
* @returns {ModelsRestClient} A new instance of the ModelsRestClient. | ||
*/ | ||
get models() { | ||
return new packages_1.ModelsRestClient(this.options); | ||
} | ||
/** | ||
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality. | ||
@@ -30,0 +38,0 @@ * |
@@ -11,2 +11,4 @@ export * from "./AnalyzeSchema"; | ||
export * from "./Fetch"; | ||
export * from "./GetModelsResponse"; | ||
export * from "./GetModelsSchema"; | ||
export * from "./GetProjectBalancesResponse"; | ||
@@ -13,0 +15,0 @@ export * from "./GetProjectInvitesResponse"; |
@@ -27,2 +27,4 @@ "use strict"; | ||
__exportStar(require("./Fetch"), exports); | ||
__exportStar(require("./GetModelsResponse"), exports); | ||
__exportStar(require("./GetModelsSchema"), exports); | ||
__exportStar(require("./GetProjectBalancesResponse"), exports); | ||
@@ -29,0 +31,0 @@ __exportStar(require("./GetProjectInvitesResponse"), exports); |
@@ -1,2 +0,2 @@ | ||
export declare const version = "3.5.1"; | ||
export declare const version = "3.6.0"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = "3.5.1"; | ||
exports.version = "3.6.0"; | ||
//# sourceMappingURL=version.js.map |
@@ -8,2 +8,3 @@ export * from "./AbstractClient"; | ||
export * from "./ManageRestClient"; | ||
export * from "./ModelsRestClient"; | ||
export * from "./ReadRestClient"; | ||
@@ -10,0 +11,0 @@ export * from "./SelfHostedRestClient"; |
@@ -24,2 +24,3 @@ "use strict"; | ||
__exportStar(require("./ManageRestClient"), exports); | ||
__exportStar(require("./ModelsRestClient"), exports); | ||
__exportStar(require("./ReadRestClient"), exports); | ||
@@ -26,0 +27,0 @@ __exportStar(require("./SelfHostedRestClient"), exports); |
@@ -1,2 +0,2 @@ | ||
import type { CreateProjectKeySchema, CreateProjectKeyResponse, DeepgramResponse, GetProjectBalanceResponse, GetProjectBalancesResponse, GetProjectInvitesResponse, GetProjectKeyResponse, GetProjectKeysResponse, GetProjectMemberScopesResponse, GetProjectMembersResponse, GetProjectResponse, GetProjectsResponse, GetProjectUsageFieldsSchema, GetProjectUsageFieldsResponse, GetProjectUsageRequestResponse, GetProjectUsageRequestsSchema, GetProjectUsageRequestsResponse, GetProjectUsageSummarySchema, GetProjectUsageSummaryResponse, MessageResponse, SendProjectInviteSchema, UpdateProjectMemberScopeSchema, UpdateProjectSchema, VoidResponse, GetTokenDetailsResponse } from "../lib/types"; | ||
import type { CreateProjectKeySchema, CreateProjectKeyResponse, DeepgramResponse, GetProjectBalanceResponse, GetProjectBalancesResponse, GetProjectInvitesResponse, GetProjectKeyResponse, GetProjectKeysResponse, GetProjectMemberScopesResponse, GetProjectMembersResponse, GetProjectResponse, GetProjectsResponse, GetProjectUsageFieldsSchema, GetProjectUsageFieldsResponse, GetProjectUsageRequestResponse, GetProjectUsageRequestsSchema, GetProjectUsageRequestsResponse, GetProjectUsageSummarySchema, GetProjectUsageSummaryResponse, MessageResponse, SendProjectInviteSchema, UpdateProjectMemberScopeSchema, UpdateProjectSchema, VoidResponse, GetTokenDetailsResponse, GetModelsResponse, GetModelResponse, GetModelsSchema } from "../lib/types"; | ||
import { AbstractRestClient } from "./AbstractRestClient"; | ||
@@ -284,4 +284,47 @@ /** | ||
getProjectBalance(projectId: string, balanceId: string, endpoint?: string): Promise<DeepgramResponse<GetProjectBalanceResponse>>; | ||
/** | ||
* Retrieves all models for a given project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param endpoint - (optional) The endpoint URL for retrieving models. Defaults to ":version/projects/:projectId/models". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelsResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: models, error } = deepgram.manage.getAllModels("projectId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(models); | ||
* } | ||
* ``` | ||
*/ | ||
getAllModels(projectId: string, options?: GetModelsSchema, endpoint?: string): Promise<DeepgramResponse<GetModelsResponse>>; | ||
/** | ||
* Retrieves a model from the specified project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param modelId - The ID of the model. | ||
* @param endpoint - (optional) The endpoint URL for the request. Default value is ":version/projects/:projectId/models/:modelId". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: model, error } = deepgram.models.getModel("projectId", "modelId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(model); | ||
* } | ||
* ``` | ||
*/ | ||
getModel(projectId: string, modelId: string, endpoint?: string): Promise<DeepgramResponse<GetModelResponse>>; | ||
} | ||
export { ManageRestClient as ManageClient }; | ||
//# sourceMappingURL=ManageRestClient.d.ts.map |
@@ -625,2 +625,73 @@ "use strict"; | ||
} | ||
/** | ||
* Retrieves all models for a given project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param endpoint - (optional) The endpoint URL for retrieving models. Defaults to ":version/projects/:projectId/models". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelsResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: models, error } = deepgram.manage.getAllModels("projectId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(models); | ||
* } | ||
* ``` | ||
*/ | ||
getAllModels(projectId, options = {}, endpoint = ":version/projects/:projectId/models") { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const requestUrl = this.getRequestUrl(endpoint, { projectId }, options); | ||
const result = yield this.get(requestUrl).then((result) => result.json()); | ||
return { result, error: null }; | ||
} | ||
catch (error) { | ||
if ((0, errors_1.isDeepgramError)(error)) { | ||
return { result: null, error }; | ||
} | ||
throw error; | ||
} | ||
}); | ||
} | ||
/** | ||
* Retrieves a model from the specified project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param modelId - The ID of the model. | ||
* @param endpoint - (optional) The endpoint URL for the request. Default value is ":version/projects/:projectId/models/:modelId". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: model, error } = deepgram.models.getModel("projectId", "modelId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(model); | ||
* } | ||
* ``` | ||
*/ | ||
getModel(projectId, modelId, endpoint = ":version/projects/:projectId/models/:modelId") { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const requestUrl = this.getRequestUrl(endpoint, { projectId, modelId }); | ||
const result = yield this.get(requestUrl).then((result) => result.json()); | ||
return { result, error: null }; | ||
} | ||
catch (error) { | ||
if ((0, errors_1.isDeepgramError)(error)) { | ||
return { result: null, error }; | ||
} | ||
throw error; | ||
} | ||
}); | ||
} | ||
} | ||
@@ -627,0 +698,0 @@ exports.ManageRestClient = ManageRestClient; |
@@ -1,2 +0,2 @@ | ||
import { AbstractClient, ListenClient, ManageClient, ReadClient, OnPremClient, SelfHostedRestClient, SpeakClient } from "./packages"; | ||
import { AbstractClient, ListenClient, ManageClient, ReadClient, OnPremClient, SelfHostedRestClient, SpeakClient, ModelsRestClient } from "./packages"; | ||
/** | ||
@@ -21,2 +21,8 @@ * The DeepgramClient class provides access to various Deepgram API clients, including ListenClient, ManageClient, SelfHostedRestClient, ReadClient, and SpeakClient. | ||
/** | ||
* Returns a new instance of the ModelsRestClient, which provides access to the Deepgram API's model functionality. | ||
* | ||
* @returns {ModelsRestClient} A new instance of the ModelsRestClient. | ||
*/ | ||
get models(): ModelsRestClient; | ||
/** | ||
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality. | ||
@@ -23,0 +29,0 @@ * |
import { DeepgramVersionError } from "./lib/errors"; | ||
import { AbstractClient, ListenClient, ManageClient, ReadClient, SelfHostedRestClient, SpeakClient, } from "./packages"; | ||
import { AbstractClient, ListenClient, ManageClient, ReadClient, SelfHostedRestClient, SpeakClient, ModelsRestClient, } from "./packages"; | ||
/** | ||
@@ -26,2 +26,10 @@ * The DeepgramClient class provides access to various Deepgram API clients, including ListenClient, ManageClient, SelfHostedRestClient, ReadClient, and SpeakClient. | ||
/** | ||
* Returns a new instance of the ModelsRestClient, which provides access to the Deepgram API's model functionality. | ||
* | ||
* @returns {ModelsRestClient} A new instance of the ModelsRestClient. | ||
*/ | ||
get models() { | ||
return new ModelsRestClient(this.options); | ||
} | ||
/** | ||
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality. | ||
@@ -28,0 +36,0 @@ * |
@@ -11,2 +11,4 @@ export * from "./AnalyzeSchema"; | ||
export * from "./Fetch"; | ||
export * from "./GetModelsResponse"; | ||
export * from "./GetModelsSchema"; | ||
export * from "./GetProjectBalancesResponse"; | ||
@@ -13,0 +15,0 @@ export * from "./GetProjectInvitesResponse"; |
@@ -11,2 +11,4 @@ export * from "./AnalyzeSchema"; | ||
export * from "./Fetch"; | ||
export * from "./GetModelsResponse"; | ||
export * from "./GetModelsSchema"; | ||
export * from "./GetProjectBalancesResponse"; | ||
@@ -13,0 +15,0 @@ export * from "./GetProjectInvitesResponse"; |
@@ -1,2 +0,2 @@ | ||
export declare const version = "3.5.1"; | ||
export declare const version = "3.6.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export const version = "3.5.1"; | ||
export const version = "3.6.0"; | ||
//# sourceMappingURL=version.js.map |
@@ -8,2 +8,3 @@ export * from "./AbstractClient"; | ||
export * from "./ManageRestClient"; | ||
export * from "./ModelsRestClient"; | ||
export * from "./ReadRestClient"; | ||
@@ -10,0 +11,0 @@ export * from "./SelfHostedRestClient"; |
@@ -8,2 +8,3 @@ export * from "./AbstractClient"; | ||
export * from "./ManageRestClient"; | ||
export * from "./ModelsRestClient"; | ||
export * from "./ReadRestClient"; | ||
@@ -10,0 +11,0 @@ export * from "./SelfHostedRestClient"; |
@@ -1,2 +0,2 @@ | ||
import type { CreateProjectKeySchema, CreateProjectKeyResponse, DeepgramResponse, GetProjectBalanceResponse, GetProjectBalancesResponse, GetProjectInvitesResponse, GetProjectKeyResponse, GetProjectKeysResponse, GetProjectMemberScopesResponse, GetProjectMembersResponse, GetProjectResponse, GetProjectsResponse, GetProjectUsageFieldsSchema, GetProjectUsageFieldsResponse, GetProjectUsageRequestResponse, GetProjectUsageRequestsSchema, GetProjectUsageRequestsResponse, GetProjectUsageSummarySchema, GetProjectUsageSummaryResponse, MessageResponse, SendProjectInviteSchema, UpdateProjectMemberScopeSchema, UpdateProjectSchema, VoidResponse, GetTokenDetailsResponse } from "../lib/types"; | ||
import type { CreateProjectKeySchema, CreateProjectKeyResponse, DeepgramResponse, GetProjectBalanceResponse, GetProjectBalancesResponse, GetProjectInvitesResponse, GetProjectKeyResponse, GetProjectKeysResponse, GetProjectMemberScopesResponse, GetProjectMembersResponse, GetProjectResponse, GetProjectsResponse, GetProjectUsageFieldsSchema, GetProjectUsageFieldsResponse, GetProjectUsageRequestResponse, GetProjectUsageRequestsSchema, GetProjectUsageRequestsResponse, GetProjectUsageSummarySchema, GetProjectUsageSummaryResponse, MessageResponse, SendProjectInviteSchema, UpdateProjectMemberScopeSchema, UpdateProjectSchema, VoidResponse, GetTokenDetailsResponse, GetModelsResponse, GetModelResponse, GetModelsSchema } from "../lib/types"; | ||
import { AbstractRestClient } from "./AbstractRestClient"; | ||
@@ -284,4 +284,47 @@ /** | ||
getProjectBalance(projectId: string, balanceId: string, endpoint?: string): Promise<DeepgramResponse<GetProjectBalanceResponse>>; | ||
/** | ||
* Retrieves all models for a given project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param endpoint - (optional) The endpoint URL for retrieving models. Defaults to ":version/projects/:projectId/models". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelsResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: models, error } = deepgram.manage.getAllModels("projectId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(models); | ||
* } | ||
* ``` | ||
*/ | ||
getAllModels(projectId: string, options?: GetModelsSchema, endpoint?: string): Promise<DeepgramResponse<GetModelsResponse>>; | ||
/** | ||
* Retrieves a model from the specified project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param modelId - The ID of the model. | ||
* @param endpoint - (optional) The endpoint URL for the request. Default value is ":version/projects/:projectId/models/:modelId". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: model, error } = deepgram.models.getModel("projectId", "modelId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(model); | ||
* } | ||
* ``` | ||
*/ | ||
getModel(projectId: string, modelId: string, endpoint?: string): Promise<DeepgramResponse<GetModelResponse>>; | ||
} | ||
export { ManageRestClient as ManageClient }; | ||
//# sourceMappingURL=ManageRestClient.d.ts.map |
@@ -622,4 +622,75 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
/** | ||
* Retrieves all models for a given project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param endpoint - (optional) The endpoint URL for retrieving models. Defaults to ":version/projects/:projectId/models". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelsResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: models, error } = deepgram.manage.getAllModels("projectId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(models); | ||
* } | ||
* ``` | ||
*/ | ||
getAllModels(projectId, options = {}, endpoint = ":version/projects/:projectId/models") { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const requestUrl = this.getRequestUrl(endpoint, { projectId }, options); | ||
const result = yield this.get(requestUrl).then((result) => result.json()); | ||
return { result, error: null }; | ||
} | ||
catch (error) { | ||
if (isDeepgramError(error)) { | ||
return { result: null, error }; | ||
} | ||
throw error; | ||
} | ||
}); | ||
} | ||
/** | ||
* Retrieves a model from the specified project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param modelId - The ID of the model. | ||
* @param endpoint - (optional) The endpoint URL for the request. Default value is ":version/projects/:projectId/models/:modelId". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: model, error } = deepgram.models.getModel("projectId", "modelId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(model); | ||
* } | ||
* ``` | ||
*/ | ||
getModel(projectId, modelId, endpoint = ":version/projects/:projectId/models/:modelId") { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const requestUrl = this.getRequestUrl(endpoint, { projectId, modelId }); | ||
const result = yield this.get(requestUrl).then((result) => result.json()); | ||
return { result, error: null }; | ||
} | ||
catch (error) { | ||
if (isDeepgramError(error)) { | ||
return { result: null, error }; | ||
} | ||
throw error; | ||
} | ||
}); | ||
} | ||
} | ||
export { ManageRestClient as ManageClient }; | ||
//# sourceMappingURL=ManageRestClient.js.map |
{ | ||
"name": "@deepgram/sdk", | ||
"version": "3.5.1", | ||
"version": "3.6.0", | ||
"description": "Isomorphic Javascript client for Deepgram", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -10,2 +10,3 @@ import { DeepgramVersionError } from "./lib/errors"; | ||
SpeakClient, | ||
ModelsRestClient, | ||
} from "./packages"; | ||
@@ -38,2 +39,11 @@ | ||
/** | ||
* Returns a new instance of the ModelsRestClient, which provides access to the Deepgram API's model functionality. | ||
* | ||
* @returns {ModelsRestClient} A new instance of the ModelsRestClient. | ||
*/ | ||
get models(): ModelsRestClient { | ||
return new ModelsRestClient(this.options); | ||
} | ||
/** | ||
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality. | ||
@@ -40,0 +50,0 @@ * |
@@ -11,2 +11,4 @@ export * from "./AnalyzeSchema"; | ||
export * from "./Fetch"; | ||
export * from "./GetModelsResponse"; | ||
export * from "./GetModelsSchema"; | ||
export * from "./GetProjectBalancesResponse"; | ||
@@ -13,0 +15,0 @@ export * from "./GetProjectInvitesResponse"; |
@@ -1,1 +0,1 @@ | ||
export const version = "3.5.1"; | ||
export const version = "3.6.0"; |
@@ -8,4 +8,5 @@ export * from "./AbstractClient"; | ||
export * from "./ManageRestClient"; | ||
export * from "./ModelsRestClient"; | ||
export * from "./ReadRestClient"; | ||
export * from "./SelfHostedRestClient"; | ||
export * from "./SpeakRestClient"; |
@@ -28,2 +28,5 @@ import { isDeepgramError } from "../lib/errors"; | ||
GetTokenDetailsResponse, | ||
GetModelsResponse, | ||
GetModelResponse, | ||
GetModelsSchema, | ||
} from "../lib/types"; | ||
@@ -759,4 +762,83 @@ import { AbstractRestClient } from "./AbstractRestClient"; | ||
} | ||
/** | ||
* Retrieves all models for a given project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param endpoint - (optional) The endpoint URL for retrieving models. Defaults to ":version/projects/:projectId/models". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelsResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: models, error } = deepgram.manage.getAllModels("projectId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(models); | ||
* } | ||
* ``` | ||
*/ | ||
async getAllModels( | ||
projectId: string, | ||
options: GetModelsSchema = {}, | ||
endpoint = ":version/projects/:projectId/models" | ||
): Promise<DeepgramResponse<GetModelsResponse>> { | ||
try { | ||
const requestUrl = this.getRequestUrl(endpoint, { projectId }, options); | ||
const result: GetModelsResponse = await this.get(requestUrl).then((result) => result.json()); | ||
return { result, error: null }; | ||
} catch (error) { | ||
if (isDeepgramError(error)) { | ||
return { result: null, error }; | ||
} | ||
throw error; | ||
} | ||
} | ||
/** | ||
* Retrieves a model from the specified project. | ||
* | ||
* @param projectId - The ID of the project. | ||
* @param modelId - The ID of the model. | ||
* @param endpoint - (optional) The endpoint URL for the request. Default value is ":version/projects/:projectId/models/:modelId". | ||
* @returns A promise that resolves to a DeepgramResponse containing the GetModelResponse. | ||
* @example | ||
* ```typescript | ||
* import { createClient } from "@deepgram/sdk"; | ||
* | ||
* const deepgram = createClient(DEEPGRAM_API_KEY); | ||
* const { result: model, error } = deepgram.models.getModel("projectId", "modelId"); | ||
* | ||
* if (error) { | ||
* console.error(error); | ||
* } else { | ||
* console.log(model); | ||
* } | ||
* ``` | ||
*/ | ||
async getModel( | ||
projectId: string, | ||
modelId: string, | ||
endpoint = ":version/projects/:projectId/models/:modelId" | ||
): Promise<DeepgramResponse<GetModelResponse>> { | ||
try { | ||
const requestUrl = this.getRequestUrl(endpoint, { projectId, modelId }); | ||
const result: GetModelResponse = await this.get(requestUrl).then((result) => result.json()); | ||
return { result, error: null }; | ||
} catch (error) { | ||
if (isDeepgramError(error)) { | ||
return { result: null, error }; | ||
} | ||
throw error; | ||
} | ||
} | ||
} | ||
export { ManageRestClient as ManageClient }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
864232
580
13534