From 7c37dae4b10465d98962411051ad5d59c7f08353 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 26 Oct 2024 10:32:34 +1030 Subject: [PATCH] chore: Remove key type restictions --- sdk-bash/test.sh | 2 +- sdk-dotnet/src/Inferable.cs | 18 +++++++++--------- .../tests/Inferable.Tests/InferableTest.cs | 9 --------- sdk-node/src/Inferable.ts | 2 +- sdk-node/src/eval/promptfoo.ts | 6 ------ 5 files changed, 11 insertions(+), 26 deletions(-) diff --git a/sdk-bash/test.sh b/sdk-bash/test.sh index a055013f..f4c94443 100644 --- a/sdk-bash/test.sh +++ b/sdk-bash/test.sh @@ -1,4 +1,4 @@ -INFERABLE_API_SECRET="sk_cluster_machine_151qeOFp251eH9v0MxRTYDnxOt2wexZQLmIXU8Vb8" +INFERABLE_API_SECRET="" source ./inferable.sh diff --git a/sdk-dotnet/src/Inferable.cs b/sdk-dotnet/src/Inferable.cs index 193b6699..570bb504 100644 --- a/sdk-dotnet/src/Inferable.cs +++ b/sdk-dotnet/src/Inferable.cs @@ -4,6 +4,11 @@ namespace Inferable { + public class Links + { + public static string DOCS_AUTH = "https://docs.inferable.ai/pages/auth"; + } + public class InferableOptions { public string? BaseUrl { get; set; } @@ -44,17 +49,12 @@ public InferableClient(InferableOptions? options = null, ILogger(() => new InferableClient(new InferableOptions - { - ApiSecret = System.Environment.GetEnvironmentVariable("INFERABLE_CONSUME_SECRET")! - })); - } - [Fact] async public void Inferable_Can_Register_Function() { diff --git a/sdk-node/src/Inferable.ts b/sdk-node/src/Inferable.ts index 9cbf7df6..bfd48889 100644 --- a/sdk-node/src/Inferable.ts +++ b/sdk-node/src/Inferable.ts @@ -154,7 +154,7 @@ export class Inferable { ); } - if (!apiSecret.startsWith("sk_cluster_")) { + if (!apiSecret.startsWith("sk_")) { throw new InferableError( `Invalid API Secret. Please see ${links.DOCS_AUTH}`, ); diff --git a/sdk-node/src/eval/promptfoo.ts b/sdk-node/src/eval/promptfoo.ts index 674ba77e..7d09f691 100644 --- a/sdk-node/src/eval/promptfoo.ts +++ b/sdk-node/src/eval/promptfoo.ts @@ -182,12 +182,6 @@ class InferablePromptfooProvider implements ApiProvider { ); } - if (this.apiSecret.startsWith("sk_machine")) { - throw new InferableError( - "This function can not be called with a machine token.", - ); - } - const clusterId = process.env.INFERABLE_CLUSTER_ID; // Fetch existing run