GoogleRealtime
Namespace: Vercel.AI.Google
public sealed class GoogleRealtimeMaps Gemini Live WebSocket messages. No socket is opened, so this compiles on netstandard2.0.
Inheritance: object
Methods
Section titled “Methods”BuildSession(GoogleRealtimeSession)
Section titled “BuildSession(GoogleRealtimeSession)”public static JsonObject BuildSession(GoogleRealtimeSession session)Builds the Live setup object.
Parameters
| Name | Type | Description |
|---|---|---|
session |
GoogleRealtimeSession |
Returns: JsonObject
FunctionResponse(string?)
Section titled “FunctionResponse(string?)”public static JsonNode FunctionResponse(string? output)Wraps a non-object tool result in { output } so the Live API receives a Struct.
Parameters
| Name | Type | Description |
|---|---|---|
output |
string |
Returns: JsonNode
ParseServerEvent(JsonElement)
Section titled “ParseServerEvent(JsonElement)”public IReadOnlyList<GoogleRealtimeEvent> ParseServerEvent(JsonElement raw)Maps one server message into one or more normalized events.
Parameters
| Name | Type | Description |
|---|---|---|
raw |
JsonElement |
Returns: IReadOnlyList<GoogleRealtimeEvent>
SerializeClient(string, GoogleRealtimeSession?, string?, string?, string?, string?, string?)
Section titled “SerializeClient(string, GoogleRealtimeSession?, string?, string?, string?, string?, string?)”public JsonObject? SerializeClient(string type, GoogleRealtimeSession? session, string? audio, string? text, string? callId, string? callName, string? callOutput)Serializes a client event. Returns null for events Gemini Live ignores.
Parameters
| Name | Type | Description |
|---|---|---|
type |
string | |
session |
GoogleRealtimeSession | |
audio |
string | |
text |
string | |
callId |
string | |
callName |
string | |
callOutput |
string |
Returns: JsonObject
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product