tinfoil 0.4.1 → 0.4.2

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.
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * @param repo - The repository identifier
5
5
  * @param enclave - The enclave URL/identifier
6
+ * @param apiKey - The API key for the Tinfoil API
6
7
  * @returns A TinfoilAI instance
7
8
  */
8
- export declare function createTinfoilAI(repo: string, enclave: string): Promise<import("@ai-sdk/openai-compatible").OpenAICompatibleProvider<string, string, string, string>>;
9
+ export declare function createTinfoilAI(repo: string, enclave: string, apiKey: string): Promise<import("@ai-sdk/openai-compatible").OpenAICompatibleProvider<string, string, string, string>>;
@@ -11,9 +11,10 @@ const node_crypto_1 = require("node:crypto");
11
11
  *
12
12
  * @param repo - The repository identifier
13
13
  * @param enclave - The enclave URL/identifier
14
+ * @param apiKey - The API key for the Tinfoil API
14
15
  * @returns A TinfoilAI instance
15
16
  */
16
- async function createTinfoilAI(repo, enclave) {
17
+ async function createTinfoilAI(repo, enclave, apiKey) {
17
18
  const sc = new secure_client_1.SecureClient(enclave, repo);
18
19
  const groundTruth = await sc.verify();
19
20
  const connect = (0, undici_1.buildConnector)({
@@ -37,6 +38,7 @@ async function createTinfoilAI(repo, enclave) {
37
38
  return (0, openai_compatible_1.createOpenAICompatible)({
38
39
  name: "tinfoil",
39
40
  baseURL: `https://${enclave}/v1`,
41
+ apiKey: apiKey,
40
42
  fetch: (async (input, init) => {
41
43
  if (!init) {
42
44
  init = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinfoil",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Official Tinfoil secure OpenAI client wrapper",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",