New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

portkey-ai

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

portkey-ai - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

2

dist/package.json
{
"name": "portkey-ai",
"version": "1.6.0",
"version": "1.6.1",
"description": "Node client library for the Portkey API",

@@ -5,0 +5,0 @@ "types": "./src/index.d.ts",

@@ -35,2 +35,3 @@ export type Headers = Record<string, string | null | undefined>;

mistralFimCompletion?: string | null | undefined;
[key: string]: any;
}

@@ -37,0 +38,0 @@ export interface APIResponseType {

@@ -36,2 +36,3 @@ export type Headers = Record<string, string | null | undefined>;

mistralFimCompletion?: string | null | undefined;
[key: string]: any;
}

@@ -38,0 +39,0 @@

@@ -7,2 +7,11 @@ "use strict";

const headers = {};
let forwardHeaders = [];
if (config['forwardHeaders']) {
// logic to convert forwardHeaders values to kebab-case
forwardHeaders = config['forwardHeaders'].map((header) => {
return header
.replace('ID', 'Id')
.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
});
}
for (let k in config) {

@@ -31,3 +40,8 @@ let v = config[k];

}
headers[(0, utils_1.getPortkeyHeader)(k)] = v || '';
if (forwardHeaders && forwardHeaders.includes(k)) {
headers[k] = v || '';
}
else {
headers[(0, utils_1.getPortkeyHeader)(k)] = v || '';
}
}

@@ -34,0 +48,0 @@ return headers;

@@ -7,3 +7,13 @@ import { getPortkeyHeader, isEmpty } from '../utils';

const headers: Record<string, string> = {};
let forwardHeaders: string[] = [];
if (config['forwardHeaders']) {
// logic to convert forwardHeaders values to kebab-case
forwardHeaders = config['forwardHeaders'].map((header: string) => {
return header
.replace('ID', 'Id')
.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
});
}
for (let k in config) {

@@ -35,5 +45,9 @@ let v = config[k];

}
headers[getPortkeyHeader(k)] = v || '';
if (forwardHeaders && forwardHeaders.includes(k)) {
headers[k] = v || '';
} else {
headers[getPortkeyHeader(k)] = v || '';
}
}
return headers;
};

@@ -43,3 +43,3 @@ /// <reference types="node" />

private 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, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, }: ApiClientInterface);
constructor({ apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, ...rest }: ApiClientInterface);
protected defaultHeaders(): Record<string, string>;

@@ -46,0 +46,0 @@ _post<Rsp extends APIResponseType>(path: string, opts?: RequestOptions): APIPromise<Rsp>;

@@ -11,2 +11,13 @@ "use strict";

};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -83,7 +94,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

class ApiClient {
constructor({ apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance = false, anthropicBeta, anthropicVersion, mistralFimCompletion, }) {
constructor(_a) {
var { apiKey, baseURL, config, virtualKey, traceID, metadata, provider, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance = false, anthropicBeta, anthropicVersion, mistralFimCompletion } = _a, rest = __rest(_a, ["apiKey", "baseURL", "config", "virtualKey", "traceID", "metadata", "provider", "Authorization", "cacheForceRefresh", "debug", "customHost", "openaiProject", "openaiOrganization", "awsSecretAccessKey", "awsAccessKeyId", "awsSessionToken", "awsRegion", "vertexProjectId", "vertexRegion", "workersAiAccountId", "azureResourceName", "azureDeploymentId", "azureApiVersion", "azureEndpointName", "huggingfaceBaseUrl", "forwardHeaders", "cacheNamespace", "requestTimeout", "strictOpenAiCompliance", "anthropicBeta", "anthropicVersion", "mistralFimCompletion"]);
this.apiKey = apiKey !== null && apiKey !== void 0 ? apiKey : '';
this.baseURL = baseURL !== null && baseURL !== void 0 ? baseURL : '';
this.customHeaders = (0, apis_1.createHeaders)({
apiKey,
this.customHeaders = (0, apis_1.createHeaders)(Object.assign({ apiKey,
config,

@@ -118,4 +129,3 @@ virtualKey,

mistralFimCompletion,
anthropicBeta,
});
anthropicBeta }, rest));
this.portkeyHeaders = this.defaultHeaders();

@@ -122,0 +132,0 @@ this.fetch = fetch;

@@ -173,2 +173,3 @@ import KeepAliveAgent from 'agentkeepalive';

mistralFimCompletion,
...rest
}: ApiClientInterface) {

@@ -209,2 +210,3 @@ this.apiKey = apiKey ?? '';

anthropicBeta,
...rest,
});

@@ -211,0 +213,0 @@ this.portkeyHeaders = this.defaultHeaders();

@@ -39,3 +39,3 @@ import { ApiClientInterface } from './_types/generalTypes';

mistralFimCompletion?: string | null | undefined;
constructor({ apiKey, baseURL, config, virtualKey, provider, traceID, metadata, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, }: ApiClientInterface);
constructor({ apiKey, baseURL, config, virtualKey, provider, traceID, metadata, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, ...rest }: ApiClientInterface);
completions: API.Completions;

@@ -42,0 +42,0 @@ chat: API.Chat;

