Skip to content

Commit 4ec58d7

Browse files
resolve ambiguous namespace reference
1 parent 1193948 commit 4ec58d7

File tree

6 files changed

+28
-10
lines changed

6 files changed

+28
-10
lines changed

src/Mscc.GenerativeAI.Google/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Changed
1212
### Fixed
1313

14+
## 0.8.1
15+
16+
### Fixed
17+
18+
- resolve ambiguous namespace reference
19+
1420
## 0.8.0
1521

1622
### Changed

src/Mscc.GenerativeAI.Google/GenerativeModelGoogle.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.IO;
55
using System.Threading;
66
#endif
7-
using Google.Apis.Auth.OAuth2;
7+
using gauth = Google.Apis.Auth.OAuth2;
88
using Google.Apis.Util.Store;
99
using System.Security.Cryptography.X509Certificates;
1010

@@ -30,7 +30,7 @@ public class GenerativeModelGoogle
3030
private string _certificateFile = "key.p12";
3131
private string _certificatePassphrase;
3232

33-
private ICredential _credential;
33+
private gauth.ICredential _credential;
3434
// private string ClientId;
3535
// private string ClientSecret;
3636

@@ -46,7 +46,7 @@ public class GenerativeModelGoogle
4646
public GenerativeModelGoogle()
4747
{
4848
var clientSecrets = getClientSecrets();
49-
_credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
49+
_credential = gauth.GoogleWebAuthorizationBroker.AuthorizeAsync(
5050
clientSecrets,
5151
_scopes,
5252
"user",
@@ -66,8 +66,8 @@ private GenerativeModelGoogle(string serviceAccountEmail, string certificate = n
6666
certificate ?? _certificateFile,
6767
passphrase ?? _certificatePassphrase,
6868
X509KeyStorageFlags.Exportable);
69-
_credential = new ServiceAccountCredential(
70-
new ServiceAccountCredential.Initializer(serviceAccountEmail)
69+
_credential = new gauth.ServiceAccountCredential(
70+
new gauth.ServiceAccountCredential.Initializer(serviceAccountEmail)
7171
{
7272
Scopes = _scopes
7373
}.FromCertificate(x509Certificate));
@@ -107,7 +107,7 @@ public GenerativeModel CreateModel(string model = Model.Gemini10Pro)
107107
return generativeModel;
108108
}
109109

110-
private ClientSecrets getClientSecrets()
110+
private gauth.ClientSecrets getClientSecrets()
111111
{
112112
// _credentials = GoogleCredential.GetApplicationDefaultAsync();
113113

@@ -116,7 +116,7 @@ private ClientSecrets getClientSecrets()
116116
// _credentials = await GoogleCredential.FromFileAsync(_tokenFile);
117117
// }
118118
// if (!_credentials.)
119-
ClientSecrets clientSecrets = null;
119+
gauth.ClientSecrets clientSecrets = null;
120120

121121
// if (!string.IsNullOrEmpty(ClientId))
122122
// {
@@ -128,7 +128,7 @@ private ClientSecrets getClientSecrets()
128128
using (var stream = new FileStream(_clientFile, FileMode.Open, FileAccess.Read))
129129
{
130130
// clientSecrets = GoogleClientSecrets.Load(stream).Secrets;
131-
clientSecrets = GoogleClientSecrets.FromStreamAsync(stream).Result.Secrets;
131+
clientSecrets = gauth.GoogleClientSecrets.FromStreamAsync(stream).Result.Secrets;
132132
}
133133
}
134134

src/Mscc.GenerativeAI.Google/Mscc.GenerativeAI.Google.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<ItemGroup>
5656
<PackageReference Include="Google.Apis.Auth" Version="1.67.0" />
57-
<PackageReference Include="Mscc.GenerativeAI" Version="0.8.0" />
57+
<PackageReference Include="Mscc.GenerativeAI" Version="0.8.*" />
5858
</ItemGroup>
5959

6060
<ItemGroup>

src/Mscc.GenerativeAI.Web/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Changed
1212
### Fixed
1313

14+
## 0.8.1
15+
16+
### Changed
17+
18+
- bump version
19+
1420
## 0.8.0
1521

1622
### Changed

src/Mscc.GenerativeAI.Web/Mscc.GenerativeAI.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
4646
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
4747
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
48-
<PackageReference Include="Mscc.GenerativeAI" Version="0.8.0" />
48+
<PackageReference Include="Mscc.GenerativeAI" Version="0.8.*" />
4949
</ItemGroup>
5050

5151
<ItemGroup>

src/Mscc.GenerativeAI/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
### Changed
1616
### Fixed
1717

18+
## 0.8.1
19+
20+
### Changed
21+
22+
- access modifier to avoid ambiguous type reference (ClientSecrets)
23+
1824
## 0.8.0
1925

2026
### Added

0 commit comments

Comments
 (0)