Skip to content

Commit 455d291

Browse files
authored
fix(ai): Fix broken links and update docs per cl (#15399)
1 parent dcba494 commit 455d291

12 files changed

+51
-42
lines changed

FirebaseAI/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Unreleased
2+
- [fixed] Fixed various links in the Live API doc comments not mapping correctly.
3+
14
# 12.4.0
25
- [feature] Added support for the URL context tool, which allows the model to access content
36
from provided public web URLs to inform and enhance its responses. (#15221)

FirebaseAI/Sources/FirebaseAI.swift

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public final class FirebaseAI: Sendable {
6363
/// guidance on choosing an appropriate model for your use case.
6464
///
6565
/// - Parameters:
66-
/// - modelName: The name of the model to use, for example `"gemini-1.5-flash"`; see
66+
/// - modelName: The name of the model to use; see
6767
/// [available model names
6868
/// ](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names) for a
6969
/// list of supported model names.
@@ -106,12 +106,11 @@ public final class FirebaseAI: Sendable {
106106

107107
/// Initializes an ``ImagenModel`` with the given parameters.
108108
///
109-
/// > Important: Only Imagen 3 models (named `imagen-3.0-*`) are supported.
109+
/// - Note: Refer to [Imagen models](https://firebase.google.com/docs/vertex-ai/models) for
110+
/// guidance on choosing an appropriate model for your use case.
110111
///
111112
/// - Parameters:
112-
/// - modelName: The name of the Imagen 3 model to use, for example `"imagen-3.0-generate-002"`;
113-
/// see [model versions](https://firebase.google.com/docs/vertex-ai/models) for a list of
114-
/// supported Imagen 3 models.
113+
/// - modelName: The name of the Imagen 3 model to use.
115114
/// - generationConfig: Configuration options for generating images with Imagen.
116115
/// - safetySettings: Settings describing what types of potentially harmful content your model
117116
/// should allow.
@@ -138,18 +137,16 @@ public final class FirebaseAI: Sendable {
138137

139138
/// **[Public Preview]** Initializes a ``LiveGenerativeModel`` with the given parameters.
140139
///
140+
/// - Note: Refer to [the Firebase docs on the Live
141+
/// API](https://firebase.google.com/docs/ai-logic/live-api#models-that-support-capability) for
142+
/// guidance on choosing an appropriate model for your use case.
143+
///
141144
/// > Warning: Using the Firebase AI Logic SDKs with the Gemini Live API is in Public
142145
/// Preview, which means that the feature is not subject to any SLA or deprecation policy and
143146
/// could change in backwards-incompatible ways.
144147
///
145-
/// > Important: Only models that support the Gemini Live API (typically containing `live-*` in
146-
/// the name) are supported.
147-
///
148148
/// - Parameters:
149-
/// - modelName: The name of the model to use, for example
150-
/// `"gemini-live-2.5-flash-preview"`;
151-
/// see [model versions](https://firebase.google.com/docs/ai-logic/live-api?api=dev#models-that-support-capability)
152-
/// for a list of supported models.
149+
/// - modelName: The name of the model to use.
153150
/// - generationConfig: The content generation parameters your model should use.
154151
/// - tools: A list of ``Tool`` objects that the model may use to generate the next response.
155152
/// - toolConfig: Tool configuration for any ``Tool`` specified in the request.

FirebaseAI/Sources/GenerativeModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public final class GenerativeModel: Sendable {
5959
/// Initializes a new remote model with the given parameters.
6060
///
6161
/// - Parameters:
62-
/// - modelName: The name of the model, for example "gemini-2.0-flash".
62+
/// - modelName: The name of the model.
6363
/// - modelResourceName: The model resource name corresponding with `modelName` in the backend.
6464
/// The form depends on the backend and will be one of:
6565
/// - Vertex AI via Firebase AI SDK:

FirebaseAI/Sources/Types/Public/Live/LiveGenerationConfig.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,14 @@ public struct LiveGenerationConfig: Sendable {
107107
/// the model.
108108
///
109109
/// Input transcripts are the model's interpretation of audio data sent to it, and they are
110-
/// populated in model responses via ``LiveServerContent``. When this field is set to `nil`,
111-
/// input transcripts are not populated in model responses.
110+
/// populated in model responses via ``LiveServerContent/inputAudioTranscription``. When this
111+
/// field is set to `nil`, input transcripts are not populated in model responses.
112112
/// - outputAudioTranscription: Configures (and enables) output transcriptions when streaming to
113113
/// the model.
114114
///
115115
/// Output transcripts are text representations of the audio the model is sending to the
116-
/// client, and they are populated in model responses via ``LiveServerContent``. When this
116+
/// client, and they are populated in model responses via
117+
/// ``LiveServerContent/outputAudioTranscription``. When this
117118
/// field is set to `nil`, output transcripts are not populated in model responses.
118119
///
119120
/// > Important: Transcripts are independent to the model turn. This means transcripts may

FirebaseAI/Sources/Types/Public/Live/LiveGenerativeModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Foundation
1717
/// A multimodal model (like Gemini) capable of real-time content generation based on
1818
/// various input types, supporting bidirectional streaming.
1919
///
20-
/// You can create a new session via ``connect()``.
20+
/// You can create a new session via ``LiveGenerativeModel/connect()``.
2121
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *)
2222
@available(watchOS, unavailable)
2323
public final class LiveGenerativeModel {

FirebaseAI/Sources/Types/Public/Live/LiveServerContent.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ public struct LiveServerContent: Sendable {
4545
/// The model has finished _generating_ data for the current turn.
4646
///
4747
/// For realtime playback, there will be a delay between when the model finishes generating
48-
/// content and the client has finished playing back the generated content. `generationComplete`
49-
/// indicates that the model is done generating data, while `isTurnComplete` indicates the model
50-
/// is waiting for additional client messages. Sending a message during this delay may cause a
51-
/// `wasInterrupted` message to be sent.
48+
/// content and the client has finished playing back the generated content.
49+
/// ``LiveServerContent/isGenerationComplete`` indicates that the model is done generating data,
50+
/// while ``LiveServerContent/isTurnComplete`` indicates the model is waiting for additional
51+
/// client messages. Sending a message during this delay may cause a
52+
/// ``LiveServerContent/wasInterrupted`` message to be sent.
5253
///
53-
/// Note that if the model `wasInterrupted`, this will not be set. The model will go from
54-
/// `wasInterrupted` -> `turnComplete`.
54+
/// > Important: If the model ``LiveServerContent/wasInterrupted``, this will not be set. The
55+
/// > model will go from ``LiveServerContent/wasInterrupted`` ->
56+
/// > ``LiveServerContent/isTurnComplete``.
5557
public var isGenerationComplete: Bool { serverContent.generationComplete ?? false }
5658

5759
/// Metadata specifying the sources used to ground generated content.
@@ -60,15 +62,15 @@ public struct LiveServerContent: Sendable {
6062
/// The model's interpretation of what the client said in an audio message.
6163
///
6264
/// This field is only populated when an ``AudioTranscriptionConfig`` is provided to
63-
/// ``LiveGenerationConfig``.
65+
/// the `inputAudioTranscription` field in ``LiveGenerationConfig``.
6466
public var inputAudioTranscription: LiveAudioTranscription? {
6567
serverContent.inputTranscription.map { LiveAudioTranscription($0) }
6668
}
6769

6870
/// Transcription matching the model's audio response.
6971
///
7072
/// This field is only populated when an ``AudioTranscriptionConfig`` is provided to
71-
/// ``LiveGenerationConfig``.
73+
/// the `outputAudioTranscription` field in ``LiveGenerationConfig``.
7274
///
7375
/// > Important: Transcripts are independent to the model turn. This means transcripts may
7476
/// > come earlier or later than when the model sends the corresponding audio responses.

FirebaseAI/Sources/Types/Public/Live/LiveServerToolCall.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
/// Request for the client to execute the provided ``functionCalls``.
1616
///
17-
/// The client should return matching ``FunctionResponsePart``, where the `functionId` fields
18-
/// correspond to individual ``FunctionCallPart``s.
17+
/// The client should return matching ``FunctionResponsePart``, where the
18+
/// ``FunctionResponsePart/functionId`` fields correspond to individual ``FunctionCallPart``s.
1919
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
2020
@available(watchOS, unavailable)
2121
public struct LiveServerToolCall: Sendable {

FirebaseAI/Sources/Types/Public/Live/LiveServerToolCallCancellation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
@available(watchOS, unavailable)
2121
public struct LiveServerToolCallCancellation: Sendable {
2222
let serverToolCallCancellation: BidiGenerateContentToolCallCancellation
23-
/// A list of `functionId`s matching the `functionId` provided in a previous
24-
/// ``LiveServerToolCall``, where only the provided `functionId`s should be cancelled.
23+
/// A list of function ids matching the ``FunctionCallPart/functionId`` provided in a previous
24+
/// ``LiveServerToolCall``, where only the provided ids should be cancelled.
2525
public var ids: [String]? { serverToolCallCancellation.ids }
2626

2727
init(_ serverToolCallCancellation: BidiGenerateContentToolCallCancellation) {

FirebaseAI/Sources/Types/Public/Live/LiveSession.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ import Foundation
1616

1717
/// A live WebSocket session, capable of streaming content to and from the model.
1818
///
19-
/// Messages are streamed through ``responses``, and can be sent through either the dedicated
20-
/// realtime API function (such as ``sendAudioRealtime(audio:)`` or ``sendTextRealtime(text:)``), or
21-
/// through the incremental API (such as ``sendContent(_:turnComplete:)``).
19+
/// Messages are streamed through ``LiveSession/responses``, and can be sent through either the
20+
/// dedicated realtime API function (such as ``LiveSession/sendAudioRealtime(_:)`` and
21+
/// ``LiveSession/sendTextRealtime(_:)``), or through the incremental API (such as
22+
/// ``LiveSession/sendContent(_:turnComplete:)-6x3ae``).
2223
///
2324
/// To create an instance of this class, see ``LiveGenerativeModel``.
2425
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
2526
@available(watchOS, unavailable)
2627
public final class LiveSession: Sendable {
2728
private let service: LiveSessionService
2829

29-
/// An asyncronous stream of messages from the server.
30+
/// An asynchronous stream of messages from the server.
3031
///
3132
/// These messages from the incremental updates from the model, for the current conversation.
3233
public var responses: AsyncThrowingStream<LiveServerMessage, Error> { service.responses }
@@ -41,7 +42,7 @@ public final class LiveSession: Sendable {
4142
///
4243
/// - Parameters:
4344
/// - responses: Client generated function results, matched to their respective
44-
/// ``FunctionCallPart`` by the `functionId` field.
45+
/// ``FunctionCallPart`` by the ``FunctionCallPart/functionId`` field.
4546
public func sendFunctionResponses(_ responses: [FunctionResponsePart]) async {
4647
let message = BidiGenerateContentToolResponse(
4748
functionResponses: responses.map { $0.functionResponse }

FirebaseAI/Sources/Types/Public/Live/LiveSessionErrors.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import Foundation
2020
/// version, or that the model is just
2121
/// not supported.
2222
///
23-
/// Check the `NSUnderlyingErrorKey` entry in ``errorUserInfo`` for the error that caused this.
23+
/// Check the `NSUnderlyingErrorKey` entry in ``LiveSessionUnsupportedMessageError/errorUserInfo``
24+
/// for the error that caused this.
2425
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *)
2526
@available(watchOS, unavailable)
2627
public struct LiveSessionUnsupportedMessageError: Error, Sendable, CustomNSError {
@@ -40,7 +41,8 @@ public struct LiveSessionUnsupportedMessageError: Error, Sendable, CustomNSError
4041

4142
/// The live session was closed, because the network connection was lost.
4243
///
43-
/// Check the `NSUnderlyingErrorKey` entry in ``errorUserInfo`` for the error that caused this.
44+
/// Check the `NSUnderlyingErrorKey` entry in ``LiveSessionLostConnectionError/errorUserInfo`` for
45+
/// the error that caused this.
4446
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *)
4547
@available(watchOS, unavailable)
4648
public struct LiveSessionLostConnectionError: Error, Sendable, CustomNSError {
@@ -60,7 +62,8 @@ public struct LiveSessionLostConnectionError: Error, Sendable, CustomNSError {
6062

6163
/// The live session was closed, but not for a reason the SDK expected.
6264
///
63-
/// Check the `NSUnderlyingErrorKey` entry in ``errorUserInfo`` for the error that caused this.
65+
/// Check the `NSUnderlyingErrorKey` entry in ``LiveSessionUnexpectedClosureError/errorUserInfo``
66+
/// for the error that caused this.
6467
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *)
6568
@available(watchOS, unavailable)
6669
public struct LiveSessionUnexpectedClosureError: Error, Sendable, CustomNSError {
@@ -83,7 +86,8 @@ public struct LiveSessionUnexpectedClosureError: Error, Sendable, CustomNSError
8386
/// This can occur due to the model not supporting the requested response modalities, the project
8487
/// not having access to the model, the model being invalid, or some internal error.
8588
///
86-
/// Check the `NSUnderlyingErrorKey` entry in ``errorUserInfo`` for the error that caused this.
89+
/// Check the `NSUnderlyingErrorKey` entry in ``LiveSessionSetupError/errorUserInfo`` for the error
90+
/// that caused this.
8791
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *)
8892
@available(watchOS, unavailable)
8993
public struct LiveSessionSetupError: Error, Sendable, CustomNSError {

0 commit comments

Comments
 (0)