From 4ec58d7e7dc32b13921e3fc5819e22d82d5935e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20Kirst=C3=A4tter?= <7329802+jochenkirstaetter@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:56:00 +0400 Subject: [PATCH] resolve ambiguous namespace reference --- src/Mscc.GenerativeAI.Google/CHANGELOG.md | 6 ++++++ .../GenerativeModelGoogle.cs | 16 ++++++++-------- .../Mscc.GenerativeAI.Google.csproj | 2 +- src/Mscc.GenerativeAI.Web/CHANGELOG.md | 6 ++++++ .../Mscc.GenerativeAI.Web.csproj | 2 +- src/Mscc.GenerativeAI/CHANGELOG.md | 6 ++++++ 6 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/Mscc.GenerativeAI.Google/CHANGELOG.md b/src/Mscc.GenerativeAI.Google/CHANGELOG.md index 35365ac..9733be0 100644 --- a/src/Mscc.GenerativeAI.Google/CHANGELOG.md +++ b/src/Mscc.GenerativeAI.Google/CHANGELOG.md @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed ### Fixed +## 0.8.1 + +### Fixed + +- resolve ambiguous namespace reference + ## 0.8.0 ### Changed diff --git a/src/Mscc.GenerativeAI.Google/GenerativeModelGoogle.cs b/src/Mscc.GenerativeAI.Google/GenerativeModelGoogle.cs index 9fa4fcc..6ec713e 100644 --- a/src/Mscc.GenerativeAI.Google/GenerativeModelGoogle.cs +++ b/src/Mscc.GenerativeAI.Google/GenerativeModelGoogle.cs @@ -4,7 +4,7 @@ using System.IO; using System.Threading; #endif -using Google.Apis.Auth.OAuth2; +using gauth = Google.Apis.Auth.OAuth2; using Google.Apis.Util.Store; using System.Security.Cryptography.X509Certificates; @@ -30,7 +30,7 @@ public class GenerativeModelGoogle private string _certificateFile = "key.p12"; private string _certificatePassphrase; - private ICredential _credential; + private gauth.ICredential _credential; // private string ClientId; // private string ClientSecret; @@ -46,7 +46,7 @@ public class GenerativeModelGoogle public GenerativeModelGoogle() { var clientSecrets = getClientSecrets(); - _credential = GoogleWebAuthorizationBroker.AuthorizeAsync( + _credential = gauth.GoogleWebAuthorizationBroker.AuthorizeAsync( clientSecrets, _scopes, "user", @@ -66,8 +66,8 @@ private GenerativeModelGoogle(string serviceAccountEmail, string certificate = n certificate ?? _certificateFile, passphrase ?? _certificatePassphrase, X509KeyStorageFlags.Exportable); - _credential = new ServiceAccountCredential( - new ServiceAccountCredential.Initializer(serviceAccountEmail) + _credential = new gauth.ServiceAccountCredential( + new gauth.ServiceAccountCredential.Initializer(serviceAccountEmail) { Scopes = _scopes }.FromCertificate(x509Certificate)); @@ -107,7 +107,7 @@ public GenerativeModel CreateModel(string model = Model.Gemini10Pro) return generativeModel; } - private ClientSecrets getClientSecrets() + private gauth.ClientSecrets getClientSecrets() { // _credentials = GoogleCredential.GetApplicationDefaultAsync(); @@ -116,7 +116,7 @@ private ClientSecrets getClientSecrets() // _credentials = await GoogleCredential.FromFileAsync(_tokenFile); // } // if (!_credentials.) - ClientSecrets clientSecrets = null; + gauth.ClientSecrets clientSecrets = null; // if (!string.IsNullOrEmpty(ClientId)) // { @@ -128,7 +128,7 @@ private ClientSecrets getClientSecrets() using (var stream = new FileStream(_clientFile, FileMode.Open, FileAccess.Read)) { // clientSecrets = GoogleClientSecrets.Load(stream).Secrets; - clientSecrets = GoogleClientSecrets.FromStreamAsync(stream).Result.Secrets; + clientSecrets = gauth.GoogleClientSecrets.FromStreamAsync(stream).Result.Secrets; } } diff --git a/src/Mscc.GenerativeAI.Google/Mscc.GenerativeAI.Google.csproj b/src/Mscc.GenerativeAI.Google/Mscc.GenerativeAI.Google.csproj index 664e13b..f483038 100644 --- a/src/Mscc.GenerativeAI.Google/Mscc.GenerativeAI.Google.csproj +++ b/src/Mscc.GenerativeAI.Google/Mscc.GenerativeAI.Google.csproj @@ -54,7 +54,7 @@ - + diff --git a/src/Mscc.GenerativeAI.Web/CHANGELOG.md b/src/Mscc.GenerativeAI.Web/CHANGELOG.md index 27d50a4..28d1077 100644 --- a/src/Mscc.GenerativeAI.Web/CHANGELOG.md +++ b/src/Mscc.GenerativeAI.Web/CHANGELOG.md @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed ### Fixed +## 0.8.1 + +### Changed + +- bump version + ## 0.8.0 ### Changed diff --git a/src/Mscc.GenerativeAI.Web/Mscc.GenerativeAI.Web.csproj b/src/Mscc.GenerativeAI.Web/Mscc.GenerativeAI.Web.csproj index 930262c..7d79273 100644 --- a/src/Mscc.GenerativeAI.Web/Mscc.GenerativeAI.Web.csproj +++ b/src/Mscc.GenerativeAI.Web/Mscc.GenerativeAI.Web.csproj @@ -45,7 +45,7 @@ - + diff --git a/src/Mscc.GenerativeAI/CHANGELOG.md b/src/Mscc.GenerativeAI/CHANGELOG.md index 5e34135..27bcd1a 100644 --- a/src/Mscc.GenerativeAI/CHANGELOG.md +++ b/src/Mscc.GenerativeAI/CHANGELOG.md @@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed ### Fixed +## 0.8.1 + +### Changed + +- access modifier to avoid ambiguous type reference (ClientSecrets) + ## 0.8.0 ### Added