diff --git a/Directory.Packages.props b/Directory.Packages.props index c32f2591b1c1..e5c49503a3c4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,5 +1,6 @@ + @@ -29,4 +30,4 @@ - + \ No newline at end of file diff --git a/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.Extensions/Google.Cloud.AIPlatform.V1Beta1.Extensions.csproj b/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.Extensions/Google.Cloud.AIPlatform.V1Beta1.Extensions.csproj new file mode 100644 index 000000000000..e620e57cce4d --- /dev/null +++ b/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.Extensions/Google.Cloud.AIPlatform.V1Beta1.Extensions.csproj @@ -0,0 +1,19 @@ + + + + 1.0.0-beta09 + netstandard2.0;net462 + true + Implementation of Microsoft.Extensions.AI for Google client library to access the AI Platform API (v1beta). + ai;ml;Google;Cloud + + + + + + + + + + + diff --git a/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.Extensions/GoogleChatClient.cs b/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.Extensions/GoogleChatClient.cs new file mode 100644 index 000000000000..d8d1f2a8ff30 --- /dev/null +++ b/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.Extensions/GoogleChatClient.cs @@ -0,0 +1,60 @@ +#region HEADER +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"): +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#endregion + +using Microsoft.Extensions.AI; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Google.Cloud.AIPlatform.V1Beta1; + +internal sealed class GoogleChatClient : IChatClient +{ + private readonly PredictionServiceClient _predictionServiceClient; + + public ChatClientMetadata Metadata { get; } + + internal GoogleChatClient(PredictionServiceClient predictionServiceClient) + { + this._predictionServiceClient = predictionServiceClient; + } + + public Task CompleteAsync( + IList chatMessages, + ChatOptions options = null, + CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public IAsyncEnumerable CompleteStreamingAsync( + IList chatMessages, + ChatOptions options = null, + CancellationToken cancellationToken = default) + { + throw new System.NotImplementedException(); + } + + public TService GetService(object key = null) where TService : class + { + throw new System.NotImplementedException(); + } + + public void Dispose() + { + // TODO release managed resources here + } +} diff --git a/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.sln b/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.sln index ccf7718a8235..86b5e3c65007 100644 --- a/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.sln +++ b/apis/Google.Cloud.AIPlatform.V1Beta1/Google.Cloud.AIPlatform.V1Beta1.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.ClientTesting" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.AIPlatform.V1Beta1.Snippets", "Google.Cloud.AIPlatform.V1Beta1.Snippets\Google.Cloud.AIPlatform.V1Beta1.Snippets.csproj", "{CD82E817-EA05-431B-84EE-A34AC5D67C38}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google.Cloud.AIPlatform.V1Beta1.Extensions", "Google.Cloud.AIPlatform.V1Beta1.Extensions\Google.Cloud.AIPlatform.V1Beta1.Extensions.csproj", "{43D10BF9-255C-4E17-B683-BA2C501CF397}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -36,5 +38,9 @@ Global {CD82E817-EA05-431B-84EE-A34AC5D67C38}.Debug|Any CPU.Build.0 = Debug|Any CPU {CD82E817-EA05-431B-84EE-A34AC5D67C38}.Release|Any CPU.ActiveCfg = Release|Any CPU {CD82E817-EA05-431B-84EE-A34AC5D67C38}.Release|Any CPU.Build.0 = Release|Any CPU + {43D10BF9-255C-4E17-B683-BA2C501CF397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43D10BF9-255C-4E17-B683-BA2C501CF397}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43D10BF9-255C-4E17-B683-BA2C501CF397}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43D10BF9-255C-4E17-B683-BA2C501CF397}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal