Skip to content

Commit 40d6d3c

Browse files
committed
remove breaking change
1 parent 4088069 commit 40d6d3c

File tree

5 files changed

+20
-24
lines changed

5 files changed

+20
-24
lines changed

firebase-vertexai/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Unreleased
22
* [changed] Added new exception type for quota exceeded scenarios.
33
* [feature] `CountTokenRequest` now includes `GenerationConfig` from the model.
4-
* [feature] Added support for bidirectional streaming.
4+
* [feature] Public Preview: Added support for streaming input and output (including audio) using the [Multimodal Live API](/docs/vertex-ai/live-api)
55
* [changed] **Breaking Change**: `ImagenInlineImage.data` now returns the raw
66
image bytes (in JPEG or PNG format, as specified in
77
`ImagenInlineImage.mimeType`) instead of Base64-encoded data. (#6800)

firebase-vertexai/api.txt

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ package com.google.firebase.vertexai {
3232
method public com.google.firebase.vertexai.LiveGenerativeModel liveModel(String modelName);
3333
method public com.google.firebase.vertexai.LiveGenerativeModel liveModel(String modelName, com.google.firebase.vertexai.type.LiveGenerationConfig? generationConfig = null);
3434
method public com.google.firebase.vertexai.LiveGenerativeModel liveModel(String modelName, com.google.firebase.vertexai.type.LiveGenerationConfig? generationConfig = null, java.util.List<com.google.firebase.vertexai.type.Tool>? tools = null);
35-
method public com.google.firebase.vertexai.LiveGenerativeModel liveModel(String modelName, com.google.firebase.vertexai.type.LiveGenerationConfig? generationConfig = null, java.util.List<com.google.firebase.vertexai.type.Tool>? tools = null, com.google.firebase.vertexai.type.ToolConfig? toolConfig = null);
36-
method public com.google.firebase.vertexai.LiveGenerativeModel liveModel(String modelName, com.google.firebase.vertexai.type.LiveGenerationConfig? generationConfig = null, java.util.List<com.google.firebase.vertexai.type.Tool>? tools = null, com.google.firebase.vertexai.type.ToolConfig? toolConfig = null, com.google.firebase.vertexai.type.Content? systemInstruction = null);
37-
method public com.google.firebase.vertexai.LiveGenerativeModel liveModel(String modelName, com.google.firebase.vertexai.type.LiveGenerationConfig? generationConfig = null, java.util.List<com.google.firebase.vertexai.type.Tool>? tools = null, com.google.firebase.vertexai.type.ToolConfig? toolConfig = null, com.google.firebase.vertexai.type.Content? systemInstruction = null, com.google.firebase.vertexai.type.RequestOptions requestOptions = com.google.firebase.vertexai.type.RequestOptions());
35+
method public com.google.firebase.vertexai.LiveGenerativeModel liveModel(String modelName, com.google.firebase.vertexai.type.LiveGenerationConfig? generationConfig = null, java.util.List<com.google.firebase.vertexai.type.Tool>? tools = null, com.google.firebase.vertexai.type.Content? systemInstruction = null);
36+
method public com.google.firebase.vertexai.LiveGenerativeModel liveModel(String modelName, com.google.firebase.vertexai.type.LiveGenerationConfig? generationConfig = null, java.util.List<com.google.firebase.vertexai.type.Tool>? tools = null, com.google.firebase.vertexai.type.Content? systemInstruction = null, com.google.firebase.vertexai.type.RequestOptions requestOptions = com.google.firebase.vertexai.type.RequestOptions());
3837
property public static final com.google.firebase.vertexai.FirebaseVertexAI instance;
3938
field public static final com.google.firebase.vertexai.FirebaseVertexAI.Companion Companion;
4039
}
@@ -70,7 +69,7 @@ package com.google.firebase.vertexai {
7069
}
7170

7271
public final class LiveGenerativeModel {
73-
method public suspend Object? connect(kotlin.coroutines.Continuation<? super com.google.firebase.vertexai.type.LiveSession?>);
72+
method public suspend Object? connect(kotlin.coroutines.Continuation<? super com.google.firebase.vertexai.type.LiveSession>);
7473
}
7574

7675
}
@@ -116,7 +115,7 @@ package com.google.firebase.vertexai.java {
116115
}
117116

118117
public abstract class LiveModelFutures {
119-
method public abstract com.google.common.util.concurrent.ListenableFuture<com.google.firebase.vertexai.type.LiveSession?> connect();
118+
method public abstract com.google.common.util.concurrent.ListenableFuture<com.google.firebase.vertexai.type.LiveSession> connect();
120119
method public static final com.google.firebase.vertexai.java.LiveModelFutures from(com.google.firebase.vertexai.LiveGenerativeModel model);
121120
field public static final com.google.firebase.vertexai.java.LiveModelFutures.Companion Companion;
122121
}
@@ -129,6 +128,7 @@ package com.google.firebase.vertexai.java {
129128
method public abstract com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> close();
130129
method public static final com.google.firebase.vertexai.java.LiveSessionFutures from(com.google.firebase.vertexai.type.LiveSession session);
131130
method public abstract com.google.common.util.concurrent.ListenableFuture<org.reactivestreams.Publisher<com.google.firebase.vertexai.type.LiveContentResponse>> receive(java.util.List<com.google.firebase.vertexai.type.ContentModality> outputModalities);
131+
method public abstract org.reactivestreams.Publisher<java.util.List<com.google.firebase.vertexai.type.FunctionCallPart>> receiveAudioConversationFunctionCalls();
132132
method public abstract com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> send(com.google.firebase.vertexai.type.Content content);
133133
method public abstract com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> send(String text);
134134
method public abstract com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> sendFunctionResponse(java.util.List<com.google.firebase.vertexai.type.FunctionResponsePart> functionList);
@@ -155,6 +155,10 @@ package com.google.firebase.vertexai.type {
155155
ctor public AudioRecordInvalidBufferSizeException();
156156
}
157157

158+
public final class BidiServerHandshakeFailed extends com.google.firebase.vertexai.type.FirebaseVertexAIException {
159+
ctor public BidiServerHandshakeFailed();
160+
}
161+
158162
public final class BlockReason {
159163
method public String getName();
160164
method public int getOrdinal();
@@ -296,10 +300,10 @@ package com.google.firebase.vertexai.type {
296300
}
297301

298302
public final class FunctionCallPart implements com.google.firebase.vertexai.type.Part {
299-
ctor public FunctionCallPart(String name, java.util.Map<java.lang.String,? extends kotlinx.serialization.json.JsonElement?>? args);
300-
method public java.util.Map<java.lang.String,kotlinx.serialization.json.JsonElement?>? getArgs();
303+
ctor public FunctionCallPart(String name, java.util.Map<java.lang.String,? extends kotlinx.serialization.json.JsonElement> args);
304+
method public java.util.Map<java.lang.String,kotlinx.serialization.json.JsonElement> getArgs();
301305
method public String getName();
302-
property public final java.util.Map<java.lang.String,kotlinx.serialization.json.JsonElement?>? args;
306+
property public final java.util.Map<java.lang.String,kotlinx.serialization.json.JsonElement> args;
303307
property public final String name;
304308
}
305309

@@ -802,14 +806,6 @@ package com.google.firebase.vertexai.type {
802806
property public final com.google.firebase.vertexai.type.Voices voice;
803807
}
804808

805-
public final class StreamOutput {
806-
ctor public StreamOutput(boolean interrupted, com.google.firebase.vertexai.type.Content? data);
807-
method public com.google.firebase.vertexai.type.Content? getData();
808-
method public boolean getInterrupted();
809-
property public final com.google.firebase.vertexai.type.Content? data;
810-
property public final boolean interrupted;
811-
}
812-
813809
public abstract class StringFormat {
814810
}
815811

firebase-vertexai/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
2121
<uses-permission android:name="android.permission.INTERNET" />
2222

23-
<uses-permission android:name="android.permission.RECORD_AUDIO" />
2423

2524
<application>
2625
<service android:name="com.google.firebase.components.ComponentDiscoveryService"

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/LiveSession.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import kotlinx.serialization.SerialName
3636
import kotlinx.serialization.Serializable
3737
import kotlinx.serialization.encodeToString
3838
import kotlinx.serialization.json.Json
39+
import kotlinx.serialization.json.JsonNull
3940

4041
/**
4142
* Represents a live WebSocket session capable of streaming bidirectional content to and from the
@@ -117,7 +118,7 @@ internal constructor(
117118
}
118119

119120
/**
120-
* Receives all function call responses from the server for the audio conversation feature..
121+
* Receives all function call responses from the server for the audio conversation feature.
121122
*
122123
* @return A [Flow] which will emit list of [FunctionCallPart] as they are returned by the model.
123124
*/
@@ -277,7 +278,9 @@ internal constructor(
277278
LiveContentResponse(
278279
null,
279280
LiveContentResponse.Status.NORMAL,
280-
functionContent.toolCall.functionCalls.map { FunctionCallPart(it.name, it.args) }
281+
functionContent.toolCall.functionCalls.map {
282+
FunctionCallPart(it.name, it.args.orEmpty().mapValues { x -> x.value ?: JsonNull })
283+
}
281284
)
282285
)
283286
continue

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ public class InlineDataPart(public val inlineData: ByteArray, public val mimeTyp
7171
* @param name the name of the function to call
7272
* @param args the function parameters and values as a [Map]
7373
*/
74-
public class FunctionCallPart(
75-
public val name: String,
76-
public val args: Map<String, JsonElement?>?
77-
) : Part {
74+
public class FunctionCallPart(public val name: String, public val args: Map<String, JsonElement>) :
75+
Part {
7876

7977
@Serializable
8078
internal data class Internal(val functionCall: FunctionCall) : InternalPart {

0 commit comments

Comments
 (0)