Skip to content

Commit

Permalink
fix: Add support for input audio length header
Browse files Browse the repository at this point in the history
  • Loading branch information
narengogi committed Sep 16, 2024
1 parent 1ba5d89 commit 63a29e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/_types/generalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface ApiClientInterface {
customHost?: string | null | undefined;
openaiProject?: string | null | undefined;
openaiOrganization?: string | null | undefined;
inputAudioLength?: number | null | undefined;
awsSecretAccessKey?: string | null | undefined;
awsAccessKeyId?: string | null | undefined;
awsSessionToken?: string | null | undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/baseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ export abstract class ApiClient {
portkeyHeaders: Record<string, string>

private fetch: Fetch;
constructor({ apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance }: ApiClientInterface) {
constructor({ apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, inputAudioLength, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance }: ApiClientInterface) {
this.apiKey = apiKey ?? "";
this.baseURL = baseURL ?? "";
this.customHeaders = createHeaders({ apiKey, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, cacheNamespace, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, huggingfaceBaseUrl, forwardHeaders, requestTimeout, strictOpenAiCompliance })
this.customHeaders = createHeaders({ apiKey, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, cacheNamespace, openaiProject, openaiOrganization, inputAudioLength, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, huggingfaceBaseUrl, forwardHeaders, requestTimeout, strictOpenAiCompliance })
this.portkeyHeaders = this.defaultHeaders()
this.fetch = fetch;
this.responseHeaders = {}
Expand Down
4 changes: 4 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class Portkey extends ApiClient {
customHost?: string | null | undefined;
openaiProject?: string | null | undefined;
openaiOrganization?: string | null | undefined;
inputAudioLength?: number | null | undefined;
awsSecretAccessKey?: string | null | undefined;
awsAccessKeyId?: string | null | undefined;
awsSessionToken?: string | null | undefined;
Expand Down Expand Up @@ -49,6 +50,7 @@ export class Portkey extends ApiClient {
customHost,
openaiProject,
openaiOrganization,
inputAudioLength,
awsSecretAccessKey,
awsAccessKeyId,
awsSessionToken,
Expand Down Expand Up @@ -81,6 +83,7 @@ export class Portkey extends ApiClient {
cacheNamespace,
openaiProject,
openaiOrganization,
inputAudioLength,
awsSecretAccessKey,
awsAccessKeyId,
awsSessionToken,
Expand Down Expand Up @@ -113,6 +116,7 @@ export class Portkey extends ApiClient {
this.cacheNamespace = cacheNamespace;;
this.openaiProject = openaiProject;
this.openaiOrganization = openaiOrganization;
this.inputAudioLength = inputAudioLength;
this.awsSecretAccessKey = awsSecretAccessKey;
this.awsAccessKeyId = awsAccessKeyId;
this.awsSessionToken = awsSessionToken;
Expand Down

0 comments on commit 63a29e2

Please sign in to comment.