Skip to content

Commit 95c625b

Browse files
authored
[FirebaseAI] Rename VertexAI to FirebaseAI (#1243)
* [FirebaseAI] Rename VertexAI to FirebaseAI * Update guids.json * Update build_testapps.json * Update secrets, use firebaseai for testapp
1 parent f835c5d commit 95c625b

File tree

102 files changed

+236
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+236
-234
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ option(FIREBASE_INCLUDE_REMOTE_CONFIG
6969
option(FIREBASE_INCLUDE_STORAGE
7070
"Include the Cloud Storage for Firebase library."
7171
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
72-
option(FIREBASE_INCLUDE_VERTEXAI
73-
"Include the Vertex AI in Firebase library."
72+
option(FIREBASE_INCLUDE_FIREBASEAI
73+
"Include the Firebase AI library."
7474
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
7575

7676
option(FIREBASE_INCLUDE_EDITOR_TOOL
@@ -345,8 +345,8 @@ if (FIREBASE_INCLUDE_STORAGE)
345345
list(APPEND DOCUMENTATION_ONLY_LIB_NAMES "firebase_storage_swig")
346346
list(APPEND PROJECT_LIST_HEADER " X(Storage)")
347347
endif()
348-
if (FIREBASE_INCLUDE_VERTEXAI)
349-
add_subdirectory(vertexai)
348+
if (FIREBASE_INCLUDE_FIREBASEAI)
349+
add_subdirectory(firebaseai)
350350
# Doesn't use swig, so don't need to update the other lists
351351
endif()
352352

app/platform/Unity/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
[assembly: InternalsVisibleTo("Firebase.TaskExtension")]
4848
[assembly: InternalsVisibleTo("Firebase.TestLab")]
4949
[assembly: InternalsVisibleTo("Firebase.TestLab.GameLoop")]
50-
[assembly: InternalsVisibleTo("Firebase.VertexAI")]
50+
[assembly: InternalsVisibleTo("Firebase.FirebaseAI")]
5151

5252

5353
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".

docs/vertexai/VertexAIReadme.md renamed to docs/firebaseai/FirebaseAIReadme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Get Started with Vertex AI in Firebase
1+
Get Started with Firebase AI
22
===========================================
33

4-
Thank you for installing the Vertex AI in Firebase Unity SDK.
4+
Thank you for installing the Firebase AI Unity SDK.
55

6-
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.
6+
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.
77

88
With this, you can add AI personalization to your app, build an AI chat experience, create AI-powered optimizations and automation, and much more!
99

vertexai/CMakeLists.txt renamed to firebaseai/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# CMake file for the Vertex AI in Firebase library
15+
# CMake file for the Firebase AI library
1616

17-
# Vertex AI in Firebase is different from the other Firebase libraries,
17+
# Firebase AI is different from the other Firebase libraries,
1818
# as instead of prebuilding, we provide it as a source library.
1919

2020
# Package every file under src, including subfolders, since we want them all.
2121
unity_pack_folder(
22-
"${FIREBASE_UNITY_DIR}/vertexai/src/"
23-
PACK_PATH "Firebase/VertexAI"
22+
"${FIREBASE_UNITY_DIR}/firebaseai/src/"
23+
PACK_PATH "Firebase/FirebaseAI"
2424
)
2525

2626
# For documentation, get only the C# files at the top level,
2727
# which make up the public API.
28-
file(GLOB firebase_vertexai_doc_src "src/*.cs")
29-
unity_pack_documentation_sources(vertexai
28+
file(GLOB firebase_firebaseai_doc_src "src/*.cs")
29+
unity_pack_documentation_sources(firebaseai
3030
DOCUMENTATION_SOURCES
31-
${firebase_vertexai_src}
31+
${firebase_firebaseai_src}
3232
)

vertexai/src/Candidate.cs renamed to firebaseai/src/Candidate.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
using System.Collections.Generic;
1919
using System.Collections.ObjectModel;
2020
using System.Linq;
21-
using Firebase.VertexAI.Internal;
21+
using Firebase.FirebaseAI.Internal;
2222

23-
namespace Firebase.VertexAI {
23+
namespace Firebase.FirebaseAI {
2424

2525
/// <summary>
2626
/// Represents the reason why the model stopped generating content.
@@ -108,16 +108,16 @@ private Candidate(ModelContent content, List<SafetyRating> safetyRatings,
108108

109109
private static FinishReason ParseFinishReason(string str) {
110110
return str switch {
111-
"STOP" => Firebase.VertexAI.FinishReason.Stop,
112-
"MAX_TOKENS" => Firebase.VertexAI.FinishReason.MaxTokens,
113-
"SAFETY" => Firebase.VertexAI.FinishReason.Safety,
114-
"RECITATION" => Firebase.VertexAI.FinishReason.Recitation,
115-
"OTHER" => Firebase.VertexAI.FinishReason.Other,
116-
"BLOCKLIST" => Firebase.VertexAI.FinishReason.Blocklist,
117-
"PROHIBITED_CONTENT" => Firebase.VertexAI.FinishReason.ProhibitedContent,
118-
"SPII" => Firebase.VertexAI.FinishReason.SPII,
119-
"MALFORMED_FUNCTION_CALL" => Firebase.VertexAI.FinishReason.MalformedFunctionCall,
120-
_ => Firebase.VertexAI.FinishReason.Unknown,
111+
"STOP" => Firebase.FirebaseAI.FinishReason.Stop,
112+
"MAX_TOKENS" => Firebase.FirebaseAI.FinishReason.MaxTokens,
113+
"SAFETY" => Firebase.FirebaseAI.FinishReason.Safety,
114+
"RECITATION" => Firebase.FirebaseAI.FinishReason.Recitation,
115+
"OTHER" => Firebase.FirebaseAI.FinishReason.Other,
116+
"BLOCKLIST" => Firebase.FirebaseAI.FinishReason.Blocklist,
117+
"PROHIBITED_CONTENT" => Firebase.FirebaseAI.FinishReason.ProhibitedContent,
118+
"SPII" => Firebase.FirebaseAI.FinishReason.SPII,
119+
"MALFORMED_FUNCTION_CALL" => Firebase.FirebaseAI.FinishReason.MalformedFunctionCall,
120+
_ => Firebase.FirebaseAI.FinishReason.Unknown,
121121
};
122122
}
123123

@@ -132,7 +132,7 @@ internal static Candidate FromJson(Dictionary<string, object> jsonDict,
132132
jsonDict.ParseObjectList("safetyRatings", SafetyRating.FromJson),
133133
jsonDict.ParseNullableEnum("finishReason", ParseFinishReason),
134134
jsonDict.ParseNullableObject("citationMetadata",
135-
(d) => Firebase.VertexAI.CitationMetadata.FromJson(d, backend)));
135+
(d) => Firebase.FirebaseAI.CitationMetadata.FromJson(d, backend)));
136136
}
137137
}
138138

File renamed without changes.

vertexai/src/Chat.cs renamed to firebaseai/src/Chat.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
using System.Runtime.CompilerServices;
2121
using System.Threading;
2222
using System.Threading.Tasks;
23-
using Firebase.VertexAI.Internal;
23+
using Firebase.FirebaseAI.Internal;
2424

25-
namespace Firebase.VertexAI {
25+
namespace Firebase.FirebaseAI {
2626

2727
/// <summary>
2828
/// 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, IEnumerable<Model
6464
/// <param name="content">The input given to the model as a prompt.</param>
6565
/// <param name="cancellationToken">An optional token to cancel the operation.</param>
6666
/// <returns>The model's response if no error occurred.</returns>
67-
/// <exception cref="VertexAIException">Thrown when an error occurs during content generation.</exception>
67+
/// <exception cref="FirebaseAIException">Thrown when an error occurs during content generation.</exception>
6868
public Task<GenerateContentResponse> SendMessageAsync(
6969
ModelContent content, CancellationToken cancellationToken = default) {
7070
return SendMessageAsync(new[] { content }, cancellationToken);
@@ -76,7 +76,7 @@ public Task<GenerateContentResponse> SendMessageAsync(
7676
/// <param name="text">The text given to the model as a prompt.</param>
7777
/// <param name="cancellationToken">An optional token to cancel the operation.</param>
7878
/// <returns>The model's response if no error occurred.</returns>
79-
/// <exception cref="VertexAIException">Thrown when an error occurs during content generation.</exception>
79+
/// <exception cref="FirebaseAIException">Thrown when an error occurs during content generation.</exception>
8080
public Task<GenerateContentResponse> SendMessageAsync(
8181
string text, CancellationToken cancellationToken = default) {
8282
return SendMessageAsync(new ModelContent[] { ModelContent.Text(text) }, cancellationToken);
@@ -88,7 +88,7 @@ public Task<GenerateContentResponse> SendMessageAsync(
8888
/// <param name="content">The input given to the model as a prompt.</param>
8989
/// <param name="cancellationToken">An optional token to cancel the operation.</param>
9090
/// <returns>The model's response if no error occurred.</returns>
91-
/// <exception cref="VertexAIException">Thrown when an error occurs during content generation.</exception>
91+
/// <exception cref="FirebaseAIException">Thrown when an error occurs during content generation.</exception>
9292
public Task<GenerateContentResponse> SendMessageAsync(
9393
IEnumerable<ModelContent> content, CancellationToken cancellationToken = default) {
9494
return SendMessageAsyncInternal(content, cancellationToken);
@@ -101,7 +101,7 @@ public Task<GenerateContentResponse> SendMessageAsync(
101101
/// <param name="content">The input given to the model as a prompt.</param>
102102
/// <param name="cancellationToken">An optional token to cancel the operation.</param>
103103
/// <returns>A stream of generated content responses from the model.</returns>
104-
/// <exception cref="VertexAIException">Thrown when an error occurs during content generation.</exception>
104+
/// <exception cref="FirebaseAIException">Thrown when an error occurs during content generation.</exception>
105105
public IAsyncEnumerable<GenerateContentResponse> SendMessageStreamAsync(
106106
ModelContent content, CancellationToken cancellationToken = default) {
107107
return SendMessageStreamAsync(new[] { content }, cancellationToken);
@@ -113,7 +113,7 @@ public IAsyncEnumerable<GenerateContentResponse> SendMessageStreamAsync(
113113
/// <param name="text">The text given to the model as a prompt.</param>
114114
/// <param name="cancellationToken">An optional token to cancel the operation.</param>
115115
/// <returns>A stream of generated content responses from the model.</returns>
116-
/// <exception cref="VertexAIException">Thrown when an error occurs during content generation.</exception>
116+
/// <exception cref="FirebaseAIException">Thrown when an error occurs during content generation.</exception>
117117
public IAsyncEnumerable<GenerateContentResponse> SendMessageStreamAsync(
118118
string text, CancellationToken cancellationToken = default) {
119119
return SendMessageStreamAsync(new ModelContent[] { ModelContent.Text(text) }, cancellationToken);
@@ -125,7 +125,7 @@ public IAsyncEnumerable<GenerateContentResponse> SendMessageStreamAsync(
125125
/// <param name="content">The input given to the model as a prompt.</param>
126126
/// <param name="cancellationToken">An optional token to cancel the operation.</param>
127127
/// <returns>A stream of generated content responses from the model.</returns>
128-
/// <exception cref="VertexAIException">Thrown when an error occurs during content generation.</exception>
128+
/// <exception cref="FirebaseAIException">Thrown when an error occurs during content generation.</exception>
129129
public IAsyncEnumerable<GenerateContentResponse> SendMessageStreamAsync(
130130
IEnumerable<ModelContent> content, CancellationToken cancellationToken = default) {
131131
return SendMessageStreamAsyncInternal(content, cancellationToken);
@@ -134,7 +134,7 @@ public IAsyncEnumerable<GenerateContentResponse> SendMessageStreamAsync(
134134
private async Task<GenerateContentResponse> SendMessageAsyncInternal(
135135
IEnumerable<ModelContent> requestContent, CancellationToken cancellationToken = default) {
136136
// Make sure that the requests are set to to role "user".
137-
List<ModelContent> fixedRequests = requestContent.Select(VertexAIExtensions.ConvertToUser).ToList();
137+
List<ModelContent> fixedRequests = requestContent.Select(FirebaseAIExtensions.ConvertToUser).ToList();
138138
// Set up the context to send in the request
139139
List<ModelContent> fullRequest = new(chatHistory);
140140
fullRequest.AddRange(fixedRequests);
@@ -159,7 +159,7 @@ private async IAsyncEnumerable<GenerateContentResponse> SendMessageStreamAsyncIn
159159
IEnumerable<ModelContent> requestContent,
160160
[EnumeratorCancellation] CancellationToken cancellationToken = default) {
161161
// Make sure that the requests are set to to role "user".
162-
List<ModelContent> fixedRequests = requestContent.Select(VertexAIExtensions.ConvertToUser).ToList();
162+
List<ModelContent> fixedRequests = requestContent.Select(FirebaseAIExtensions.ConvertToUser).ToList();
163163
// Set up the context to send in the request
164164
List<ModelContent> fullRequest = new(chatHistory);
165165
fullRequest.AddRange(fixedRequests);
File renamed without changes.

vertexai/src/Citation.cs renamed to firebaseai/src/Citation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
using System;
1818
using System.Collections.Generic;
1919
using System.Collections.ObjectModel;
20-
using Firebase.VertexAI.Internal;
20+
using Firebase.FirebaseAI.Internal;
2121

22-
namespace Firebase.VertexAI {
22+
namespace Firebase.FirebaseAI {
2323

2424
/// <summary>
2525
/// A collection of source attributions for a piece of content.
File renamed without changes.

0 commit comments

Comments
 (0)