@@ -25,2 +25,13 @@ "use strict";

};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -34,5 +45,4 @@ exports.Portkey = void 0;

var _b, _c;
var { apiKey = (_b = (0, utils_1.readEnv)('PORTKEY_API_KEY')) !== null && _b !== void 0 ? _b : null, baseURL = (_c = (0, utils_1.readEnv)('PORTKEY_BASE_URL')) !== null && _c !== void 0 ? _c : null, config, virtualKey, provider, traceID, metadata, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion, } = _a;
super({
apiKey,
var { apiKey = (_b = (0, utils_1.readEnv)('PORTKEY_API_KEY')) !== null && _b !== void 0 ? _b : null, baseURL = (_c = (0, utils_1.readEnv)('PORTKEY_BASE_URL')) !== null && _c !== void 0 ? _c : null, config, virtualKey, provider, traceID, metadata, Authorization, cacheForceRefresh, debug, customHost, openaiProject, openaiOrganization, awsSecretAccessKey, awsAccessKeyId, awsSessionToken, awsRegion, vertexProjectId, vertexRegion, workersAiAccountId, azureResourceName, azureDeploymentId, azureApiVersion, azureEndpointName, huggingfaceBaseUrl, forwardHeaders, cacheNamespace, requestTimeout, strictOpenAiCompliance, anthropicBeta, anthropicVersion, mistralFimCompletion } = _a, rest = __rest(_a, ["apiKey", "baseURL", "config", "virtualKey", "provider", "traceID", "metadata", "Authorization", "cacheForceRefresh", "debug", "customHost", "openaiProject", "openaiOrganization", "awsSecretAccessKey", "awsAccessKeyId", "awsSessionToken", "awsRegion", "vertexProjectId", "vertexRegion", "workersAiAccountId", "azureResourceName", "azureDeploymentId", "azureApiVersion", "azureEndpointName", "huggingfaceBaseUrl", "forwardHeaders", "cacheNamespace", "requestTimeout", "strictOpenAiCompliance", "anthropicBeta", "anthropicVersion", "mistralFimCompletion"]);
super(Object.assign({ apiKey,
baseURL,

@@ -68,4 +78,3 @@ config,

anthropicVersion,
mistralFimCompletion,
});
mistralFimCompletion }, rest));
this.completions = new API.Completions(this);

@@ -72,0 +81,0 @@ this.chat = new API.Chat(this);

@@ -74,2 +74,3 @@ import { ApiClientInterface } from './_types/generalTypes';

mistralFimCompletion,
...rest
}: ApiClientInterface) {

@@ -109,2 +110,3 @@ super({

mistralFimCompletion,
...rest,
});

@@ -111,0 +113,0 @@ this.baseURL = setBaseURL(baseURL, apiKey);

@@ -1,1 +0,1 @@

export declare const VERSION = "1.6.0";
export declare const VERSION = "1.6.1";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '1.6.0';
exports.VERSION = '1.6.1';
//# sourceMappingURL=version.js.map

@@ -1,1 +0,1 @@

export const VERSION = '1.6.0';
export const VERSION = '1.6.1';
{
"name": "portkey-ai",
"version": "1.6.0",
"version": "1.6.1",
"description": "Node client library for the Portkey API",

@@ -5,0 +5,0 @@ "types": "dist/src/index.d.ts",

@@ -36,2 +36,3 @@ export type Headers = Record<string, string | null | undefined>;

mistralFimCompletion?: string | null | undefined;
[key: string]: any;
}

@@ -38,0 +39,0 @@

@@ -7,3 +7,13 @@ import { getPortkeyHeader, isEmpty } from '../utils';

const headers: Record<string, string> = {};
let forwardHeaders: string[] = [];
if (config['forwardHeaders']) {
// logic to convert forwardHeaders values to kebab-case
forwardHeaders = config['forwardHeaders'].map((header: string) => {
return header
.replace('ID', 'Id')
.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
});
}
for (let k in config) {

@@ -35,5 +45,9 @@ let v = config[k];

}
headers[getPortkeyHeader(k)] = v || '';
if (forwardHeaders && forwardHeaders.includes(k)) {
headers[k] = v || '';
} else {
headers[getPortkeyHeader(k)] = v || '';
}
}
return headers;
};

@@ -173,2 +173,3 @@ import KeepAliveAgent from 'agentkeepalive';

mistralFimCompletion,
...rest
}: ApiClientInterface) {

@@ -209,2 +210,3 @@ this.apiKey = apiKey ?? '';

anthropicBeta,
...rest,
});

@@ -211,0 +213,0 @@ this.portkeyHeaders = this.defaultHeaders();

@@ -74,2 +74,3 @@ import { ApiClientInterface } from './_types/generalTypes';

mistralFimCompletion,
...rest
}: ApiClientInterface) {

@@ -109,2 +110,3 @@ super({

mistralFimCompletion,
...rest,
});

@@ -111,0 +113,0 @@ this.baseURL = setBaseURL(baseURL, apiKey);

@@ -1,1 +0,1 @@

export const VERSION = '1.6.0';
export const VERSION = '1.6.1';

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc