diff --git a/CMakeLists.txt b/CMakeLists.txt index 3378ffacd..6b622871b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,8 +69,8 @@ option(FIREBASE_INCLUDE_REMOTE_CONFIG option(FIREBASE_INCLUDE_STORAGE "Include the Cloud Storage for Firebase library." ${FIREBASE_INCLUDE_LIBRARY_DEFAULT}) -option(FIREBASE_INCLUDE_VERTEXAI - "Include the Vertex AI in Firebase library." +option(FIREBASE_INCLUDE_FIREBASEAI + "Include the Firebase AI library." ${FIREBASE_INCLUDE_LIBRARY_DEFAULT}) option(FIREBASE_INCLUDE_EDITOR_TOOL @@ -345,8 +345,8 @@ if (FIREBASE_INCLUDE_STORAGE) list(APPEND DOCUMENTATION_ONLY_LIB_NAMES "firebase_storage_swig") list(APPEND PROJECT_LIST_HEADER " X(Storage)") endif() -if (FIREBASE_INCLUDE_VERTEXAI) - add_subdirectory(vertexai) +if (FIREBASE_INCLUDE_FIREBASEAI) + add_subdirectory(firebaseai) # Doesn't use swig, so don't need to update the other lists endif() diff --git a/app/platform/Unity/AssemblyInfo.cs b/app/platform/Unity/AssemblyInfo.cs index 62635e5b8..bf852bacc 100644 --- a/app/platform/Unity/AssemblyInfo.cs +++ b/app/platform/Unity/AssemblyInfo.cs @@ -47,7 +47,7 @@ [assembly: InternalsVisibleTo("Firebase.TaskExtension")] [assembly: InternalsVisibleTo("Firebase.TestLab")] [assembly: InternalsVisibleTo("Firebase.TestLab.GameLoop")] -[assembly: InternalsVisibleTo("Firebase.VertexAI")] +[assembly: InternalsVisibleTo("Firebase.FirebaseAI")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". diff --git a/docs/vertexai/VertexAIReadme.md b/docs/firebaseai/FirebaseAIReadme.md similarity index 63% rename from docs/vertexai/VertexAIReadme.md rename to docs/firebaseai/FirebaseAIReadme.md index aa418f464..f0af26756 100644 --- a/docs/vertexai/VertexAIReadme.md +++ b/docs/firebaseai/FirebaseAIReadme.md @@ -1,9 +1,9 @@ -Get Started with Vertex AI in Firebase +Get Started with Firebase AI =========================================== -Thank you for installing the Vertex AI in Firebase Unity SDK. +Thank you for installing the Firebase AI Unity SDK. -The Vertex AI Gemini API gives you access to the latest generative AI models from Google: the Gemini models. This SDK is built specifically for use with Unity and mobile developers, offering security options against unauthorized clients as well as integrations with other Firebase services. +The Firebase AI Gemini API gives you access to the latest generative AI models from Google: the Gemini models. This SDK is built specifically for use with Unity and mobile developers, offering security options against unauthorized clients as well as integrations with other Firebase services. With this, you can add AI personalization to your app, build an AI chat experience, create AI-powered optimizations and automation, and much more! diff --git a/vertexai/CMakeLists.txt b/firebaseai/CMakeLists.txt similarity index 73% rename from vertexai/CMakeLists.txt rename to firebaseai/CMakeLists.txt index 39c07b139..d13b6731d 100644 --- a/vertexai/CMakeLists.txt +++ b/firebaseai/CMakeLists.txt @@ -12,21 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -# CMake file for the Vertex AI in Firebase library +# CMake file for the Firebase AI library -# Vertex AI in Firebase is different from the other Firebase libraries, +# Firebase AI is different from the other Firebase libraries, # as instead of prebuilding, we provide it as a source library. # Package every file under src, including subfolders, since we want them all. unity_pack_folder( - "${FIREBASE_UNITY_DIR}/vertexai/src/" - PACK_PATH "Firebase/VertexAI" + "${FIREBASE_UNITY_DIR}/firebaseai/src/" + PACK_PATH "Firebase/FirebaseAI" ) # For documentation, get only the C# files at the top level, # which make up the public API. -file(GLOB firebase_vertexai_doc_src "src/*.cs") -unity_pack_documentation_sources(vertexai +file(GLOB firebase_firebaseai_doc_src "src/*.cs") +unity_pack_documentation_sources(firebaseai DOCUMENTATION_SOURCES - ${firebase_vertexai_src} + ${firebase_firebaseai_src} ) diff --git a/vertexai/src/Candidate.cs b/firebaseai/src/Candidate.cs similarity index 84% rename from vertexai/src/Candidate.cs rename to firebaseai/src/Candidate.cs index 78183c035..d5620f0b0 100644 --- a/vertexai/src/Candidate.cs +++ b/firebaseai/src/Candidate.cs @@ -18,9 +18,9 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// Represents the reason why the model stopped generating content. @@ -108,16 +108,16 @@ private Candidate(ModelContent content, List safetyRatings, private static FinishReason ParseFinishReason(string str) { return str switch { - "STOP" => Firebase.VertexAI.FinishReason.Stop, - "MAX_TOKENS" => Firebase.VertexAI.FinishReason.MaxTokens, - "SAFETY" => Firebase.VertexAI.FinishReason.Safety, - "RECITATION" => Firebase.VertexAI.FinishReason.Recitation, - "OTHER" => Firebase.VertexAI.FinishReason.Other, - "BLOCKLIST" => Firebase.VertexAI.FinishReason.Blocklist, - "PROHIBITED_CONTENT" => Firebase.VertexAI.FinishReason.ProhibitedContent, - "SPII" => Firebase.VertexAI.FinishReason.SPII, - "MALFORMED_FUNCTION_CALL" => Firebase.VertexAI.FinishReason.MalformedFunctionCall, - _ => Firebase.VertexAI.FinishReason.Unknown, + "STOP" => Firebase.FirebaseAI.FinishReason.Stop, + "MAX_TOKENS" => Firebase.FirebaseAI.FinishReason.MaxTokens, + "SAFETY" => Firebase.FirebaseAI.FinishReason.Safety, + "RECITATION" => Firebase.FirebaseAI.FinishReason.Recitation, + "OTHER" => Firebase.FirebaseAI.FinishReason.Other, + "BLOCKLIST" => Firebase.FirebaseAI.FinishReason.Blocklist, + "PROHIBITED_CONTENT" => Firebase.FirebaseAI.FinishReason.ProhibitedContent, + "SPII" => Firebase.FirebaseAI.FinishReason.SPII, + "MALFORMED_FUNCTION_CALL" => Firebase.FirebaseAI.FinishReason.MalformedFunctionCall, + _ => Firebase.FirebaseAI.FinishReason.Unknown, }; } @@ -132,7 +132,7 @@ internal static Candidate FromJson(Dictionary jsonDict, jsonDict.ParseObjectList("safetyRatings", SafetyRating.FromJson), jsonDict.ParseNullableEnum("finishReason", ParseFinishReason), jsonDict.ParseNullableObject("citationMetadata", - (d) => Firebase.VertexAI.CitationMetadata.FromJson(d, backend))); + (d) => Firebase.FirebaseAI.CitationMetadata.FromJson(d, backend))); } } diff --git a/vertexai/src/Candidate.cs.meta b/firebaseai/src/Candidate.cs.meta similarity index 100% rename from vertexai/src/Candidate.cs.meta rename to firebaseai/src/Candidate.cs.meta diff --git a/vertexai/src/Chat.cs b/firebaseai/src/Chat.cs similarity index 90% rename from vertexai/src/Chat.cs rename to firebaseai/src/Chat.cs index 1870616b2..46f2d02ce 100644 --- a/vertexai/src/Chat.cs +++ b/firebaseai/src/Chat.cs @@ -20,9 +20,9 @@ using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// An object that represents a back-and-forth chat with a model, capturing the history and saving @@ -64,7 +64,7 @@ internal static Chat InternalCreateChat(GenerativeModel model, IEnumerableThe input given to the model as a prompt. /// An optional token to cancel the operation. /// The model's response if no error occurred. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public Task SendMessageAsync( ModelContent content, CancellationToken cancellationToken = default) { return SendMessageAsync(new[] { content }, cancellationToken); @@ -76,7 +76,7 @@ public Task SendMessageAsync( /// The text given to the model as a prompt. /// An optional token to cancel the operation. /// The model's response if no error occurred. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public Task SendMessageAsync( string text, CancellationToken cancellationToken = default) { return SendMessageAsync(new ModelContent[] { ModelContent.Text(text) }, cancellationToken); @@ -88,7 +88,7 @@ public Task SendMessageAsync( /// The input given to the model as a prompt. /// An optional token to cancel the operation. /// The model's response if no error occurred. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public Task SendMessageAsync( IEnumerable content, CancellationToken cancellationToken = default) { return SendMessageAsyncInternal(content, cancellationToken); @@ -101,7 +101,7 @@ public Task SendMessageAsync( /// The input given to the model as a prompt. /// An optional token to cancel the operation. /// A stream of generated content responses from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public IAsyncEnumerable SendMessageStreamAsync( ModelContent content, CancellationToken cancellationToken = default) { return SendMessageStreamAsync(new[] { content }, cancellationToken); @@ -113,7 +113,7 @@ public IAsyncEnumerable SendMessageStreamAsync( /// The text given to the model as a prompt. /// An optional token to cancel the operation. /// A stream of generated content responses from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public IAsyncEnumerable SendMessageStreamAsync( string text, CancellationToken cancellationToken = default) { return SendMessageStreamAsync(new ModelContent[] { ModelContent.Text(text) }, cancellationToken); @@ -125,7 +125,7 @@ public IAsyncEnumerable SendMessageStreamAsync( /// The input given to the model as a prompt. /// An optional token to cancel the operation. /// A stream of generated content responses from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public IAsyncEnumerable SendMessageStreamAsync( IEnumerable content, CancellationToken cancellationToken = default) { return SendMessageStreamAsyncInternal(content, cancellationToken); @@ -134,7 +134,7 @@ public IAsyncEnumerable SendMessageStreamAsync( private async Task SendMessageAsyncInternal( IEnumerable requestContent, CancellationToken cancellationToken = default) { // Make sure that the requests are set to to role "user". - List fixedRequests = requestContent.Select(VertexAIExtensions.ConvertToUser).ToList(); + List fixedRequests = requestContent.Select(FirebaseAIExtensions.ConvertToUser).ToList(); // Set up the context to send in the request List fullRequest = new(chatHistory); fullRequest.AddRange(fixedRequests); @@ -159,7 +159,7 @@ private async IAsyncEnumerable SendMessageStreamAsyncIn IEnumerable requestContent, [EnumeratorCancellation] CancellationToken cancellationToken = default) { // Make sure that the requests are set to to role "user". - List fixedRequests = requestContent.Select(VertexAIExtensions.ConvertToUser).ToList(); + List fixedRequests = requestContent.Select(FirebaseAIExtensions.ConvertToUser).ToList(); // Set up the context to send in the request List fullRequest = new(chatHistory); fullRequest.AddRange(fixedRequests); diff --git a/vertexai/src/Chat.cs.meta b/firebaseai/src/Chat.cs.meta similarity index 100% rename from vertexai/src/Chat.cs.meta rename to firebaseai/src/Chat.cs.meta diff --git a/vertexai/src/Citation.cs b/firebaseai/src/Citation.cs similarity index 98% rename from vertexai/src/Citation.cs rename to firebaseai/src/Citation.cs index f9d6316af..0c9d0a7d3 100644 --- a/vertexai/src/Citation.cs +++ b/firebaseai/src/Citation.cs @@ -17,9 +17,9 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// A collection of source attributions for a piece of content. diff --git a/vertexai/src/Citation.cs.meta b/firebaseai/src/Citation.cs.meta similarity index 100% rename from vertexai/src/Citation.cs.meta rename to firebaseai/src/Citation.cs.meta diff --git a/vertexai/src/CountTokensResponse.cs b/firebaseai/src/CountTokensResponse.cs similarity index 94% rename from vertexai/src/CountTokensResponse.cs rename to firebaseai/src/CountTokensResponse.cs index 7511a4824..72f5a7318 100644 --- a/vertexai/src/CountTokensResponse.cs +++ b/firebaseai/src/CountTokensResponse.cs @@ -17,9 +17,9 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using Google.MiniJSON; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// The model's response to a count tokens request. @@ -33,7 +33,7 @@ public readonly struct CountTokensResponse { /// The total number of billable characters in the text input given to the model as a prompt. /// /// > Important: This does not include billable image, video or other non-text input. See - /// [Vertex AI pricing](https://firebase.google.com/docs/vertex-ai/pricing) for details. + /// [Firebase AI pricing](https://firebase.google.com/docs/vertex-ai/pricing) for details. /// public int? TotalBillableCharacters { get; } diff --git a/vertexai/src/CountTokensResponse.cs.meta b/firebaseai/src/CountTokensResponse.cs.meta similarity index 100% rename from vertexai/src/CountTokensResponse.cs.meta rename to firebaseai/src/CountTokensResponse.cs.meta diff --git a/vertexai/src/FirebaseAI.cs b/firebaseai/src/FirebaseAI.cs similarity index 98% rename from vertexai/src/FirebaseAI.cs rename to firebaseai/src/FirebaseAI.cs index b1a02bc04..fee6a2988 100644 --- a/vertexai/src/FirebaseAI.cs +++ b/firebaseai/src/FirebaseAI.cs @@ -17,7 +17,7 @@ using System; using System.Collections.Concurrent; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// The entry point for all Firebase AI SDK functionality. @@ -68,7 +68,7 @@ public static Backend GoogleAI() { /// for a list of supported regions. public static Backend VertexAI(string location = "us-central1") { if (string.IsNullOrWhiteSpace(location) || location.Contains("/")) { - throw new VertexAIInvalidLocationException(location); + throw new FirebaseAIInvalidLocationException(location); } return new Backend(InternalProvider.VertexAI, location); diff --git a/vertexai/src/FirebaseAI.cs.meta b/firebaseai/src/FirebaseAI.cs.meta similarity index 100% rename from vertexai/src/FirebaseAI.cs.meta rename to firebaseai/src/FirebaseAI.cs.meta diff --git a/firebaseai/src/FirebaseAIException.cs b/firebaseai/src/FirebaseAIException.cs new file mode 100644 index 000000000..08e40e195 --- /dev/null +++ b/firebaseai/src/FirebaseAIException.cs @@ -0,0 +1,82 @@ +/* + * Copyright 2025 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 + * + * http://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. + */ + +using System; +using System.Linq; + +namespace Firebase.FirebaseAI { + +public class FirebaseAIException : Exception { + internal FirebaseAIException(string message) : base(message) { } + + internal FirebaseAIException(string message, Exception exception) : base(message, exception) { } +} + +public class FirebaseAISerializationException : FirebaseAIException { + internal FirebaseAISerializationException(string message) : base(message) { } + + internal FirebaseAISerializationException(string message, Exception exception) : base(message, exception) { } +} + +public class FirebaseAIServerException : FirebaseAIException { + internal FirebaseAIServerException(string message) : base(message) { } +} + +public class FirebaseAIInvalidAPIKeyException : FirebaseAIException { + internal FirebaseAIInvalidAPIKeyException(string message) : base(message) { } +} + +public class FirebaseAIPromptBlockedException : FirebaseAIException { + internal FirebaseAIPromptBlockedException(GenerateContentResponse response) : + base("Prompt was blocked:" + + $"{response.PromptFeedback?.BlockReason?.ToString() ?? "Unknown"}") { } +} + +public class FirebaseAIUnsupportedUserLocationException : FirebaseAIException { + internal FirebaseAIUnsupportedUserLocationException() : + base("User location is not supported for the API use.") { } +} + +public class FirebaseAIInvalidStateException : FirebaseAIException { + internal FirebaseAIInvalidStateException(string message) : base(message) { } +} + +public class FirebaseAIResponseStoppedException : FirebaseAIException { + internal FirebaseAIResponseStoppedException(GenerateContentResponse response) : + base("Content generation stopped. Reason: " + + $"{response.Candidates.FirstOrDefault().FinishReason?.ToString() ?? "Unknown"}") { } +} + +public class FirebaseAIRequestTimeoutException : FirebaseAIException { + internal FirebaseAIRequestTimeoutException(string message) : base(message) { } + + internal FirebaseAIRequestTimeoutException(string message, Exception e) : base(message, e) { } +} + +public class FirebaseAIInvalidLocationException : FirebaseAIException { + internal FirebaseAIInvalidLocationException(string location) : + base($"Invalid location \"{location}\"") { } +} + +public class FirebaseAIServiceDisabledException : FirebaseAIException { + internal FirebaseAIServiceDisabledException(string message) : base(message) { } +} + +public class FirebaseAIUnknownException : FirebaseAIException { + internal FirebaseAIUnknownException(string message) : base(message) { } +} + +} diff --git a/vertexai/src/VertexAIException.cs.meta b/firebaseai/src/FirebaseAIException.cs.meta similarity index 100% rename from vertexai/src/VertexAIException.cs.meta rename to firebaseai/src/FirebaseAIException.cs.meta diff --git a/vertexai/src/FunctionCalling.cs b/firebaseai/src/FunctionCalling.cs similarity index 99% rename from vertexai/src/FunctionCalling.cs rename to firebaseai/src/FunctionCalling.cs index 35d364502..bf0632e5c 100644 --- a/vertexai/src/FunctionCalling.cs +++ b/firebaseai/src/FunctionCalling.cs @@ -17,9 +17,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// Structured representation of a function declaration. diff --git a/vertexai/src/FunctionCalling.cs.meta b/firebaseai/src/FunctionCalling.cs.meta similarity index 100% rename from vertexai/src/FunctionCalling.cs.meta rename to firebaseai/src/FunctionCalling.cs.meta diff --git a/vertexai/src/GenerateContentResponse.cs b/firebaseai/src/GenerateContentResponse.cs similarity index 94% rename from vertexai/src/GenerateContentResponse.cs rename to firebaseai/src/GenerateContentResponse.cs index 62d5dce0a..46b6c8946 100644 --- a/vertexai/src/GenerateContentResponse.cs +++ b/firebaseai/src/GenerateContentResponse.cs @@ -18,9 +18,9 @@ using System.Collections.ObjectModel; using System.Linq; using Google.MiniJSON; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// The model's response to a generate content request. @@ -92,9 +92,9 @@ internal static GenerateContentResponse FromJson(Dictionary json return new GenerateContentResponse( jsonDict.ParseObjectList("candidates", (d) => Candidate.FromJson(d, backend)), jsonDict.ParseNullableObject("promptFeedback", - Firebase.VertexAI.PromptFeedback.FromJson), + Firebase.FirebaseAI.PromptFeedback.FromJson), jsonDict.ParseNullableObject("usageMetadata", - Firebase.VertexAI.UsageMetadata.FromJson)); + Firebase.FirebaseAI.UsageMetadata.FromJson)); } } @@ -154,11 +154,11 @@ private PromptFeedback(BlockReason? blockReason, string blockReasonMessage, private static BlockReason ParseBlockReason(string str) { return str switch { - "SAFETY" => Firebase.VertexAI.BlockReason.Safety, - "OTHER" => Firebase.VertexAI.BlockReason.Other, - "BLOCKLIST" => Firebase.VertexAI.BlockReason.Blocklist, - "PROHIBITED_CONTENT" => Firebase.VertexAI.BlockReason.ProhibitedContent, - _ => Firebase.VertexAI.BlockReason.Unknown, + "SAFETY" => Firebase.FirebaseAI.BlockReason.Safety, + "OTHER" => Firebase.FirebaseAI.BlockReason.Other, + "BLOCKLIST" => Firebase.FirebaseAI.BlockReason.Blocklist, + "PROHIBITED_CONTENT" => Firebase.FirebaseAI.BlockReason.ProhibitedContent, + _ => Firebase.FirebaseAI.BlockReason.Unknown, }; } diff --git a/vertexai/src/GenerateContentResponse.cs.meta b/firebaseai/src/GenerateContentResponse.cs.meta similarity index 100% rename from vertexai/src/GenerateContentResponse.cs.meta rename to firebaseai/src/GenerateContentResponse.cs.meta diff --git a/vertexai/src/GenerationConfig.cs b/firebaseai/src/GenerationConfig.cs similarity index 99% rename from vertexai/src/GenerationConfig.cs rename to firebaseai/src/GenerationConfig.cs index 6f91dc962..529156f9d 100644 --- a/vertexai/src/GenerationConfig.cs +++ b/firebaseai/src/GenerationConfig.cs @@ -17,9 +17,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// A struct defining model parameters to be used when sending generative AI diff --git a/vertexai/src/GenerationConfig.cs.meta b/firebaseai/src/GenerationConfig.cs.meta similarity index 100% rename from vertexai/src/GenerationConfig.cs.meta rename to firebaseai/src/GenerationConfig.cs.meta diff --git a/vertexai/src/GenerativeModel.cs b/firebaseai/src/GenerativeModel.cs similarity index 91% rename from vertexai/src/GenerativeModel.cs rename to firebaseai/src/GenerativeModel.cs index 65d2aa922..5bfcd9dea 100644 --- a/vertexai/src/GenerativeModel.cs +++ b/firebaseai/src/GenerativeModel.cs @@ -24,9 +24,9 @@ using System.Threading; using System.Threading.Tasks; using Google.MiniJSON; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// A type that represents a remote multimodal model (like Gemini), with the ability to generate @@ -51,7 +51,7 @@ public class GenerativeModel { /// /// Intended for internal use only. - /// Use `VertexAI.GetGenerativeModel` instead to ensure proper initialization and configuration of the `GenerativeModel`. + /// Use `FirebaseAI.GetGenerativeModel` instead to ensure proper initialization and configuration of the `GenerativeModel`. /// internal GenerativeModel(FirebaseApp firebaseApp, FirebaseAI.Backend backend, @@ -86,7 +86,7 @@ internal GenerativeModel(FirebaseApp firebaseApp, /// The input given to the model as a prompt. /// An optional token to cancel the operation. /// The generated content response from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public Task GenerateContentAsync( ModelContent content, CancellationToken cancellationToken = default) { return GenerateContentAsync(new[] { content }, cancellationToken); @@ -97,7 +97,7 @@ public Task GenerateContentAsync( /// The text given to the model as a prompt. /// An optional token to cancel the operation. /// The generated content response from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public Task GenerateContentAsync( string text, CancellationToken cancellationToken = default) { return GenerateContentAsync(new[] { ModelContent.Text(text) }, cancellationToken); @@ -108,7 +108,7 @@ public Task GenerateContentAsync( /// The input given to the model as a prompt. /// An optional token to cancel the operation. /// The generated content response from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public Task GenerateContentAsync( IEnumerable content, CancellationToken cancellationToken = default) { return GenerateContentAsyncInternal(content, cancellationToken); @@ -120,7 +120,7 @@ public Task GenerateContentAsync( /// The input given to the model as a prompt. /// An optional token to cancel the operation. /// A stream of generated content responses from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public IAsyncEnumerable GenerateContentStreamAsync( ModelContent content, CancellationToken cancellationToken = default) { return GenerateContentStreamAsync(new[] { content }, cancellationToken); @@ -131,7 +131,7 @@ public IAsyncEnumerable GenerateContentStreamAsync( /// The text given to the model as a prompt. /// An optional token to cancel the operation. /// A stream of generated content responses from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public IAsyncEnumerable GenerateContentStreamAsync( string text, CancellationToken cancellationToken = default) { return GenerateContentStreamAsync(new[] { ModelContent.Text(text) }, cancellationToken); @@ -142,7 +142,7 @@ public IAsyncEnumerable GenerateContentStreamAsync( /// The input given to the model as a prompt. /// An optional token to cancel the operation. /// A stream of generated content responses from the model. - /// Thrown when an error occurs during content generation. + /// Thrown when an error occurs during content generation. public IAsyncEnumerable GenerateContentStreamAsync( IEnumerable content, CancellationToken cancellationToken = default) { return GenerateContentStreamAsyncInternal(content, cancellationToken); @@ -153,7 +153,7 @@ public IAsyncEnumerable GenerateContentStreamAsync( /// /// The input given to the model as a prompt. /// The `CountTokensResponse` of running the model's tokenizer on the input. - /// Thrown when an error occurs during the request. + /// Thrown when an error occurs during the request. public Task CountTokensAsync( ModelContent content, CancellationToken cancellationToken = default) { return CountTokensAsync(new[] { content }, cancellationToken); @@ -164,7 +164,7 @@ public Task CountTokensAsync( /// The text input given to the model as a prompt. /// An optional token to cancel the operation. /// The `CountTokensResponse` of running the model's tokenizer on the input. - /// Thrown when an error occurs during the request. + /// Thrown when an error occurs during the request. public Task CountTokensAsync( string text, CancellationToken cancellationToken = default) { return CountTokensAsync(new[] { ModelContent.Text(text) }, cancellationToken); @@ -175,7 +175,7 @@ public Task CountTokensAsync( /// The input given to the model as a prompt. /// An optional token to cancel the operation. /// The `CountTokensResponse` of running the model's tokenizer on the input. - /// Thrown when an error occurs during the request. + /// Thrown when an error occurs during the request. public Task CountTokensAsync( IEnumerable content, CancellationToken cancellationToken = default) { return CountTokensAsyncInternal(content, cancellationToken); @@ -218,10 +218,10 @@ private async Task GenerateContentAsyncInternal( response = await _httpClient.SendAsync(request, cancellationToken); response.EnsureSuccessStatusCode(); } catch (TaskCanceledException e) when (e.InnerException is TimeoutException) { - throw new VertexAIRequestTimeoutException("Request timed out.", e); + throw new FirebaseAIRequestTimeoutException("Request timed out.", e); } catch (HttpRequestException e) { // TODO: Convert to a more precise exception when possible. - throw new VertexAIException("HTTP request failed.", e); + throw new FirebaseAIException("HTTP request failed.", e); } string result = await response.Content.ReadAsStringAsync(); @@ -254,10 +254,10 @@ private async IAsyncEnumerable GenerateContentStreamAsy response = await _httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken); response.EnsureSuccessStatusCode(); } catch (TaskCanceledException e) when (e.InnerException is TimeoutException) { - throw new VertexAIRequestTimeoutException("Request timed out.", e); + throw new FirebaseAIRequestTimeoutException("Request timed out.", e); } catch (HttpRequestException e) { // TODO: Convert to a more precise exception when possible. - throw new VertexAIException("HTTP request failed.", e); + throw new FirebaseAIException("HTTP request failed.", e); } // We are expecting a Stream as the response, so handle that. @@ -298,10 +298,10 @@ private async Task CountTokensAsyncInternal( response = await _httpClient.SendAsync(request, cancellationToken); response.EnsureSuccessStatusCode(); } catch (TaskCanceledException e) when (e.InnerException is TimeoutException) { - throw new VertexAIRequestTimeoutException("Request timed out.", e); + throw new FirebaseAIRequestTimeoutException("Request timed out.", e); } catch (HttpRequestException e) { // TODO: Convert to a more precise exception when possible. - throw new VertexAIException("HTTP request failed.", e); + throw new FirebaseAIException("HTTP request failed.", e); } string result = await response.Content.ReadAsStringAsync(); diff --git a/vertexai/src/GenerativeModel.cs.meta b/firebaseai/src/GenerativeModel.cs.meta similarity index 100% rename from vertexai/src/GenerativeModel.cs.meta rename to firebaseai/src/GenerativeModel.cs.meta diff --git a/vertexai/src/Internal.meta b/firebaseai/src/Internal.meta similarity index 100% rename from vertexai/src/Internal.meta rename to firebaseai/src/Internal.meta diff --git a/vertexai/src/Internal/EnumConverters.cs b/firebaseai/src/Internal/EnumConverters.cs similarity index 96% rename from vertexai/src/Internal/EnumConverters.cs rename to firebaseai/src/Internal/EnumConverters.cs index 095d49497..308cea96b 100644 --- a/vertexai/src/Internal/EnumConverters.cs +++ b/firebaseai/src/Internal/EnumConverters.cs @@ -14,7 +14,7 @@ * limitations under the License. */ -namespace Firebase.VertexAI.Internal { +namespace Firebase.FirebaseAI.Internal { // Contains extension methods for converting shared enums to strings. internal static class EnumConverters { diff --git a/vertexai/src/Internal/EnumConverters.cs.meta b/firebaseai/src/Internal/EnumConverters.cs.meta similarity index 100% rename from vertexai/src/Internal/EnumConverters.cs.meta rename to firebaseai/src/Internal/EnumConverters.cs.meta diff --git a/vertexai/src/Internal/FirebaseInterops.cs b/firebaseai/src/Internal/FirebaseInterops.cs similarity index 99% rename from vertexai/src/Internal/FirebaseInterops.cs rename to firebaseai/src/Internal/FirebaseInterops.cs index 5d8676275..e9ac3b268 100644 --- a/vertexai/src/Internal/FirebaseInterops.cs +++ b/firebaseai/src/Internal/FirebaseInterops.cs @@ -20,7 +20,7 @@ using System.Reflection; using System.Threading.Tasks; -namespace Firebase.VertexAI.Internal { +namespace Firebase.FirebaseAI.Internal { // Contains internal helper methods for interacting with other Firebase libraries. internal static class FirebaseInterops { @@ -56,7 +56,7 @@ static FirebaseInterops() { } private static void LogError(string message) { -#if FIREBASE_VERTEXAI_DEBUG_LOGGING +#if FIREBASEAI_DEBUG_LOGGING UnityEngine.Debug.LogError(message); #endif } diff --git a/vertexai/src/Internal/FirebaseInterops.cs.meta b/firebaseai/src/Internal/FirebaseInterops.cs.meta similarity index 100% rename from vertexai/src/Internal/FirebaseInterops.cs.meta rename to firebaseai/src/Internal/FirebaseInterops.cs.meta diff --git a/vertexai/src/Internal/InternalHelpers.cs b/firebaseai/src/Internal/InternalHelpers.cs similarity index 97% rename from vertexai/src/Internal/InternalHelpers.cs rename to firebaseai/src/Internal/InternalHelpers.cs index 25938e704..ad9e8b86a 100644 --- a/vertexai/src/Internal/InternalHelpers.cs +++ b/firebaseai/src/Internal/InternalHelpers.cs @@ -18,7 +18,7 @@ using System.Collections.Generic; using System.Linq; -namespace Firebase.VertexAI.Internal { +namespace Firebase.FirebaseAI.Internal { // Include this to just shorthand it in this file using JsonDict = Dictionary; @@ -36,7 +36,7 @@ internal enum JsonParseOptions { } // Contains extension methods for commonly done logic. -internal static class VertexAIExtensions { +internal static class FirebaseAIExtensions { // Tries to find the object with the key, and cast it to the type T public static bool TryParseValue(this JsonDict jsonDict, string key, @@ -59,11 +59,11 @@ public static bool TryParseValue(this JsonDict jsonDict, string key, value = (T)(object)(float)asDouble; return true; } else if (options.HasFlag(JsonParseOptions.ThrowInvalidCast)) { - throw new VertexAISerializationException( + throw new FirebaseAISerializationException( $"Invalid JSON format: '{key}' is not of type '{typeof(T).Name}'."); } } else if (options.HasFlag(JsonParseOptions.ThrowMissingKey)) { - throw new VertexAISerializationException( + throw new FirebaseAISerializationException( $"Invalid JSON format: Unable to locate expected key {key}"); } value = default; diff --git a/vertexai/src/Internal/InternalHelpers.cs.meta b/firebaseai/src/Internal/InternalHelpers.cs.meta similarity index 100% rename from vertexai/src/Internal/InternalHelpers.cs.meta rename to firebaseai/src/Internal/InternalHelpers.cs.meta diff --git a/vertexai/src/LiveGenerationConfig.cs b/firebaseai/src/LiveGenerationConfig.cs similarity index 99% rename from vertexai/src/LiveGenerationConfig.cs rename to firebaseai/src/LiveGenerationConfig.cs index 2904f5fd9..1f37a84aa 100644 --- a/vertexai/src/LiveGenerationConfig.cs +++ b/firebaseai/src/LiveGenerationConfig.cs @@ -16,9 +16,9 @@ using System.Collections.Generic; using System.Linq; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// A struct used to configure speech generation settings. diff --git a/vertexai/src/LiveGenerationConfig.cs.meta b/firebaseai/src/LiveGenerationConfig.cs.meta similarity index 100% rename from vertexai/src/LiveGenerationConfig.cs.meta rename to firebaseai/src/LiveGenerationConfig.cs.meta diff --git a/vertexai/src/LiveGenerativeModel.cs b/firebaseai/src/LiveGenerativeModel.cs similarity index 96% rename from vertexai/src/LiveGenerativeModel.cs rename to firebaseai/src/LiveGenerativeModel.cs index 48d38e02c..b2cfee50d 100644 --- a/vertexai/src/LiveGenerativeModel.cs +++ b/firebaseai/src/LiveGenerativeModel.cs @@ -21,10 +21,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; using Google.MiniJSON; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// A live, generative AI model for real-time interaction. @@ -34,7 +34,7 @@ namespace Firebase.VertexAI { /// for more details about the low-latency, two-way interactions that use text, /// audio, and video input, with audio and text output. /// -/// > Warning: For Vertex AI in Firebase, Live Model +/// > Warning: For Firebase AI, Live Model /// is in Public Preview, which means that the feature is not subject to any SLA /// or deprecation policy and could change in backwards-incompatible ways. /// @@ -51,7 +51,7 @@ public class LiveGenerativeModel { /// /// Intended for internal use only. - /// Use `VertexAI.GetLiveModel` instead to ensure proper initialization and configuration of the `LiveGenerativeModel`. + /// Use `FirebaseAI.GetLiveModel` instead to ensure proper initialization and configuration of the `LiveGenerativeModel`. /// internal LiveGenerativeModel(FirebaseApp firebaseApp, FirebaseAI.Backend backend, diff --git a/vertexai/src/LiveGenerativeModel.cs.meta b/firebaseai/src/LiveGenerativeModel.cs.meta similarity index 100% rename from vertexai/src/LiveGenerativeModel.cs.meta rename to firebaseai/src/LiveGenerativeModel.cs.meta diff --git a/vertexai/src/LiveSession.cs b/firebaseai/src/LiveSession.cs similarity index 98% rename from vertexai/src/LiveSession.cs rename to firebaseai/src/LiveSession.cs index 28e48f438..6ecae9dc8 100644 --- a/vertexai/src/LiveSession.cs +++ b/firebaseai/src/LiveSession.cs @@ -24,7 +24,7 @@ using System.Threading.Tasks; using Google.MiniJSON; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// Manages asynchronous communication with Gemini model over a WebSocket @@ -45,7 +45,7 @@ public class LiveSession : IDisposable { /// internal LiveSession(ClientWebSocket clientWebSocket) { if (clientWebSocket.State != WebSocketState.Open) { - throw new VertexAIInvalidStateException("ClientWebSocket failed to connect, can't create LiveSession."); + throw new FirebaseAIInvalidStateException("ClientWebSocket failed to connect, can't create LiveSession."); } _clientWebSocket = clientWebSocket; diff --git a/vertexai/src/LiveSession.cs.meta b/firebaseai/src/LiveSession.cs.meta similarity index 100% rename from vertexai/src/LiveSession.cs.meta rename to firebaseai/src/LiveSession.cs.meta diff --git a/vertexai/src/LiveSessionResponse.cs b/firebaseai/src/LiveSessionResponse.cs similarity index 99% rename from vertexai/src/LiveSessionResponse.cs rename to firebaseai/src/LiveSessionResponse.cs index c8d926a6e..1dcc24ac4 100644 --- a/vertexai/src/LiveSessionResponse.cs +++ b/firebaseai/src/LiveSessionResponse.cs @@ -17,12 +17,12 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using Google.MiniJSON; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; using System.Linq; using System; using System.Text; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// Represents the response from the model for live content updates. diff --git a/vertexai/src/LiveSessionResponse.cs.meta b/firebaseai/src/LiveSessionResponse.cs.meta similarity index 100% rename from vertexai/src/LiveSessionResponse.cs.meta rename to firebaseai/src/LiveSessionResponse.cs.meta diff --git a/vertexai/src/ModalityTokenCount.cs b/firebaseai/src/ModalityTokenCount.cs similarity index 97% rename from vertexai/src/ModalityTokenCount.cs rename to firebaseai/src/ModalityTokenCount.cs index 5fb67910a..3f8af6295 100644 --- a/vertexai/src/ModalityTokenCount.cs +++ b/firebaseai/src/ModalityTokenCount.cs @@ -15,9 +15,9 @@ */ using System.Collections.Generic; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// Content part modality. diff --git a/vertexai/src/ModalityTokenCount.cs.meta b/firebaseai/src/ModalityTokenCount.cs.meta similarity index 100% rename from vertexai/src/ModalityTokenCount.cs.meta rename to firebaseai/src/ModalityTokenCount.cs.meta diff --git a/vertexai/src/ModelContent.cs b/firebaseai/src/ModelContent.cs similarity index 98% rename from vertexai/src/ModelContent.cs rename to firebaseai/src/ModelContent.cs index 7d1064bea..a1206492d 100644 --- a/vertexai/src/ModelContent.cs +++ b/firebaseai/src/ModelContent.cs @@ -18,9 +18,9 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// A type describing data in media formats interpretable by an AI model. Each generative AI @@ -327,7 +327,7 @@ private static Part PartFromJson(Dictionary jsonDict) { out var inlineDataPart)) { return inlineDataPart; } else { - throw new VertexAISerializationException("Unable to parse given 'part' into a known Part."); + throw new FirebaseAISerializationException("Unable to parse given 'part' into a known Part."); } } } diff --git a/vertexai/src/ModelContent.cs.meta b/firebaseai/src/ModelContent.cs.meta similarity index 100% rename from vertexai/src/ModelContent.cs.meta rename to firebaseai/src/ModelContent.cs.meta diff --git a/vertexai/src/RequestOptions.cs b/firebaseai/src/RequestOptions.cs similarity index 98% rename from vertexai/src/RequestOptions.cs rename to firebaseai/src/RequestOptions.cs index c784c53f9..1c5db1455 100644 --- a/vertexai/src/RequestOptions.cs +++ b/firebaseai/src/RequestOptions.cs @@ -16,7 +16,7 @@ using System; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// Configuration parameters for sending requests to the backend. diff --git a/vertexai/src/RequestOptions.cs.meta b/firebaseai/src/RequestOptions.cs.meta similarity index 100% rename from vertexai/src/RequestOptions.cs.meta rename to firebaseai/src/RequestOptions.cs.meta diff --git a/vertexai/src/ResponseModality.cs b/firebaseai/src/ResponseModality.cs similarity index 95% rename from vertexai/src/ResponseModality.cs rename to firebaseai/src/ResponseModality.cs index 96526b8bb..b729374e3 100644 --- a/vertexai/src/ResponseModality.cs +++ b/firebaseai/src/ResponseModality.cs @@ -14,7 +14,7 @@ * limitations under the License. */ -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// The response type the model should return with. diff --git a/vertexai/src/ResponseModality.cs.meta b/firebaseai/src/ResponseModality.cs.meta similarity index 100% rename from vertexai/src/ResponseModality.cs.meta rename to firebaseai/src/ResponseModality.cs.meta diff --git a/vertexai/src/Safety.cs b/firebaseai/src/Safety.cs similarity index 99% rename from vertexai/src/Safety.cs rename to firebaseai/src/Safety.cs index 26c64f530..cbf0c21dc 100644 --- a/vertexai/src/Safety.cs +++ b/firebaseai/src/Safety.cs @@ -16,9 +16,9 @@ using System; using System.Collections.Generic; -using Firebase.VertexAI.Internal; +using Firebase.FirebaseAI.Internal; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// Categories describing the potential harm a piece of content may pose. diff --git a/vertexai/src/Safety.cs.meta b/firebaseai/src/Safety.cs.meta similarity index 100% rename from vertexai/src/Safety.cs.meta rename to firebaseai/src/Safety.cs.meta diff --git a/vertexai/src/Schema.cs b/firebaseai/src/Schema.cs similarity index 99% rename from vertexai/src/Schema.cs rename to firebaseai/src/Schema.cs index 846e7192d..fc24d86e1 100644 --- a/vertexai/src/Schema.cs +++ b/firebaseai/src/Schema.cs @@ -19,7 +19,7 @@ using System.Collections.ObjectModel; using System.Linq; -namespace Firebase.VertexAI { +namespace Firebase.FirebaseAI { /// /// A `Schema` object allows the definition of input and output data types. diff --git a/vertexai/src/Schema.cs.meta b/firebaseai/src/Schema.cs.meta similarity index 100% rename from vertexai/src/Schema.cs.meta rename to firebaseai/src/Schema.cs.meta diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/MainScene.unity b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/MainScene.unity similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/MainScene.unity rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/MainScene.unity diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/MainScene.unity.meta b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/MainScene.unity.meta similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/MainScene.unity.meta rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/MainScene.unity.meta diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/MainSceneAutomated.unity b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/MainSceneAutomated.unity similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/MainSceneAutomated.unity rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/MainSceneAutomated.unity diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/MainSceneAutomated.unity.meta b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/MainSceneAutomated.unity.meta similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/MainSceneAutomated.unity.meta rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/MainSceneAutomated.unity.meta diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/RedBlue.png b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/RedBlue.png similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/RedBlue.png rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/RedBlue.png diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/RedBlue.png.meta b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/RedBlue.png.meta similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/RedBlue.png.meta rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/RedBlue.png.meta diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandler.cs b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandler.cs similarity index 99% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandler.cs rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandler.cs index 05cacce18..69a0aa432 100644 --- a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandler.cs +++ b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandler.cs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -namespace Firebase.Sample.VertexAI { +namespace Firebase.Sample.FirebaseAI { using Firebase; using Firebase.Extensions; using System; diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandler.cs.meta b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandler.cs.meta similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandler.cs.meta rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandler.cs.meta diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandlerAutomated.cs b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandlerAutomated.cs similarity index 99% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandlerAutomated.cs rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandlerAutomated.cs index 3dd42c1b1..b3612c199 100644 --- a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandlerAutomated.cs +++ b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandlerAutomated.cs @@ -15,10 +15,10 @@ // Uncomment to include logic to sign in to Auth as part of the tests //#define INCLUDE_FIREBASE_AUTH -namespace Firebase.Sample.VertexAI { +namespace Firebase.Sample.FirebaseAI { using Firebase; using Firebase.Extensions; - using Firebase.VertexAI; + using Firebase.FirebaseAI; using System; using System.Collections.Generic; using System.Linq; @@ -30,7 +30,7 @@ namespace Firebase.Sample.VertexAI { using Firebase.Auth; #endif - // An automated version of the UIHandler that runs tests on Vertex AI in Firebase. + // An automated version of the UIHandler that runs tests on Firebase AI. public class UIHandlerAutomated : UIHandler { // Delegate which validates a completed task. delegate Task TaskValidationDelegate(Task task); @@ -720,7 +720,7 @@ async Task TestReadSecureFile() { response.Text.Contains("mushroom", StringComparison.OrdinalIgnoreCase)); } #if !INCLUDE_FIREBASE_AUTH - catch (VertexAIException ex) { + catch (FirebaseAIException ex) { AssertEq("Expected InnerException", ex.InnerException.GetType(), typeof(HttpRequestException)); // TODO: Improve how Http errors are passed back to users. Assert("Missing Http Status Code 403", (ex.InnerException as HttpRequestException).Message.Contains("403")); diff --git a/vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandlerAutomated.cs.meta b/firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandlerAutomated.cs.meta similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/VertexAI/UIHandlerAutomated.cs.meta rename to firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandlerAutomated.cs.meta diff --git a/vertexai/testapp/Assets/Firebase/Sample/GuiSkin.guiskin b/firebaseai/testapp/Assets/Firebase/Sample/GuiSkin.guiskin similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/GuiSkin.guiskin rename to firebaseai/testapp/Assets/Firebase/Sample/GuiSkin.guiskin diff --git a/vertexai/testapp/Assets/Firebase/Sample/GuiSkin.guiskin.meta b/firebaseai/testapp/Assets/Firebase/Sample/GuiSkin.guiskin.meta similarity index 100% rename from vertexai/testapp/Assets/Firebase/Sample/GuiSkin.guiskin.meta rename to firebaseai/testapp/Assets/Firebase/Sample/GuiSkin.guiskin.meta diff --git a/vertexai/testapp/Assets/Plugins/Android/GameLoops.androidlib/AndroidManifest.xml b/firebaseai/testapp/Assets/Plugins/Android/GameLoops.androidlib/AndroidManifest.xml similarity index 100% rename from vertexai/testapp/Assets/Plugins/Android/GameLoops.androidlib/AndroidManifest.xml rename to firebaseai/testapp/Assets/Plugins/Android/GameLoops.androidlib/AndroidManifest.xml diff --git a/vertexai/testapp/Assets/Plugins/Android/GameLoops.androidlib/AndroidManifest.xml.meta b/firebaseai/testapp/Assets/Plugins/Android/GameLoops.androidlib/AndroidManifest.xml.meta similarity index 100% rename from vertexai/testapp/Assets/Plugins/Android/GameLoops.androidlib/AndroidManifest.xml.meta rename to firebaseai/testapp/Assets/Plugins/Android/GameLoops.androidlib/AndroidManifest.xml.meta diff --git a/vertexai/testapp/Assets/Plugins/Android/GameLoops.androidlib/project.properties b/firebaseai/testapp/Assets/Plugins/Android/GameLoops.androidlib/project.properties similarity index 100% rename from vertexai/testapp/Assets/Plugins/Android/GameLoops.androidlib/project.properties rename to firebaseai/testapp/Assets/Plugins/Android/GameLoops.androidlib/project.properties diff --git a/vertexai/testapp/Assets/Plugins/Android/GameLoops.androidlib/project.properties.meta b/firebaseai/testapp/Assets/Plugins/Android/GameLoops.androidlib/project.properties.meta similarity index 100% rename from vertexai/testapp/Assets/Plugins/Android/GameLoops.androidlib/project.properties.meta rename to firebaseai/testapp/Assets/Plugins/Android/GameLoops.androidlib/project.properties.meta diff --git a/vertexai/testapp/ProjectSettings/AudioManager.asset b/firebaseai/testapp/ProjectSettings/AudioManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/AudioManager.asset rename to firebaseai/testapp/ProjectSettings/AudioManager.asset diff --git a/vertexai/testapp/ProjectSettings/ClusterInputManager.asset b/firebaseai/testapp/ProjectSettings/ClusterInputManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/ClusterInputManager.asset rename to firebaseai/testapp/ProjectSettings/ClusterInputManager.asset diff --git a/vertexai/testapp/ProjectSettings/DynamicsManager.asset b/firebaseai/testapp/ProjectSettings/DynamicsManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/DynamicsManager.asset rename to firebaseai/testapp/ProjectSettings/DynamicsManager.asset diff --git a/vertexai/testapp/ProjectSettings/EditorBuildSettings.asset b/firebaseai/testapp/ProjectSettings/EditorBuildSettings.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/EditorBuildSettings.asset rename to firebaseai/testapp/ProjectSettings/EditorBuildSettings.asset diff --git a/vertexai/testapp/ProjectSettings/EditorSettings.asset b/firebaseai/testapp/ProjectSettings/EditorSettings.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/EditorSettings.asset rename to firebaseai/testapp/ProjectSettings/EditorSettings.asset diff --git a/vertexai/testapp/ProjectSettings/GraphicsSettings.asset b/firebaseai/testapp/ProjectSettings/GraphicsSettings.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/GraphicsSettings.asset rename to firebaseai/testapp/ProjectSettings/GraphicsSettings.asset diff --git a/vertexai/testapp/ProjectSettings/InputManager.asset b/firebaseai/testapp/ProjectSettings/InputManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/InputManager.asset rename to firebaseai/testapp/ProjectSettings/InputManager.asset diff --git a/vertexai/testapp/ProjectSettings/NavMeshAreas.asset b/firebaseai/testapp/ProjectSettings/NavMeshAreas.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/NavMeshAreas.asset rename to firebaseai/testapp/ProjectSettings/NavMeshAreas.asset diff --git a/vertexai/testapp/ProjectSettings/NetworkManager.asset b/firebaseai/testapp/ProjectSettings/NetworkManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/NetworkManager.asset rename to firebaseai/testapp/ProjectSettings/NetworkManager.asset diff --git a/vertexai/testapp/ProjectSettings/PackageManagerSettings.asset b/firebaseai/testapp/ProjectSettings/PackageManagerSettings.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/PackageManagerSettings.asset rename to firebaseai/testapp/ProjectSettings/PackageManagerSettings.asset diff --git a/vertexai/testapp/ProjectSettings/Physics2DSettings.asset b/firebaseai/testapp/ProjectSettings/Physics2DSettings.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/Physics2DSettings.asset rename to firebaseai/testapp/ProjectSettings/Physics2DSettings.asset diff --git a/vertexai/testapp/ProjectSettings/PresetManager.asset b/firebaseai/testapp/ProjectSettings/PresetManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/PresetManager.asset rename to firebaseai/testapp/ProjectSettings/PresetManager.asset diff --git a/vertexai/testapp/ProjectSettings/ProjectSettings.asset b/firebaseai/testapp/ProjectSettings/ProjectSettings.asset similarity index 98% rename from vertexai/testapp/ProjectSettings/ProjectSettings.asset rename to firebaseai/testapp/ProjectSettings/ProjectSettings.asset index 1058f2b18..a302682d4 100644 --- a/vertexai/testapp/ProjectSettings/ProjectSettings.asset +++ b/firebaseai/testapp/ProjectSettings/ProjectSettings.asset @@ -13,7 +13,7 @@ PlayerSettings: useOnDemandResources: 0 accelerometerFrequency: 60 companyName: Google - productName: Vertex AI in Firebase Unity Testapp + productName: Firebase AI Unity Testapp defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.12156863, g: 0.12156863, b: 0.1254902, a: 1} @@ -158,11 +158,11 @@ PlayerSettings: androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 applicationIdentifier: - Android: com.google.firebase.unity.vertexai.testapp - Standalone: unity.Google.Vertex AI in Firebase Unity Testapp - Tizen: com.google.firebase.unity.vertexai.testapp - iPhone: com.google.firebase.unity.vertexai.testapp - tvOS: com.google.firebase.unity.vertexai.testapp + Android: com.google.firebase.unity.firebaseai.testapp + Standalone: unity.Google.Firebase AI Unity Testapp + Tizen: com.google.firebase.unity.firebaseai.testapp + iPhone: com.google.firebase.unity.firebaseai.testapp + tvOS: com.google.firebase.unity.firebaseai.testapp buildNumber: Standalone: 0 iPhone: 0 diff --git a/vertexai/testapp/ProjectSettings/ProjectVersion.txt b/firebaseai/testapp/ProjectSettings/ProjectVersion.txt similarity index 100% rename from vertexai/testapp/ProjectSettings/ProjectVersion.txt rename to firebaseai/testapp/ProjectSettings/ProjectVersion.txt diff --git a/vertexai/testapp/ProjectSettings/QualitySettings.asset b/firebaseai/testapp/ProjectSettings/QualitySettings.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/QualitySettings.asset rename to firebaseai/testapp/ProjectSettings/QualitySettings.asset diff --git a/vertexai/testapp/ProjectSettings/TagManager.asset b/firebaseai/testapp/ProjectSettings/TagManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/TagManager.asset rename to firebaseai/testapp/ProjectSettings/TagManager.asset diff --git a/vertexai/testapp/ProjectSettings/TimeManager.asset b/firebaseai/testapp/ProjectSettings/TimeManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/TimeManager.asset rename to firebaseai/testapp/ProjectSettings/TimeManager.asset diff --git a/vertexai/testapp/ProjectSettings/UnityConnectSettings.asset b/firebaseai/testapp/ProjectSettings/UnityConnectSettings.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/UnityConnectSettings.asset rename to firebaseai/testapp/ProjectSettings/UnityConnectSettings.asset diff --git a/vertexai/testapp/ProjectSettings/VFXManager.asset b/firebaseai/testapp/ProjectSettings/VFXManager.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/VFXManager.asset rename to firebaseai/testapp/ProjectSettings/VFXManager.asset diff --git a/vertexai/testapp/ProjectSettings/XRSettings.asset b/firebaseai/testapp/ProjectSettings/XRSettings.asset similarity index 100% rename from vertexai/testapp/ProjectSettings/XRSettings.asset rename to firebaseai/testapp/ProjectSettings/XRSettings.asset diff --git a/vertexai/testapp/readme.md b/firebaseai/testapp/readme.md similarity index 91% rename from vertexai/testapp/readme.md rename to firebaseai/testapp/readme.md index de17a0bb7..ab7aac05e 100644 --- a/vertexai/testapp/readme.md +++ b/firebaseai/testapp/readme.md @@ -1,7 +1,7 @@ -# Vertex AI in Firebase Quickstart +# Firebase AI Quickstart -The Vertex AI in Firebase Unity Sample demonstrates the -[Vertex AI in Firebase SDK](https://firebase.google.com/docs/vertex-ai) +The Firebase AI Unity Sample demonstrates the +[Firebase AI SDK](https://firebase.google.com/docs/vertex-ai) with the [Firebase Unity SDK](https://firebase.google.com/docs/unity/setup) inside the Unity Editor. @@ -27,12 +27,12 @@ inside the Unity Editor. - You might be prompted to upgrade the project to your version of Unity. Click `Confirm` to upgrade the project and continue. - Open the scene `MainScene`. - - Navigate to `Assets/Firebase/Sample/VertexAI` in the `Project` window. + - Navigate to `Assets/Firebase/Sample/FirebaseAI` in the `Project` window. - Double click on the `MainScene` file to open it. - - Import the `Vertex AI in Firebase` plugin. + - Import the `Firebase AI` plugin. - Select the **Assets > Import Package > Custom Package** menu item. - From the [Firebase Unity SDK](https://firebase.google.com/download/unity) - downloaded previously, import `FirebaseVertexAI.unitypackage`. + downloaded previously, import `FirebaseAI.unitypackage`. - When the **Import Unity Package** window appears, click the **Import** button. @@ -46,20 +46,20 @@ Once you have done this, you can run the Unity Editor and test the application. - Create a project in the [Firebase console](https://firebase.google.com/console/), and associate your iOS application. - - You should use `com.google.firebase.unity.vertexai.testapp` as the + - You should use `com.google.firebase.unity.firebaseai.testapp` as the iOS bundle ID when creating the Firebase iOS app in the console. - If you do not use the prescribed Bundle ID, you will later need to update the bundle identifier in Unity as described in `Optional: Update the Project Bundle Identifier` below. - Add the `GoogleService-Info.plist` file to the project. - - Navigate to the `Assets/Firebase/Sample/VertexAI` folder in the `Project` + - Navigate to the `Assets/Firebase/Sample/FirebaseAI` folder in the `Project` window. - Drag the `GoogleService-Info.plist` downloaded from the Firebase console into the folder. - NOTE: `GoogleService-Info.plist` can be placed anywhere under the `Assets` folder. - Optional: Update the Project Bundle Identifier - - If you did not use `com.google.firebase.unity.vertexai.testapp` + - If you did not use `com.google.firebase.unity.firebaseai.testapp` as the iOS bundle ID when creating your app in the Firebase Console then you will need to update the sample's Bundle Identifier. @@ -83,7 +83,7 @@ Once you have done this, you can run the Unity Editor and test the application. - Create a project in the [Firebase console](https://firebase.google.com/console/), and attach your Android app to it. - - You should use `com.google.firebase.unity.vertexai.testapp` as the + - You should use `com.google.firebase.unity.firebaseai.testapp` as the Android package name while you're testing. - If you do not use the prescribed package name, you will need to update the bundle identifier as described in the @@ -118,14 +118,14 @@ Once you have done this, you can run the Unity Editor and test the application. [general instructions](https://firebase.google.com/docs/android/setup) which describes how to configure a Firebase application for Android. - Add the `google-services.json` file to the project. - - Navigate to the `Assets/Firebase/Sample/VertexAI` folder in the `Project` + - Navigate to the `Assets/Firebase/Sample/FirebaseAI` folder in the `Project` window. - Drag the `google-services.json` downloaded from the Firebase console into the folder. - NOTE: `google-services.json` can be placed anywhere under the `Assets` folder. - Optional: Update the Project Bundle Identifier - - If you did not use `com.google.firebase.unity.vertexai.testapp` + - If you did not use `com.google.firebase.unity.firebaseai.testapp` as the `Android package name` when you created your app in the Firebase Console, you will need to update the sample's Bundle Identifier. - Select the `File > Build Settings` menu option. diff --git a/proxy/AssemblyInfoApp.cs b/proxy/AssemblyInfoApp.cs index b93dde4dc..dd3c11326 100644 --- a/proxy/AssemblyInfoApp.cs +++ b/proxy/AssemblyInfoApp.cs @@ -55,7 +55,7 @@ [assembly: InternalsVisibleTo("Firebase.Storage.Testing")] [assembly: InternalsVisibleTo("Firebase.TestLab")] [assembly: InternalsVisibleTo("Firebase.TestLab.GameLoop")] -[assembly: InternalsVisibleTo("Firebase.VertexAI")] +[assembly: InternalsVisibleTo("Firebase.FirebaseAI")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and diff --git a/release_build_files/CMakeLists.txt b/release_build_files/CMakeLists.txt index 27c9877ac..45c4dfcdb 100644 --- a/release_build_files/CMakeLists.txt +++ b/release_build_files/CMakeLists.txt @@ -86,6 +86,6 @@ unity_pack_file( ) unity_pack_file( - "${FIREBASE_UNITY_DIR}/docs/vertexai/VertexAIReadme.md" + "${FIREBASE_UNITY_DIR}/docs/firebaseai/FirebaseAIReadme.md" PACK_PATH "Firebase/Editor" ) diff --git a/scripts/build_scripts/build_package.py b/scripts/build_scripts/build_package.py index 338eeb806..ee68a3909 100644 --- a/scripts/build_scripts/build_package.py +++ b/scripts/build_scripts/build_package.py @@ -43,7 +43,7 @@ SUPPORT_TARGETS = [ "analytics", "app_check", "auth", "crashlytics", "database", "dynamic_links", "firestore", "functions", "installations", "messaging", "remote_config", - "storage", "vertexai" + "storage", "firebaseai" ] FLAGS = flags.FLAGS diff --git a/scripts/build_scripts/build_zips.py b/scripts/build_scripts/build_zips.py index 074d971b7..f764072fb 100644 --- a/scripts/build_scripts/build_zips.py +++ b/scripts/build_scripts/build_zips.py @@ -34,12 +34,12 @@ SUPPORT_TARGETS = [ "analytics", "app_check", "auth", "crashlytics", "database", "dynamic_links", "firestore", "functions", "installations", "messaging", "remote_config", - "storage", "vertexai" + "storage", "firebaseai" ] TVOS_SUPPORT_TARGETS = [ "analytics", "app_check", "auth", "crashlytics", "database", "firestore", "functions", "installations", "messaging", "remote_config", "storage", - "vertexai" + "firebaseai" ] SUPPORT_DEVICE = ["device", "simulator"] diff --git a/scripts/create_debug_export.py b/scripts/create_debug_export.py index 3c73cac87..e4141ad27 100644 --- a/scripts/create_debug_export.py +++ b/scripts/create_debug_export.py @@ -41,7 +41,7 @@ "messaging": "FirebaseMessaging.unitypackage", "remote_config": "FirebaseRemoteConfig.unitypackage", "storage": "FirebaseStorage.unitypackage", - "vertexai": "FirebaseVertexAI.unitypackage", + "firebaseai": "FirebaseAI.unitypackage", } default_package_names = [ diff --git a/scripts/gha-encrypted/firebaseai/GoogleService-Info.plist.gpg b/scripts/gha-encrypted/firebaseai/GoogleService-Info.plist.gpg new file mode 100644 index 000000000..4733b514f Binary files /dev/null and b/scripts/gha-encrypted/firebaseai/GoogleService-Info.plist.gpg differ diff --git a/scripts/gha-encrypted/firebaseai/google-services.json.gpg b/scripts/gha-encrypted/firebaseai/google-services.json.gpg new file mode 100644 index 000000000..8589ac4d4 Binary files /dev/null and b/scripts/gha-encrypted/firebaseai/google-services.json.gpg differ diff --git a/scripts/gha-encrypted/vertexai/GoogleService-Info.plist.gpg b/scripts/gha-encrypted/vertexai/GoogleService-Info.plist.gpg deleted file mode 100644 index 9d73a8b16..000000000 Binary files a/scripts/gha-encrypted/vertexai/GoogleService-Info.plist.gpg and /dev/null differ diff --git a/scripts/gha-encrypted/vertexai/google-services.json.gpg b/scripts/gha-encrypted/vertexai/google-services.json.gpg deleted file mode 100644 index 81cc21296..000000000 Binary files a/scripts/gha-encrypted/vertexai/google-services.json.gpg and /dev/null differ diff --git a/scripts/gha/integration_testing/build_testapps.json b/scripts/gha/integration_testing/build_testapps.json index 3580c1213..f96620a96 100644 --- a/scripts/gha/integration_testing/build_testapps.json +++ b/scripts/gha/integration_testing/build_testapps.json @@ -216,20 +216,20 @@ ] }, { - "name": "vertexai", - "full_name": "FirebaseVertexAI", - "captial_name": "VertexAI", - "bundle_id": "com.google.firebase.unity.vertexai.testapp", - "testapp_path": "vertexai/testapp", + "name": "firebaseai", + "full_name": "FirebaseAI", + "captial_name": "FirebaseAI", + "bundle_id": "com.google.firebase.unity.firebaseai.testapp", + "testapp_path": "firebaseai/testapp", "platforms": ["Android", "Playmode", "iOS", "tvOS", "Windows", "macOS", "Linux"], "plugins": [ - "FirebaseVertexAI.unitypackage" + "FirebaseAI.unitypackage" ], "provision": "Firebase_Dev_Wildcard.mobileprovision", "upm_packages": [ "com.google.external-dependency-manager-*.tgz", "com.google.firebase.app-*.tgz", - "com.google.firebase.vertexai-*.tgz" + "com.google.firebase.firebaseai-*.tgz" ] } ], diff --git a/scripts/gha/restore_secrets.py b/scripts/gha/restore_secrets.py index e0441f059..f076c869b 100644 --- a/scripts/gha/restore_secrets.py +++ b/scripts/gha/restore_secrets.py @@ -64,7 +64,7 @@ "messaging": "Messaging", "remote_config": "RemoteConfig", "storage": "Storage", - "vertexai": "VertexAI" + "firebaseai": "FirebaseAI" } diff --git a/unity_packer/debug_single_export_json/vertexai.json b/unity_packer/debug_single_export_json/firebaseai.json similarity index 94% rename from unity_packer/debug_single_export_json/vertexai.json rename to unity_packer/debug_single_export_json/firebaseai.json index 592f941e5..9654a7e8a 100644 --- a/unity_packer/debug_single_export_json/vertexai.json +++ b/unity_packer/debug_single_export_json/firebaseai.json @@ -212,12 +212,12 @@ "export": 0 }, { - "name": "FirebaseVertexAI.unitypackage", + "name": "FirebaseAI.unitypackage", "imports": [ { "importer": "DefaultImporter", "paths": [ - "Firebase/VertexAI/*" + "Firebase/FirebaseAI/*" ] }, { @@ -227,7 +227,7 @@ "documentation" ], "paths": [ - "Firebase/Editor/VertexAIReadme.md" + "Firebase/Editor/FirebaseAIReadme.md" ] } ], @@ -236,20 +236,21 @@ "SampleCommon.unitypackage" ], "manifest_path": "Firebase/Editor", - "readme": "Firebase/Editor/VertexAIReadme.md", + "readme": "Firebase/Editor/FirebaseAIReadme.md", "changelog": "Firebase/Editor/readme.md", "license": "Firebase/Editor/LICENSE", - "documentation": "Firebase/Editor/VertexAIReadme.md", + "documentation": "Firebase/Editor/FirebaseAIReadme.md", "common_manifest": { - "name": "com.google.firebase.vertexai", - "display_name": "Vertex AI in Firebase", + "name": "com.google.firebase.firebaseai", + "display_name": "Firebase AI", "description": [ "Build AI-powered mobile and web apps and features with ", - "the Gemini API using Vertex AI in Firebase." + "the Gemini API using Firebase AI." ], "keywords": [ "Google", "Firebase", + "Firebase AI", "Vertex AI" ], "author": { diff --git a/unity_packer/guids.json b/unity_packer/guids.json index 7e581f847..977f940f0 100644 --- a/unity_packer/guids.json +++ b/unity_packer/guids.json @@ -1389,6 +1389,7 @@ "Firebase/m2repository/com/google/firebase/firebase-storage-unity/12.4.1/firebase-storage-unity-12.4.1.srcaar": "385a2672c4a445e088d8d40eac29016b" }, "12.5.0": { + "Firebase/Editor/FirebaseAI_version-12.5.0_manifest.txt": "aff68d4dbbcf4a65892205825ae01dfa", "Firebase/Editor/FirebaseAnalytics_version-12.5.0_manifest.txt": "55b6f53c2ade4b0ebcada450cac551cf", "Firebase/Editor/FirebaseAppCheck_version-12.5.0_manifest.txt": "cd03d9ba3dd2465e80a3ad277f9e8ed3", "Firebase/Editor/FirebaseAuth_version-12.5.0_manifest.txt": "57de507988e34891bd932e13217b6c26", @@ -1401,9 +1402,8 @@ "Firebase/Editor/FirebaseMessaging_version-12.5.0_manifest.txt": "fdf5d2bb0f9d4f0ba42e38b1f5c6b102", "Firebase/Editor/FirebaseRemoteConfig_version-12.5.0_manifest.txt": "2d1a5b051f1a452e9eb8afaa9799e48f", "Firebase/Editor/FirebaseStorage_version-12.5.0_manifest.txt": "94536946ac944e639dd690b9828a5314", - "Firebase/Editor/FirebaseVertexAI_version-12.5.0_manifest.txt": "aff68d4dbbcf4a65892205825ae01dfa", - "Firebase/Plugins/Firebase.VertexAI.dll": "7c23ae13d705434895cb14976926117b", - "Firebase/Plugins/Firebase.VertexAI.pdb": "01edb10da18a4975af2cc8f7a6de5e5d", + "Firebase/Plugins/Firebase.FirebaseAI.dll": "7c23ae13d705434895cb14976926117b", + "Firebase/Plugins/Firebase.FirebaseAI.pdb": "01edb10da18a4975af2cc8f7a6de5e5d", "Firebase/Plugins/x86_64/FirebaseCppApp-12_5_0.bundle": "60898de491fb4a168588dfa7b0c24942", "Firebase/Plugins/x86_64/FirebaseCppApp-12_5_0.dll": "f25775ec30db485e86377f6898623aca", "Firebase/Plugins/x86_64/FirebaseCppApp-12_5_0.so": "ca2abf1d7ed145289e902d62c88972d4", @@ -1435,6 +1435,7 @@ "Firebase/m2repository/com/google/firebase/firebase-storage-unity/12.5.0/firebase-storage-unity-12.5.0.srcaar": "28f0c91bfac84256801162c98ab5ed13" }, "12.6.0": { + "Firebase/Editor/FirebaseAI_version-12.6.0_manifest.txt": "6630aa2768c0440fa3342b651f86a5b9", "Firebase/Editor/FirebaseAnalytics_version-12.6.0_manifest.txt": "a9558199de05437e928a59482870887d", "Firebase/Editor/FirebaseAppCheck_version-12.6.0_manifest.txt": "92fdcfc1b5794e309077fff307cc8526", "Firebase/Editor/FirebaseAuth_version-12.6.0_manifest.txt": "21c2ac7b18b44f539ac01af3102f80a5", @@ -1447,7 +1448,6 @@ "Firebase/Editor/FirebaseMessaging_version-12.6.0_manifest.txt": "d5aaf7c0403641909284833b31b7ada1", "Firebase/Editor/FirebaseRemoteConfig_version-12.6.0_manifest.txt": "d7076b87cc7b4b9c843819e06a4ef261", "Firebase/Editor/FirebaseStorage_version-12.6.0_manifest.txt": "37a9eeed2d41464eba14e6dffbfa2481", - "Firebase/Editor/FirebaseVertexAI_version-12.6.0_manifest.txt": "6630aa2768c0440fa3342b651f86a5b9", "Firebase/Plugins/x86_64/FirebaseCppApp-12_6_0.bundle": "5e7beea9b436402a98eb39f3588f546a", "Firebase/Plugins/x86_64/FirebaseCppApp-12_6_0.dll": "8797c3e68bd04185911320f56bd85f41", "Firebase/Plugins/x86_64/FirebaseCppApp-12_6_0.so": "8cf5d226b6f24739a7f84ef8351c274e", @@ -1522,6 +1522,7 @@ "Firebase/m2repository/com/google/firebase/firebase-storage-unity/12.7.0/firebase-storage-unity-12.7.0.srcaar": "6e8ba462efc34c4ba45b699fb21edc68" }, "12.8.0": { + "Firebase/Editor/FirebaseAI_version-12.8.0_manifest.txt": "5316bc71db7647c0be120d684e7023b9", "Firebase/Editor/FirebaseAnalytics_version-12.8.0_manifest.txt": "a4e8e6cc224a43209c603e3759695835", "Firebase/Editor/FirebaseAppCheck_version-12.8.0_manifest.txt": "1581f56d605b4387a35bbde19de0ac87", "Firebase/Editor/FirebaseAuth_version-12.8.0_manifest.txt": "d9ddf1d55a4449e5b420ff57624c9eac", diff --git a/vertexai/src/VertexAIException.cs b/vertexai/src/VertexAIException.cs deleted file mode 100644 index 8d9f378f0..000000000 --- a/vertexai/src/VertexAIException.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2025 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 - * - * http://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. - */ - -using System; -using System.Linq; - -namespace Firebase.VertexAI { - -public class VertexAIException : Exception { - internal VertexAIException(string message) : base(message) { } - - internal VertexAIException(string message, Exception exception) : base(message, exception) { } -} - -public class VertexAISerializationException : VertexAIException { - internal VertexAISerializationException(string message) : base(message) { } - - internal VertexAISerializationException(string message, Exception exception) : base(message, exception) { } -} - -public class VertexAIServerException : VertexAIException { - internal VertexAIServerException(string message) : base(message) { } -} - -public class VertexAIInvalidAPIKeyException : VertexAIException { - internal VertexAIInvalidAPIKeyException(string message) : base(message) { } -} - -public class VertexAIPromptBlockedException : VertexAIException { - internal VertexAIPromptBlockedException(GenerateContentResponse response) : - base("Prompt was blocked:" + - $"{response.PromptFeedback?.BlockReason?.ToString() ?? "Unknown"}") { } -} - -public class VertexAIUnsupportedUserLocationException : VertexAIException { - internal VertexAIUnsupportedUserLocationException() : - base("User location is not supported for the API use.") { } -} - -public class VertexAIInvalidStateException : VertexAIException { - internal VertexAIInvalidStateException(string message) : base(message) { } -} - -public class VertexAIResponseStoppedException : VertexAIException { - internal VertexAIResponseStoppedException(GenerateContentResponse response) : - base("Content generation stopped. Reason: " + - $"{response.Candidates.FirstOrDefault().FinishReason?.ToString() ?? "Unknown"}") { } -} - -public class VertexAIRequestTimeoutException : VertexAIException { - internal VertexAIRequestTimeoutException(string message) : base(message) { } - - internal VertexAIRequestTimeoutException(string message, Exception e) : base(message, e) { } -} - -public class VertexAIInvalidLocationException : VertexAIException { - internal VertexAIInvalidLocationException(string location) : - base($"Invalid location \"{location}\"") { } -} - -public class VertexAIServiceDisabledException : VertexAIException { - internal VertexAIServiceDisabledException(string message) : base(message) { } -} - -public class VertexAIUnknownException : VertexAIException { - internal VertexAIUnknownException(string message) : base(message) { } -} - -}