From a186621e0b0550956e4603a8cdb45056768e9054 Mon Sep 17 00:00:00 2001 From: HavenDV Date: Sat, 20 Jan 2024 23:27:54 +0400 Subject: [PATCH] fix: Disable validation of API key. --- src/libs/Directory.Build.props | 2 +- src/libs/OpenAI/Client/OpenAIClient.cs | 2 +- src/libs/OpenAI/OpenAI.csproj | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/Directory.Build.props b/src/libs/Directory.Build.props index 6cbf8c43..b4bf102c 100755 --- a/src/libs/Directory.Build.props +++ b/src/libs/Directory.Build.props @@ -16,7 +16,7 @@ - 2.0.0-alpha.6 + 2.0.0-alpha.7 true true tryAGI and contributors diff --git a/src/libs/OpenAI/Client/OpenAIClient.cs b/src/libs/OpenAI/Client/OpenAIClient.cs index df05f4b6..48ea4f44 100644 --- a/src/libs/OpenAI/Client/OpenAIClient.cs +++ b/src/libs/OpenAI/Client/OpenAIClient.cs @@ -240,7 +240,7 @@ private HttpClient SetupClient(HttpClient client = null) (!OpenAIAuthentication.ApiKey.Contains(AuthInfo.SecretKeyPrefix) && !OpenAIAuthentication.ApiKey.Contains(AuthInfo.SessionKeyPrefix)))) { - throw new InvalidCredentialException($"{OpenAIAuthentication.ApiKey} must start with '{AuthInfo.SecretKeyPrefix}'"); + //throw new InvalidCredentialException($"{OpenAIAuthentication.ApiKey} must start with '{AuthInfo.SecretKeyPrefix}'"); } if (OpenAIClientSettings.UseOAuthAuthentication) diff --git a/src/libs/OpenAI/OpenAI.csproj b/src/libs/OpenAI/OpenAI.csproj index 9df1035e..ac067bbc 100644 --- a/src/libs/OpenAI/OpenAI.csproj +++ b/src/libs/OpenAI/OpenAI.csproj @@ -20,16 +20,17 @@ OpenAI OpenAiApi true + Permission false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive