Skip to content

Commit 88fe935

Browse files
Apply suggestions from code review
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 1e9f4ec commit 88fe935

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

FirebaseAI/Sources/Protocols/Internal/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ This directory contains internal protocols not meant for public consumption.
44
These are used for internal workings of the FirebaseAI library.
55
Protocols in this directory are subject to change without notice and should not be relied upon by external code.
66

7-
### Files:
7+
### Files
88

99
- **`CodableProtoEnum.swift`**: This file provides helper protocols for encoding and decoding protobuf enums. It defines `ProtoEnum` as a base protocol for types that represent a Protocol Buffer raw enum value. `DecodableProtoEnum` and `EncodableProtoEnum` provide default implementations for `Decodable` and `Encodable` respectively. `CodableProtoEnum` combines both `DecodableProtoEnum` and `EncodableProtoEnum`.

FirebaseAI/Sources/Types/Internal/Errors/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This directory contains internal error types used within the FirebaseAI library.
44
These errors are not part of the public API and are used to handle specific error conditions within the SDK.
55

6-
### Files:
6+
### Files
77

88
- **`BackendError.swift`**: Defines an error structure for capturing detailed error information from the backend service. It includes the HTTP response code, a message, an RPC status, and additional details. It conforms to `CustomNSError` to integrate with Cocoa error handling and provide richer error information.
99

FirebaseAI/Sources/Types/Internal/Imagen/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ They are not meant for public consumption and can change at any time.
66

77
The types in this directory define the structure of the data sent to and received from the Imagen API, including parameters for image generation, safety attributes, and output options.
88

9-
### Files:
9+
### Files
1010

1111
- **`ImageGenerationInstance.swift`**: Defines the `ImageGenerationInstance` struct, which contains a `prompt` string for the image generation.
1212

FirebaseAI/Sources/Types/Internal/Live/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The types here are used for bidirectional communication with the backend, for ex
55

66
These types are not part of the public API and are subject to change.
77

8-
### Files:
8+
### Files
99

1010
- **`AsyncWebSocket.swift`**: Provides an async/await wrapper around `URLSessionWebSocketTask` for interacting with web sockets. It simplifies sending and receiving messages and provides a custom error, `WebSocketClosedError`, for when the web socket is closed.
1111

FirebaseAI/Sources/Types/Internal/Requests/AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ This directory contains internal data types for API requests.
44
These types encapsulate the data that needs to be sent to the backend for various operations.
55
They are not part of the public API and can change at any time.
66

7-
### Files:
7+
### Files
88

9-
- **`CountTokensRequest.swift`**: Defines the request structure for the `countTokens` API endpoint, which is used to calculate the number of tokens in a prompt. This includes the model name and the content to be tokenized. The request is encoded differently depending on the backend service (Vertex AI or Google AI) because the two backends have slightly different expectations for the `countTokens` endpoint. For example, the model resource name format differs between the two. The file also defines the `CountTokensResponse` struct.
9+
- **`CountTokensRequest.swift`**: Defines the request structure for the `countTokens` API endpoint, used to calculate the number of tokens in a prompt. It includes the model name and the content to be tokenized. The request encoding differs between Vertex AI and Google AI backends due to different API expectations (e.g., model resource name format). The file also defines the `CountTokensResponse` struct.

FirebaseAI/Sources/Types/Internal/Tools/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ This directory contains internal data types related to tools and function callin
44
These types are used to provide context to tools that can be executed by the model.
55
These types are internal and subject to change.
66

7-
### Files:
7+
### Files
88

99
- **`URLContext.swift`**: Defines the `URLContext` struct. It is currently an empty struct that serves to enable the URL context tool. Its presence in a `Tool` enables the feature, and it may be expanded in the future to carry more specific context.

FirebaseAI/Sources/Types/Public/AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ The types are organized into subdirectories based on the feature they are relate
1111
When adding a new public type, it should be placed in the appropriate subdirectory.
1212
Any changes to these types must be done carefully to avoid breaking changes for users.
1313

14-
### Files:
14+
### Files
1515

