Skip to content

Commit 74168f8

Browse files
committed
Merge remote-tracking branch 'origin/main' into NoDocumentPerformanceFix
2 parents df9bf43 + bbfcc2f commit 74168f8

File tree

5 files changed

+41
-35
lines changed

5 files changed

+41
-35
lines changed

firebase-ai/src/main/kotlin/com/google/firebase/ai/common/Exceptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ internal class UnsupportedUserLocationException(cause: Throwable? = null) :
9090
FirebaseCommonAIException("User location is not supported for the API use.", cause)
9191

9292
/**
93-
* The user's project has not been configured and enabled for the selected API.
93+
* The Firebase project has not been configured and enabled for the selected API.
9494
*
9595
* For the Gemini Developer API, see
9696
* [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found)

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Exceptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public class UnsupportedUserLocationException internal constructor(cause: Throwa
152152
FirebaseAIException("User location is not supported for the API use.", cause)
153153

154154
/**
155-
* The user's project has not been configured and enabled for the selected API.
155+
* The Firebase project has not been configured and enabled for the selected API.
156156
*
157157
* For the Gemini Developer API, see
158158
* [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found)

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/GenerateContentResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class GenerateContentResponse(
5959

6060
/**
6161
* Convenience field representing all the text parts in the response that are marked as thoughts
62-
* as a single string, if they exists.
62+
* as a single string, if they exist.
6363
*
6464
* Learn more about [thinking](https://firebase.google.com/docs/ai-logic/thinking?api=dev).
6565
*/

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ internal constructor(
106106
/**
107107
* Represents image data sent to and received from requests. The image is converted client-side to
108108
* JPEG encoding at 80% quality before being sent to the server.
109-
*
110-
* @param image [Bitmap] to convert into a [Part]
111109
*/
112110
public class ImagePart
113111
internal constructor(
@@ -116,6 +114,7 @@ internal constructor(
116114
internal val thoughtSignature: String?
117115
) : Part {
118116

117+
/** @param image [Bitmap] to convert into a [Part] */
119118
public constructor(image: Bitmap) : this(image, false, null)
120119

121120
internal fun toInlineDataPart() =
@@ -127,13 +126,7 @@ internal constructor(
127126
)
128127
}
129128

130-
/**
131-
* Represents binary data with an associated MIME type sent to and received from requests.
132-
*
133-
* @param inlineData the binary data as a [ByteArray]
134-
* @param mimeType an IANA standard MIME type. For supported values, see the
135-
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
136-
*/
129+
/** Represents binary data with an associated MIME type sent to and received from requests. */
137130
public class InlineDataPart
138131
internal constructor(
139132
public val inlineData: ByteArray,
@@ -142,6 +135,11 @@ internal constructor(
142135
internal val thoughtSignature: String?
143136
) : Part {
144137

138+
/**
139+
* @param inlineData the binary data as a [ByteArray]
140+
* @param mimeType an IANA standard MIME type. For supported values, see the
141+
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
142+
*/
145143
public constructor(
146144
inlineData: ByteArray,
147145
mimeType: String
@@ -159,14 +157,7 @@ internal constructor(
159157
}
160158
}
161159

162-
/**
163-
* Represents function call name and params received from requests.
164-
*
165-
* @param name the name of the function to call
166-
* @param args the function parameters and values as a [Map]
167-
* @param id Unique id of the function call. If present, the returned [FunctionResponsePart] should
168-
* have a matching `id` field.
169-
*/
160+
/** Represents function call name and params received from requests. */
170161
public class FunctionCallPart
171162
internal constructor(
172163
public val name: String,
@@ -176,6 +167,12 @@ internal constructor(
176167
internal val thoughtSignature: String?
177168
) : Part {
178169

170+
/**
171+
* @param name the name of the function to call
172+
* @param args the function parameters and values as a [Map]
173+
* @param id Unique id of the function call. If present, the returned [FunctionResponsePart]
174+
* should have a matching `id` field.
175+
*/
179176
@JvmOverloads
180177
public constructor(
181178
name: String,
@@ -199,13 +196,7 @@ internal constructor(
199196
}
200197
}
201198

202-
/**
203-
* Represents function call output to be returned to the model when it requests a function call.
204-
*
205-
* @param name The name of the called function.
206-
* @param response The response produced by the function as a [JSONObject].
207-
* @param id Matching `id` for a [FunctionCallPart], if one was provided.
208-
*/
199+
/** Represents function call output to be returned to the model when it requests a function call. */
209200
public class FunctionResponsePart
210201
internal constructor(
211202
public val name: String,
@@ -215,6 +206,11 @@ internal constructor(
215206
internal val thoughtSignature: String?
216207
) : Part {
217208

209+
/**
210+
* @param name The name of the called function.
211+
* @param response The response produced by the function as a [JSONObject].
212+
* @param id Matching `id` for a [FunctionCallPart], if one was provided.
213+
*/
218214
@JvmOverloads
219215
public constructor(
220216
name: String,
@@ -242,14 +238,7 @@ internal constructor(
242238
}
243239
}
244240

245-
/**
246-
* Represents file data stored in Cloud Storage for Firebase, referenced by URI.
247-
*
248-
* @param uri The `"gs://"`-prefixed URI of the file in Cloud Storage for Firebase, for example,
249-
* `"gs://bucket-name/path/image.jpg"`
250-
* @param mimeType an IANA standard MIME type. For supported MIME type values see the
251-
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
252-
*/
241+
/** Represents file data stored in Cloud Storage for Firebase, referenced by URI. */
253242
public class FileDataPart
254243
internal constructor(
255244
public val uri: String,
@@ -258,6 +247,12 @@ internal constructor(
258247
internal val thoughtSignature: String?
259248
) : Part {
260249

250+
/**
251+
* @param uri The `"gs://"`-prefixed URI of the file in Cloud Storage for Firebase, for example,
252+
* `"gs://bucket-name/path/image.jpg"`
253+
* @param mimeType an IANA standard MIME type. For supported MIME type values see the
254+
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
255+
*/
261256
public constructor(uri: String, mimeType: String) : this(uri, mimeType, false, null)
262257

263258
@Serializable

plugins/src/main/java/com/google/firebase/gradle/plugins/ci/AffectedProjectFinder.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import com.google.common.collect.ImmutableSet;
1818
import com.google.common.io.CharStreams;
19+
import com.google.common.io.Files;
1920
import java.io.File;
2021
import java.io.IOException;
2122
import java.io.InputStreamReader;
@@ -39,6 +40,8 @@ public AffectedProjectFinder(Project project, List<Pattern> ignorePaths) {
3940
this(project, changedPaths(project.getRootDir()), ignorePaths);
4041
}
4142

43+
private static final Set<String> DOC_EXTENSIONS = ImmutableSet.of("md", "txt", "html");
44+
4245
public AffectedProjectFinder(
4346
Project project, Set<String> changedPaths, List<Pattern> ignorePaths) {
4447
this.project = project;
@@ -53,9 +56,17 @@ public AffectedProjectFinder(
5356
}
5457
return true;
5558
})
59+
.filter(p -> !isDocFile(p))
5660
.collect(Collectors.toSet());
5761
}
5862

63+
private static boolean isDocFile(String path) {
64+
if (path.startsWith("docs/")) {
65+
return true;
66+
}
67+
return DOC_EXTENSIONS.contains(Files.getFileExtension(path));
68+
}
69+
5970
Set<Project> find() {
6071
Set<String> paths = new HashSet<>(changedPaths);
6172
Set<Project> projects = changedSubProjects(project, paths);

0 commit comments

Comments
 (0)