mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-25 05:14:46 +00:00
Added a check for characters which an API key cannot contain (#1227)
This commit is contained in:
1 parent
c72a1948b3
commit
e5a7f5423f
40 files changed
+1179
-71
No files matched your search
@@ -96,7 +96,7 @@ public class ProviderGoogle() : BaseProvider(LLMProviders.GOOGLE, new Uri("https
|
||||
var embeddingRequest = JsonSerializer.Serialize(payload, JSON_SERIALIZER_OPTIONS);
|
||||
var embedUrl = $"https://generativelanguage.googleapis.com/v1beta/models/{modelName}:embedContent";
|
||||
using var request = new HttpRequestMessage(HttpMethod.Post, embedUrl);
|
||||
request.Headers.Add("x-goog-api-key", await requestedSecret.Secret.Decrypt(Program.ENCRYPTION));
|
||||
request.Headers.Add("x-goog-api-key", await this.DecryptAPIKey(requestedSecret));
|
||||
|
||||
// Set the content:
|
||||
request.Content = new StringContent(embeddingRequest, Encoding.UTF8, "application/json");
|
||||
|
||||
Reference in new issue
Block a user