Skip to content

Commit 4a9a3ba

Browse files
committed
Format and generate apitxt
1 parent 5d390d0 commit 4a9a3ba

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

firebase-ai/api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ package com.google.firebase.ai.type {
944944
property public final java.util.List<com.google.firebase.ai.type.SafetyRating> safetyRatings;
945945
}
946946

947-
@kotlin.RequiresOptIn(level=kotlin.RequiresOptIn.Level.ERROR, message="This API is part of an experimental public preview and may change in " + "backwards-incompatible ways without notice.") @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) public @interface PublicPreviewAPI {
947+
@kotlin.RequiresOptIn(level=kotlin.RequiresOptIn.Level.ERROR, message="This API is part of an experimental public preview and may change in " + "backwards-incompatible ways without notice.") @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.CLASS, kotlin.annotation.AnnotationTarget.FUNCTION, kotlin.annotation.AnnotationTarget.PROPERTY}) public @interface PublicPreviewAPI {
948948
}
949949

950950
public final class QuotaExceededException extends com.google.firebase.ai.type.FirebaseAIException {

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,5 @@ package com.google.firebase.ai.type
2323
"This API is part of an experimental public preview and may change in " +
2424
"backwards-incompatible ways without notice.",
2525
)
26-
@Target(
27-
AnnotationTarget.CLASS,
28-
AnnotationTarget.FUNCTION,
29-
AnnotationTarget.PROPERTY
30-
)
26+
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
3127
public annotation class PublicPreviewAPI()

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ internal constructor(
6262
*/
6363
@JvmStatic
6464
public fun functionDeclarations(functionDeclarations: List<FunctionDeclaration>): Tool {
65-
@OptIn(PublicPreviewAPI::class)
66-
return Tool(functionDeclarations, null, null, null)
65+
@OptIn(PublicPreviewAPI::class) return Tool(functionDeclarations, null, null, null)
6766
}
6867

6968
/** Creates a [Tool] instance that allows the model to use Code Execution. */
@@ -104,8 +103,7 @@ internal constructor(
104103
*/
105104
@JvmStatic
106105
public fun googleSearch(googleSearch: GoogleSearch = GoogleSearch()): Tool {
107-
@OptIn(PublicPreviewAPI::class)
108-
return Tool(null, googleSearch, null, null)
106+
@OptIn(PublicPreviewAPI::class) return Tool(null, googleSearch, null, null)
109107
}
110108
}
111109
}

firebase-ai/src/test/java/com/google/firebase/ai/type/ToolTest.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ internal class ToolTest {
2828
tool.googleSearch.shouldNotBeNull()
2929
tool.functionDeclarations.shouldBeNull()
3030
tool.codeExecution.shouldBeNull()
31-
@OptIn(PublicPreviewAPI::class)
32-
tool.urlContext.shouldBeNull()
31+
@OptIn(PublicPreviewAPI::class) tool.urlContext.shouldBeNull()
3332
}
3433

3534
@Test
@@ -40,8 +39,7 @@ internal class ToolTest {
4039
tool.functionDeclarations?.first() shouldBe functionDeclaration
4140
tool.googleSearch.shouldBeNull()
4241
tool.codeExecution.shouldBeNull()
43-
@OptIn(PublicPreviewAPI::class)
44-
tool.urlContext.shouldBeNull()
42+
@OptIn(PublicPreviewAPI::class) tool.urlContext.shouldBeNull()
4543
}
4644

4745
@Test
@@ -50,8 +48,7 @@ internal class ToolTest {
5048
tool.codeExecution.shouldNotBeNull()
5149
tool.functionDeclarations.shouldBeNull()
5250
tool.googleSearch.shouldBeNull()
53-
@OptIn(PublicPreviewAPI::class)
54-
tool.urlContext.shouldBeNull()
51+
@OptIn(PublicPreviewAPI::class) tool.urlContext.shouldBeNull()
5552
}
5653

5754
@OptIn(PublicPreviewAPI::class)
@@ -62,7 +59,6 @@ internal class ToolTest {
6259
tool.googleSearch.shouldBeNull()
6360
tool.functionDeclarations.shouldBeNull()
6461
tool.codeExecution.shouldBeNull()
65-
@OptIn(PublicPreviewAPI::class)
66-
tool.urlContext.shouldNotBeNull()
62+
@OptIn(PublicPreviewAPI::class) tool.urlContext.shouldNotBeNull()
6763
}
6864
}

0 commit comments

Comments
 (0)