tinfoil 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +18 -0
- package/dist/client.js +20 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +26 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import OpenAI from 'openai';
|
|
1
2
|
import type { Chat, Files, FineTuning, Images, Audio, Embeddings, Models, Moderations, Beta } from 'openai/resources';
|
|
2
3
|
/**
|
|
3
4
|
* TinfoilAI is a wrapper around the OpenAI API client that adds additional
|
|
@@ -17,6 +18,8 @@ export declare class TinfoilAI {
|
|
|
17
18
|
private groundTruth?;
|
|
18
19
|
private clientPromise;
|
|
19
20
|
private readyPromise?;
|
|
21
|
+
apiKey?: string;
|
|
22
|
+
baseURL?: string;
|
|
20
23
|
/**
|
|
21
24
|
* Creates a new TinfoilAI instance.
|
|
22
25
|
* @param options - Configuration options including apiKey and other OpenAI client options
|
|
@@ -82,4 +85,19 @@ export declare class TinfoilAI {
|
|
|
82
85
|
*/
|
|
83
86
|
get beta(): Beta;
|
|
84
87
|
}
|
|
88
|
+
export declare namespace TinfoilAI {
|
|
89
|
+
export import Chat = OpenAI.Chat;
|
|
90
|
+
export import Audio = OpenAI.Audio;
|
|
91
|
+
export import Beta = OpenAI.Beta;
|
|
92
|
+
export import Batches = OpenAI.Batches;
|
|
93
|
+
export import Completions = OpenAI.Completions;
|
|
94
|
+
export import Embeddings = OpenAI.Embeddings;
|
|
95
|
+
export import Files = OpenAI.Files;
|
|
96
|
+
export import FineTuning = OpenAI.FineTuning;
|
|
97
|
+
export import Images = OpenAI.Images;
|
|
98
|
+
export import Models = OpenAI.Models;
|
|
99
|
+
export import Moderations = OpenAI.Moderations;
|
|
100
|
+
export import Uploads = OpenAI.Uploads;
|
|
101
|
+
export import VectorStores = OpenAI.VectorStores;
|
|
102
|
+
}
|
|
85
103
|
export {};
|
package/dist/client.js
CHANGED
|
@@ -78,6 +78,9 @@ class TinfoilAI {
|
|
|
78
78
|
if (options.apiKey || process.env.TINFOIL_API_KEY) {
|
|
79
79
|
openAIOptions.apiKey = options.apiKey || process.env.TINFOIL_API_KEY;
|
|
80
80
|
}
|
|
81
|
+
// Store properties for compatibility
|
|
82
|
+
this.apiKey = openAIOptions.apiKey;
|
|
83
|
+
this.baseURL = config_1.TINFOIL_CONFIG.INFERENCE_BASE_URL;
|
|
81
84
|
this.clientPromise = this.initClient(openAIOptions);
|
|
82
85
|
}
|
|
83
86
|
/**
|
|
@@ -215,3 +218,20 @@ class TinfoilAI {
|
|
|
215
218
|
}
|
|
216
219
|
}
|
|
217
220
|
exports.TinfoilAI = TinfoilAI;
|
|
221
|
+
// Namespace declaration merge to add OpenAI types to TinfoilAI
|
|
222
|
+
(function (TinfoilAI) {
|
|
223
|
+
// Re-export all OpenAI namespace types
|
|
224
|
+
TinfoilAI.Chat = openai_1.default.Chat;
|
|
225
|
+
TinfoilAI.Audio = openai_1.default.Audio;
|
|
226
|
+
TinfoilAI.Beta = openai_1.default.Beta;
|
|
227
|
+
TinfoilAI.Batches = openai_1.default.Batches;
|
|
228
|
+
TinfoilAI.Completions = openai_1.default.Completions;
|
|
229
|
+
TinfoilAI.Embeddings = openai_1.default.Embeddings;
|
|
230
|
+
TinfoilAI.Files = openai_1.default.Files;
|
|
231
|
+
TinfoilAI.FineTuning = openai_1.default.FineTuning;
|
|
232
|
+
TinfoilAI.Images = openai_1.default.Images;
|
|
233
|
+
TinfoilAI.Models = openai_1.default.Models;
|
|
234
|
+
TinfoilAI.Moderations = openai_1.default.Moderations;
|
|
235
|
+
TinfoilAI.Uploads = openai_1.default.Uploads;
|
|
236
|
+
TinfoilAI.VectorStores = openai_1.default.VectorStores;
|
|
237
|
+
})(TinfoilAI || (exports.TinfoilAI = TinfoilAI = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { TinfoilAI } from './client';
|
|
2
|
+
export { TinfoilAI as default } from './client';
|
|
2
3
|
export * from './secure-client';
|
|
3
4
|
export * from './ai-sdk-provider';
|
|
4
5
|
export * from './config';
|
|
6
|
+
export { type Uploadable, toFile, APIPromise, PagePromise, OpenAIError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from 'openai';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,32 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.OpenAIError = exports.PagePromise = exports.APIPromise = exports.toFile = exports.default = exports.TinfoilAI = void 0;
|
|
18
|
+
// Re-export the TinfoilAI class
|
|
19
|
+
var client_1 = require("./client");
|
|
20
|
+
Object.defineProperty(exports, "TinfoilAI", { enumerable: true, get: function () { return client_1.TinfoilAI; } });
|
|
21
|
+
var client_2 = require("./client");
|
|
22
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return client_2.TinfoilAI; } });
|
|
23
|
+
// Export secure client and config
|
|
18
24
|
__exportStar(require("./secure-client"), exports);
|
|
19
25
|
__exportStar(require("./ai-sdk-provider"), exports);
|
|
20
26
|
__exportStar(require("./config"), exports);
|
|
27
|
+
// Re-export OpenAI utility types and classes that users might need
|
|
28
|
+
// Using public exports from the main OpenAI package instead of deep imports
|
|
29
|
+
var openai_1 = require("openai");
|
|
30
|
+
Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return openai_1.toFile; } });
|
|
31
|
+
Object.defineProperty(exports, "APIPromise", { enumerable: true, get: function () { return openai_1.APIPromise; } });
|
|
32
|
+
Object.defineProperty(exports, "PagePromise", { enumerable: true, get: function () { return openai_1.PagePromise; } });
|
|
33
|
+
Object.defineProperty(exports, "OpenAIError", { enumerable: true, get: function () { return openai_1.OpenAIError; } });
|
|
34
|
+
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return openai_1.APIError; } });
|
|
35
|
+
Object.defineProperty(exports, "APIConnectionError", { enumerable: true, get: function () { return openai_1.APIConnectionError; } });
|
|
36
|
+
Object.defineProperty(exports, "APIConnectionTimeoutError", { enumerable: true, get: function () { return openai_1.APIConnectionTimeoutError; } });
|
|
37
|
+
Object.defineProperty(exports, "APIUserAbortError", { enumerable: true, get: function () { return openai_1.APIUserAbortError; } });
|
|
38
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return openai_1.NotFoundError; } });
|
|
39
|
+
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return openai_1.ConflictError; } });
|
|
40
|
+
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return openai_1.RateLimitError; } });
|
|
41
|
+
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return openai_1.BadRequestError; } });
|
|
42
|
+
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return openai_1.AuthenticationError; } });
|
|
43
|
+
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return openai_1.InternalServerError; } });
|
|
44
|
+
Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return openai_1.PermissionDeniedError; } });
|
|
45
|
+
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return openai_1.UnprocessableEntityError; } });
|