1616
- **`Backend.swift`**: Defines the `Backend` struct, which is used to configure the backend API for the Firebase AI SDK. It provides static methods `vertexAI(location:)` and `googleAI()` to create instances for the respective backends.
17-
- **`Part.swift`**: Defines the `Part` protocol and several conforming structs (`TextPart`, `InlineDataPart`, `FileDataPart`, `FunctionCallPart`, `FunctionResponsePart`, `ExecutableCodePart`, `CodeExecutionResultPart`). A `Part` represents a discrete piece of data in a media format that can be interpreted by the model.
17+
- **`Part.swift`**: Defines the `Part` protocol and several conforming structs: `TextPart`, `InlineDataPart`, `FileDataPart`, `FunctionCallPart`, `FunctionResponsePart`, `ExecutableCodePart`, and `CodeExecutionResultPart`. A `Part` represents a discrete piece of data in a media format that can be interpreted by the model.
1818
- **`ResponseModality.swift`**: Defines the `ResponseModality` struct, which represents the different types of data that a model can produce as output (e.g., `text`, `image`, `audio`).
1919
- **`Schema.swift`**: Defines the `Schema` class, which allows the definition of input and output data types for function calling. It supports various data types like string, number, integer, boolean, array, and object.
2020
- **`ThinkingConfig.swift`**: Defines the `ThinkingConfig` struct, for controlling the "thinking" behavior of compatible Gemini models. It includes parameters like `thinkingBudget` and `includeThoughts`.

FirebaseAI/Sources/Types/Public/Imagen/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This directory contains public data types for the Imagen image generation feature.
44
These types are part of the public API and are used by developers to interact with the Imagen service.
55

6-
### Files:
6+
### Files
77

88
- **`ImagenAspectRatio.swift`**: Defines the `ImagenAspectRatio` struct, which represents the aspect ratio for images generated by Imagen. It provides static properties for common aspect ratios like `square1x1`, `portrait9x16`, etc.
99

FirebaseAI/Sources/Types/Public/Live/AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This directory contains public data types for real-time and streaming features of the FirebaseAI library.
44
These types are used by developers to interact with live, streaming services, such as real-time chat sessions or audio transcription.
55

6-
### Files:
6+
### Files
77

88
- **`AudioTranscriptionConfig.swift`**: Defines the `AudioTranscriptionConfig` struct, which is used to enable and configure audio transcriptions when communicating with a model that supports the Gemini Live API.
99

@@ -23,7 +23,7 @@ These types are used by developers to interact with live, streaming services, su
2323

2424
- **`LiveServerToolCallCancellation.swift`**: Defines the `LiveServerToolCallCancellation` struct, a notification for the client to cancel a previous function call.
2525

26-
- **`LiveSession.swift`**: Defines the `LiveSession` class, which represents a live WebSocket session. It provides methods for sending real-time data like `sendAudioRealtime(_:)`, `sendVideoRealtime(_:mimeType:)`, `sendTextRealtime(_:)` and also for sending content incrementally with `sendContent(_:turnComplete:)`. It also has a `close()` method to end the session.
26+
- **`LiveSession.swift`**: Defines the `LiveSession` class, which represents a live WebSocket session. It provides methods for sending real-time data (like `sendAudioRealtime(_:)`, `sendVideoRealtime(_:mimeType:)`, and `sendTextRealtime(_:)`) and for sending content incrementally with `sendContent(_:turnComplete:)`. It also has a `close()` method to end the session.
2727

2828
- **`LiveSessionErrors.swift`**: Defines several public error structs related to live sessions: `LiveSessionUnsupportedMessageError`, `LiveSessionLostConnectionError`, `LiveSessionUnexpectedClosureError`, and `LiveSessionSetupError`.
2929

FirebaseAI/Sources/Types/Public/Tools/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
This directory contains public data types related to tools and function calling.
44
These types are used by developers to define and configure tools that the model can execute.
55

6-
### Files:
6+
### Files
77

88
- **`CodeExecution.swift`**: Defines the `CodeExecution` struct, which is a tool that allows the model to execute code. This can be used to solve complex problems by leveraging the model's ability to generate and execute code. It is currently an empty struct, but its presence in a `Tool` enables the code execution feature.

0 commit comments

Comments
 (0)