From 999cdff2b1eba55ade509dd7fcf63841e289da0d Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 3 Apr 2026 16:12:01 -0700 Subject: [PATCH 01/10] Exclude AGENTS.md --- Package.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Package.swift b/Package.swift index 93eef43b987..62746fa8e88 100644 --- a/Package.swift +++ b/Package.swift @@ -195,6 +195,9 @@ let package = Package( path: "FirebaseAI/Sources", swiftSettings: [ isFoundationModelsSupportedPlatformSwiftSetting(), + ], + exclude: [ + "**/AGENTS.md", ] ), .testTarget( From 56b4cb1f7bd80518152f1a2434ab5f5383db9aa7 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 3 Apr 2026 16:17:39 -0700 Subject: [PATCH 02/10] wildcard doesn't work --- Package.swift | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 62746fa8e88..b7d59cf66ee 100644 --- a/Package.swift +++ b/Package.swift @@ -197,7 +197,21 @@ let package = Package( isFoundationModelsSupportedPlatformSwiftSetting(), ], exclude: [ - "**/AGENTS.md", + "AGENTS.md", + "Types/Internal/Imagen/AGENTS.md", + "Extensions/Internal/AGENTS.md", + "Types/Public/AGENTS.md", + "Types/Public/Imagen/AGENTS.md", + "Types/Public/Live/AGENTS.md", + "Protocols/Internal/AGENTS.md", + "Types/Internal/AGENTS.md", + "Types/Internal/Tools/AGENTS.md", + "Types/Internal/Live/AGENTS.md", + "Types/Internal/Errors/AGENTS.md", + "Types/Public/Tools/AGENTS.md", + "Types/AGENTS.md", + "Protocols/AGENTS.md", + "Types/Internal/Requests/AGENTS.md", ] ), .testTarget( From 87d974c1f087c3d27f794baa9752c8df7e6e7fe8 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 3 Apr 2026 16:46:31 -0700 Subject: [PATCH 03/10] ordering --- Package.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index b7d59cf66ee..1646409a01d 100644 --- a/Package.swift +++ b/Package.swift @@ -193,9 +193,6 @@ let package = Package( "FirebaseCoreExtension", ], path: "FirebaseAI/Sources", - swiftSettings: [ - isFoundationModelsSupportedPlatformSwiftSetting(), - ], exclude: [ "AGENTS.md", "Types/Internal/Imagen/AGENTS.md", @@ -212,7 +209,10 @@ let package = Package( "Types/AGENTS.md", "Protocols/AGENTS.md", "Types/Internal/Requests/AGENTS.md", - ] + ], + swiftSettings: [ + isFoundationModelsSupportedPlatformSwiftSetting(), + ], ), .testTarget( name: "FirebaseAILogicUnit", From 8721b89223dead66c0f0fae5c93a853ade7a5951 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 3 Apr 2026 17:47:37 -0700 Subject: [PATCH 04/10] trailing slashes --- Package.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index 1646409a01d..57675492079 100644 --- a/Package.swift +++ b/Package.swift @@ -1412,18 +1412,19 @@ func firebaseCrashlyticsTarget() -> Target { "CHANGELOG.md", "LICENSE", "README.md", - "ProtoSupport/", - "UnitTests/", + "ProtoSupport", + "UnitTests", "generate_project.sh", "upload-symbols", "CrashlyticsInputFiles.xcfilelist", "third_party/libunwind/LICENSE", - "Crashlytics/Rollouts/", + "Crashlytics/Rollouts", + "UnitTests" ], sources: [ - "Crashlytics/", - "Protogen/", - "Shared/", + "Crashlytics", + "Protogen", + "Shared", "third_party/libunwind/dwarf.h", ], resources: [.process("Resources/PrivacyInfo.xcprivacy")], From ccbf04b6d3814c3de46b9dd2cf2177eb5e1ba4ad Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 3 Apr 2026 17:51:21 -0700 Subject: [PATCH 05/10] top level explicit --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 57675492079..18553288b5f 100644 --- a/Package.swift +++ b/Package.swift @@ -1408,7 +1408,7 @@ func firebaseCrashlyticsTarget() -> Target { ], path: "Crashlytics", exclude: [ - "run", + "./run", "CHANGELOG.md", "LICENSE", "README.md", From 8a0131996c06e120a09c345da2f29c179612e83b Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 3 Apr 2026 18:10:35 -0700 Subject: [PATCH 06/10] Fix Crashlytics Swift target --- Package.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 18553288b5f..27fd1386a9e 100644 --- a/Package.swift +++ b/Package.swift @@ -580,9 +580,9 @@ let package = Package( .target( name: "FirebaseCrashlyticsSwift", dependencies: ["FirebaseRemoteConfigInterop"], - path: "Crashlytics", + path: "Crashlytics/Crashlytics/Rollouts/", sources: [ - "Crashlytics/Rollouts/", + "./", ] ), .testTarget( @@ -1408,7 +1408,7 @@ func firebaseCrashlyticsTarget() -> Target { ], path: "Crashlytics", exclude: [ - "./run", + "run", "CHANGELOG.md", "LICENSE", "README.md", From 72dc5a9335d3e91dee7f162db300573c09453efb Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 3 Apr 2026 18:17:56 -0700 Subject: [PATCH 07/10] Changelog updates --- Crashlytics/CHANGELOG.md | 3 +++ FirebaseAI/CHANGELOG.md | 1 + 2 files changed, 4 insertions(+) diff --git a/Crashlytics/CHANGELOG.md b/Crashlytics/CHANGELOG.md index b676e2e1801..9a05ae47827 100644 --- a/Crashlytics/CHANGELOG.md +++ b/Crashlytics/CHANGELOG.md @@ -1,3 +1,6 @@ +# Unreleased +- [fixed] Fix unfound file warnings from `swift build`. (#16012) + # 12.11.0 - [fixed] Fixed an issue where Crashlytics API calls were silently dropped if invoked immediately after Firebase initialization. diff --git a/FirebaseAI/CHANGELOG.md b/FirebaseAI/CHANGELOG.md index bf9bed92c00..1ad8e1ad09b 100644 --- a/FirebaseAI/CHANGELOG.md +++ b/FirebaseAI/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased - [feature] Added support for GoogleMaps grounding. +- [fixed] Fix unfound file warnings from `swift build`. (#16012) # 12.12.0 - [feature] Added support for automatic function calling in From f6f9effaa8db3cfd091256d2ec8b1068891a3e78 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 3 Apr 2026 18:36:21 -0700 Subject: [PATCH 08/10] review --- Package.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 27fd1386a9e..2b21de6085c 100644 --- a/Package.swift +++ b/Package.swift @@ -580,9 +580,9 @@ let package = Package( .target( name: "FirebaseCrashlyticsSwift", dependencies: ["FirebaseRemoteConfigInterop"], - path: "Crashlytics/Crashlytics/Rollouts/", + path: "Crashlytics/Crashlytics/Rollouts", sources: [ - "./", + ".", ] ), .testTarget( @@ -1419,7 +1419,6 @@ func firebaseCrashlyticsTarget() -> Target { "CrashlyticsInputFiles.xcfilelist", "third_party/libunwind/LICENSE", "Crashlytics/Rollouts", - "UnitTests" ], sources: [ "Crashlytics", From b6e4602081d1589df9fce346f75735d424b51658 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 9 Apr 2026 15:44:33 -0700 Subject: [PATCH 09/10] Consolidate AGENTS.md files --- FirebaseAI/AGENTS.md | 177 ++++++++++++++++++ FirebaseAI/Sources/AGENTS.md | 41 ---- .../Sources/Extensions/Internal/AGENTS.md | 7 - FirebaseAI/Sources/Protocols/AGENTS.md | 11 -- .../Sources/Protocols/Internal/AGENTS.md | 9 - FirebaseAI/Sources/Types/AGENTS.md | 9 - FirebaseAI/Sources/Types/Internal/AGENTS.md | 12 -- .../Sources/Types/Internal/Errors/AGENTS.md | 10 - .../Sources/Types/Internal/Imagen/AGENTS.md | 29 --- .../Sources/Types/Internal/Live/AGENTS.md | 42 ----- .../Sources/Types/Internal/Requests/AGENTS.md | 9 - .../Sources/Types/Internal/Tools/AGENTS.md | 9 - FirebaseAI/Sources/Types/Public/AGENTS.md | 22 --- .../Sources/Types/Public/Imagen/AGENTS.md | 26 --- .../Sources/Types/Public/Live/AGENTS.md | 30 --- .../Sources/Types/Public/Tools/AGENTS.md | 9 - Package.swift | 17 -- 17 files changed, 177 insertions(+), 292 deletions(-) create mode 100644 FirebaseAI/AGENTS.md delete mode 100644 FirebaseAI/Sources/AGENTS.md delete mode 100644 FirebaseAI/Sources/Extensions/Internal/AGENTS.md delete mode 100644 FirebaseAI/Sources/Protocols/AGENTS.md delete mode 100644 FirebaseAI/Sources/Protocols/Internal/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Internal/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Internal/Errors/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Internal/Imagen/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Internal/Live/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Internal/Requests/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Internal/Tools/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Public/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Public/Imagen/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Public/Live/AGENTS.md delete mode 100644 FirebaseAI/Sources/Types/Public/Tools/AGENTS.md diff --git a/FirebaseAI/AGENTS.md b/FirebaseAI/AGENTS.md new file mode 100644 index 00000000000..5340d3f528f --- /dev/null +++ b/FirebaseAI/AGENTS.md @@ -0,0 +1,177 @@ +# FirebaseAI Codebase Map + +This file provides a consolidated overview of the `FirebaseAI` directory structure and its contents, intended to help AI agents navigate and understand the codebase efficiently. + +--- + +## Sources/ + +This directory contains the main source code for the FirebaseAI library. + +### Files in `Sources/` + +- **`AILog.swift`**: Defines an internal `AILog` enum for logging within the Firebase AI SDK. It includes a `MessageCode` enum for various log messages and helper functions for logging at different levels (error, warning, notice, info, debug). +- **`Chat.swift`**: Defines the `Chat` class, which represents a back-and-forth chat with a `GenerativeModel`. It manages the chat history and provides methods for sending messages. +- **`Constants.swift`**: Defines a `Constants` enum containing constants for the Firebase AI SDK, such as the base error domain. +- **`Errors.swift`**: Defines various error-related structs and enums used for parsing and representing errors from the backend, such as `ErrorStatus` and `RPCStatus`. +- **`FirebaseAI.swift`**: The primary entry point for using the Firebase AI SDK. It provides factory methods for creating `GenerativeModel`, `ImagenModel`, and `LiveGenerativeModel` instances. +- **`FirebaseInfo.swift`**: Encapsulates Firebase-related information used by the SDK, such as project ID, API key, App Check, and Auth interop instances. +- **`GenAIURLSession.swift`**: Provides a `GenAIURLSession` enum with a default `URLSession` instance for the SDK to use. +- **`GenerateContentError.swift`**: Defines the public `GenerateContentError` enum, representing errors that can occur when generating content. +- **`GenerateContentRequest.swift`**: Defines the `GenerateContentRequest` struct, representing a request to generate content from the model. +- **`GenerateContentResponse.swift`**: Represents the model's response to a generate content request, including usage metadata, candidates, and prompt feedback. +- **`GenerationConfig.swift`**: Defines the `GenerationConfig` struct for configuring model parameters (e.g., temperature, topP). +- **`GenerativeAIRequest.swift`**: Defines the `GenerativeAIRequest` protocol for requests sent to the generative AI backend. +- **`GenerativeAIService.swift`**: Responsible for making requests to the generative AI backend, handling authentication, URL construction, and response parsing. +- **`GenerativeModel.swift`**: Defines the `GenerativeModel` class, representing a remote multimodal model. It provides methods for generating content and starting chats. +- **`GenerativeModelSession.swift`**: Provides a simplified interface for single-turn interactions, particularly useful for generating typed objects using the `@Generable` macro. +- **`History.swift`**: A thread-safe class for managing chat history, used by the `Chat` class. +- **`JSONValue.swift`**: Defines the `JSONValue` enum and `JSONObject` typealias for representing JSON values. +- **`ModalityTokenCount.swift`**: Represents token counting information for a single modality. +- **`ModelContent.swift`**: Represents the content of a message to or from the model (can contain multiple `Part`s). +- **`PartsRepresentable.swift`**: Protocol implemented by types that can be converted into an array of `Part`s. +- **`PartsRepresentable+Image.swift`**: Extends `UIImage`, `NSImage`, etc., to conform to `PartsRepresentable`. +- **`Safety.swift`**: Structs and enums related to safety settings and ratings (e.g., `HarmCategory`). +- **`TemplateChatSession.swift`**: Chat session that uses a prompt template. +- **`TemplateGenerateContentRequest.swift`**: Request for generating content from a template. +- **`TemplateGenerativeModel.swift`**: Model for generating content from a prompt template. +- **`TemplateImagenGenerationRequest.swift`**: Request for generating images from a template. +- **`TemplateImagenModel.swift`**: Model for generating images from a prompt template. +- **`TemplateInput.swift`**: Defines the `TemplateInput` enum for representing different types of input to a template. +- **`Tool.swift`**: Structs and enums related to tools and function calling (e.g., `FunctionDeclaration`). + +--- + +## Sources/Protocols/ + +This directory contains Swift protocols used throughout the FirebaseAI library. + +### Public Protocols + +- **`ConvertibleFromGeneratedContent.swift`**: Defines `ConvertibleFromGeneratedContent` protocol for types that can be initialized from `GeneratedContent`. +- **`ToolRepresentable.swift`**: Protocol for types that can be represented as a tool in `FirebaseAILogic`. + +### Internal Protocols + +- **`CodableProtoEnum.swift`**: Provides helper protocols for encoding and decoding protobuf enums (`ProtoEnum`, `DecodableProtoEnum`, `EncodableProtoEnum`). +- **`ConvertibleToGeneratedContent.swift`**: Defines `ConvertibleToGeneratedContent` protocol for internal use. + +--- + +## Sources/Types/ + +Data types used in the FirebaseAI library. + +### Public Types + +- **`Backend.swift`**: Used to configure the backend API (Vertex AI or Google AI). +- **`Part.swift`**: Defines the `Part` protocol and conforming structs (Text, InlineData, FunctionCall, etc.). +- **`ResponseModality.swift`**: Represents types of data a model can produce (text, image, audio). +- **`Schema.swift`**: Allows definition of input and output data types for function calling. +- **`ThinkingConfig.swift`**: Controls the "thinking" behavior of compatible Gemini models. +- **`URLContextMetadata.swift`**: Metadata related to the `Tool.urlContext()` tool. +- **`URLMetadata.swift`**: Metadata for a single URL retrieved by the `Tool.urlContext()` tool. + +#### Sources/Types/Public/Tools/ + +- **`GoogleMaps.swift`**: Tool that allows the model to ground responses in data from Google Maps. +- **`CodeExecution.swift`**: Tool that allows the model to execute code (currently an empty marker struct). + +#### Sources/Types/Public/Imagen/ + +- **`ImagenAspectRatio.swift`**: Represents aspect ratios for generated images (e.g., `square1x1`). +- **`ImagenGenerationConfig.swift`**: Configuration options (negative prompt, aspect ratio, format, etc.). +- **`ImagenGenerationResponse.swift`**: Response containing generated images and potential filter reasons. +- **`ImagenImageFormat.swift`**: Image format options (PNG, JPEG). +- **`ImagenImagesBlockedError.swift`**: Error thrown when all generated images are blocked. +- **`ImagenInlineImage.swift`**: Represents an image generated as inline data. +- **`ImagenModel.swift`**: Main entry point for generating images. +- **`ImagenPersonFilterLevel.swift`**: Filter level for generating images with people. +- **`ImagenSafetyFilterLevel.swift`**: Filter level for sensitive content. +- **`ImagenSafetySettings.swift`**: Settings combining safety and person filter levels. + +#### Sources/Types/Public/Live/ + +- **`AudioTranscriptionConfig.swift`**: Used to enable and configure audio transcriptions for Gemini Live. +- **`LiveAudioTranscription.swift`**: Represents text transcription of audio during live interaction. +- **`LiveGenerationConfig.swift`**: Configuration options for live content generation. +- **`LiveGenerativeModel.swift`**: Multimodal model supporting bidirectional streaming. +- **`LiveServerContent.swift`**: Incremental server update generated by the model. +- **`LiveServerGoingAwayNotice.swift`**: Notification from the server that it will disconnect soon. +- **`LiveServerMessage.swift`**: Represents an update from the server (content, tool call, etc.). +- **`LiveServerToolCall.swift`**: Request from server for client to execute function calls. +- **`LiveServerToolCallCancellation.swift`**: Notification to cancel a previous function call. +- **`LiveSession.swift`**: Represents a live WebSocket session with methods to send real-time data. +- **`LiveSessionErrors.swift`**: Public error structs related to live sessions. +- **`SpeechConfig.swift`**: Controls the voice of the model during conversation. + +#### Sources/Types/Public/StructuredOutput/ + +- **`GeneratedContent.swift`**: Represents structured content generated by a model (wraps `FoundationModels.GeneratedContent`). +- **`GenerationSchema.swift`**: Wraps `FoundationModels.GenerationSchema` for structured output. +- **`GenerationID.swift`**: An identifier for a specific generation. + +### Internal Types + +- **`ProtoDuration.swift`**: Represents a signed, fixed-length span of time (mappings to `google.protobuf.duration`). +- **`InternalPart.swift`**: Defines internal representations for various part types (`InlineData`, `FileData`, etc.). +- **`DataType.swift`**: Enum for OpenAPI data types used in schemas. +- **`APIConfig.swift`**: Configures the generative AI backend API used by the SDK. +- **`AppCheck.swift`**: Internal helper extension for fetching App Check tokens. +- **`ProtoDate.swift`**: Represents a whole or partial calendar date (mappings to `google.type.Date`). + +#### Sources/Types/Internal/Tools/ + +- **`URLContext.swift`**: Empty struct serving to enable the URL context tool. + +#### Sources/Types/Internal/Imagen/ + +- **`ImageGenerationInstance.swift`**: Contains the prompt string. +- **`ImageGenerationOutputOptions.swift`**: Contains mimeType and compression quality. +- **`ImageGenerationParameters.swift`**: Holds all parameters for an image generation request. +- **`ImagenConstants.swift`**: Constants for the Imagen feature. +- **`ImagenGCSImage.swift`**: Represents an image stored in Google Cloud Storage. +- **`ImagenGenerationRequest.swift`**: Encapsulates the entire request sent to the Imagen API. +- **`ImagenImageRepresentable.swift`**: Protocol for types representable as an Imagen image. +- **`ImagenSafetyAttributes.swift`**: Prediction related to safety (currently unused). +- **`InternalImagenImage.swift`**: Internal representation of an Imagen image. +- **`RAIFilteredReason.swift`**: Reason why an image was filtered by Responsible AI. + +#### Sources/Types/Internal/Requests/ + +- **`CountTokensRequest.swift`**: Request structure for the `countTokens` API endpoint. + +#### Sources/Types/Internal/Live/ + +- **`AsyncWebSocket.swift`**: Async/await wrapper around `URLSessionWebSocketTask`. +- **`BidiGenerateContentClientContent.swift`**: Incremental update delivered from the client. +- **`BidiGenerateContentClientMessage.swift`**: Messages a client can send in a bidirectional stream. +- **`BidiGenerateContentRealtimeInput.swift`**: User input sent in real time (audio, video, etc.). +- **`BidiGenerateContentServerContent.swift`**: Incremental server update. +- **`BidiGenerateContentServerMessage.swift`**: Response message from server. +- **`BidiGenerateContentSetup.swift`**: First message sent by client to configure stream. +- **`BidiGenerateContentSetupComplete.swift`**: Sent by server to indicate setup is complete. +- **`BidiGenerateContentToolCall.swift`**: Request from server for function calls. +- **`BidiGenerateContentToolCallCancellation.swift`**: Notification to cancel a tool call. +- **`BidiGenerateContentToolResponse.swift`**: Client response to a tool call. +- **`BidiGenerateContentTranscription.swift`**: Transcribed text from audio input. +- **`BidiGenerationConfig.swift`**: Config for live content generation. +- **`BidiSpeechConfig.swift`**: Speech generation configuration. +- **`GoAway.swift`**: Notification from server that it will disconnect soon. +- **`LiveSessionService.swift`**: Actor managing connection and communication for a `LiveSession`. +- **`VoiceConfig.swift`**: Configuration for the speaker's voice. + +#### Sources/Types/Internal/Errors/ + +- **`BackendError.swift`**: Captures detailed error information from the backend service. +- **`EmptyContentError.swift`**: Specific error for when a candidate has no content and no finish reason. + +--- + +## Sources/Extensions/Internal/ + +Contains internal extensions to data models and other types. + +- **`GenerationSchema+Gemini.swift`**: Extends `GenerationSchema` to transform the schema into a format compatible with the Gemini backend. +- **`JSONSerialization+prettyString.swift`**: Adds a helper method to `JSONSerialization` for pretty-printing JSON data. +- **`ConvertibleFromGeneratedContent+Firebase.swift`**: Extends `FoundationModels.ConvertibleFromGeneratedContent` to initialize from `FirebaseAI.GeneratedContent`. diff --git a/FirebaseAI/Sources/AGENTS.md b/FirebaseAI/Sources/AGENTS.md deleted file mode 100644 index 6c94a693a53..00000000000 --- a/FirebaseAI/Sources/AGENTS.md +++ /dev/null @@ -1,41 +0,0 @@ -# FirebaseAI Source Overview - -This directory contains the source code for the FirebaseAI library. - -## Directories - -- **[`Protocols/`](Protocols/AGENTS.md)**: This directory contains Swift protocols used throughout the FirebaseAI library. These protocols define contracts for data models and services, ensuring a consistent and predictable structure. - -- **[`Types/`](Types/AGENTS.md)**: This directory contains data types used in the FirebaseAI library. These types are organized into `Internal` and `Public` subdirectories. - -## Files - -- **`AILog.swift`**: Defines an internal `AILog` enum for logging within the Firebase AI SDK. It includes a `MessageCode` enum for various log messages, and helper functions for logging at different levels (error, warning, notice, info, debug). It also provides a way to enable verbose logging. -- **`Chat.swift`**: Defines the `Chat` class, which represents a back-and-forth chat with a `GenerativeModel`. It is instantiated via the `startChat(history:)` method on a `GenerativeModel` instance. It manages the chat history and provides `sendMessage` and `sendMessageStream` methods for sending messages to the model. -- **`Constants.swift`**: Defines a `Constants` enum containing constants for the Firebase AI SDK, such as the base error domain. -- **`Errors.swift`**: Defines various error-related structs and enums used for parsing and representing errors from the backend, such as `ErrorStatus`, `ErrorDetails`, and `RPCStatus`. -- **`FirebaseAI.swift`**: Defines the main `FirebaseAI` class, which is the primary entry point for using the Firebase AI SDK. It provides factory methods for creating `GenerativeModel`, `ImagenModel`, and `LiveGenerativeModel` instances. -- **`FirebaseInfo.swift`**: Defines the `FirebaseInfo` struct, which encapsulates Firebase-related information used by the SDK, such as project ID, API key, App Check, and Auth interop instances. -- **`GenAIURLSession.swift`**: Provides a `GenAIURLSession` enum with a `default` URLSession instance for the SDK to use. It includes a workaround for a simulator bug. -- **`GenerateContentError.swift`**: Defines the public `GenerateContentError` enum, which represents errors that can occur when generating content from a model. -- **`GenerateContentRequest.swift`**: Defines the `GenerateContentRequest` struct, which represents a request to generate content from the model. -- **`GenerateContentResponse.swift`**: Defines the `GenerateContentResponse` struct, which represents the model's response to a generate content request. It also defines nested structs like `UsageMetadata`, `Candidate`, `Citation`, `FinishReason`, `PromptFeedback`, and `GroundingMetadata`. -- **`GenerationConfig.swift`**: Defines the `GenerationConfig` struct for configuring model parameters for generative AI requests. -- **`GenerativeAIRequest.swift`**: Defines the `GenerativeAIRequest` protocol for requests sent to the generative AI backend. It also defines `RequestOptions`. -- **`GenerativeAIService.swift`**: Defines the `GenerativeAIService` struct, which is responsible for making requests to the generative AI backend. It handles things like authentication, URL construction, and response parsing. -- **`GenerativeModel.swift`**: Defines the `GenerativeModel` class, which represents a remote multimodal model. It provides methods for generating content, counting tokens, and starting a chat via `startChat(history:)`, which returns a `Chat` instance. -- **`GenerativeModelSession.swift`**: Defines the `GenerativeModelSession` class, which provides a simplified interface for single-turn interactions with a generative model. It's particularly useful for generating typed objects from a model's response using the `@Generable` macro, without the conversational turn-based structure of a `Chat`. -- **`History.swift`**: Defines the `History` class, a thread-safe class for managing the chat history, used by the `Chat` class. -- **`JSONValue.swift`**: Defines the `JSONValue` enum and `JSONObject` typealias for representing JSON values. -- **`ModalityTokenCount.swift`**: Defines the `ModalityTokenCount` and `ContentModality` structs for representing token counting information for a single modality. -- **`ModelContent.swift`**: Defines the `ModelContent` struct, which represents the content of a message to or from the model. It can contain multiple `Part`s. -- **`PartsRepresentable.swift`**: Defines the `PartsRepresentable` protocol, which is implemented by types that can be converted into an array of `Part`s. -- **`PartsRepresentable+Image.swift`**: Extends `UIImage`, `NSImage`, `CGImage`, and `CIImage` to conform to `PartsRepresentable`, allowing them to be used as input to the model. -- **`Safety.swift`**: Defines structs and enums related to safety settings and ratings, such as `SafetyRating`, `SafetySetting`, and `HarmCategory`. -- **`TemplateChatSession.swift`**: Defines the `TemplateChatSession` class for a chat session that uses a prompt template. -- **`TemplateGenerateContentRequest.swift`**: Defines the `TemplateGenerateContentRequest` struct for generating content from a template. -- **`TemplateGenerativeModel.swift`**: Defines the `TemplateGenerativeModel` class for generating content from a prompt template. -- **`TemplateImagenGenerationRequest.swift`**: Defines the `TemplateImagenGenerationRequest` struct for generating images from a template. -- **`TemplateImagenModel.swift`**: Defines the `TemplateImagenModel` class for generating images from a prompt template. -- **`TemplateInput.swift`**: Defines the `TemplateInput` enum for representing different types of input to a template. -- **`Tool.swift`**: Defines structs and enums related to tools and function calling, such as `FunctionDeclaration`, `Tool`, and `ToolConfig`. diff --git a/FirebaseAI/Sources/Extensions/Internal/AGENTS.md b/FirebaseAI/Sources/Extensions/Internal/AGENTS.md deleted file mode 100644 index 8c03b84cb55..00000000000 --- a/FirebaseAI/Sources/Extensions/Internal/AGENTS.md +++ /dev/null @@ -1,7 +0,0 @@ -# Internal Extensions - -This directory contains internal extensions to data models and other types. These extensions provide functionality that is specific to the internal workings of the Firebase AI SDK and are not part of the public API. - -## Files - -- **`GenerationSchema+Gemini.swift`**: This file extends `GenerationSchema` to provide a `toGeminiJSONSchema()` method. This method transforms the schema into a format that is compatible with the Gemini backend, including renaming properties like `x-order` to `propertyOrdering`. This file is conditionally compiled and is only available when `FoundationModels` can be imported. diff --git a/FirebaseAI/Sources/Protocols/AGENTS.md b/FirebaseAI/Sources/Protocols/AGENTS.md deleted file mode 100644 index bb60d129f78..00000000000 --- a/FirebaseAI/Sources/Protocols/AGENTS.md +++ /dev/null @@ -1,11 +0,0 @@ -# FirebaseAI Protocols - -This directory contains Swift protocols used throughout the FirebaseAI library. -These protocols define contracts for data models and services, ensuring a consistent and predictable structure. - -When adding new features, refer to the existing protocols to maintain consistency. -If a new protocol is needed, define it here. - -## Directories - -- **[`Internal/`](Internal/AGENTS.md)**: This directory contains internal protocols not meant for public consumption. diff --git a/FirebaseAI/Sources/Protocols/Internal/AGENTS.md b/FirebaseAI/Sources/Protocols/Internal/AGENTS.md deleted file mode 100644 index 61175f57de6..00000000000 --- a/FirebaseAI/Sources/Protocols/Internal/AGENTS.md +++ /dev/null @@ -1,9 +0,0 @@ -# FirebaseAI Internal Protocols - -This directory contains internal protocols not meant for public consumption. -These are used for internal workings of the FirebaseAI library. -Protocols in this directory are subject to change without notice and should not be relied upon by external code. - -### Files - -- **`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`. diff --git a/FirebaseAI/Sources/Types/AGENTS.md b/FirebaseAI/Sources/Types/AGENTS.md deleted file mode 100644 index 287ee8033a4..00000000000 --- a/FirebaseAI/Sources/Types/AGENTS.md +++ /dev/null @@ -1,9 +0,0 @@ -# FirebaseAI Types - -This directory contains data types used in the FirebaseAI library. -These types are organized into `Internal` and `Public` subdirectories. - -- **[`Public/`](Public/AGENTS.md)**: Public types are part of the public API of the library and are safe to be used by developers. -- **[`Internal/`](Internal/AGENTS.md)**: Internal types are used for the internal implementation of the library and are not meant for public consumption. They can change at any time without notice. - -When adding a new data type, consider whether it should be part of the public API or not and place it in the corresponding directory. diff --git a/FirebaseAI/Sources/Types/Internal/AGENTS.md b/FirebaseAI/Sources/Types/Internal/AGENTS.md deleted file mode 100644 index 87d89b75116..00000000000 --- a/FirebaseAI/Sources/Types/Internal/AGENTS.md +++ /dev/null @@ -1,12 +0,0 @@ -# FirebaseAI Internal Types - -This directory contains internal data types used for the implementation of the FirebaseAI library. -These types are not part of the public API and should not be used directly by developers. -They are subject to change without notice. - -This directory is further organized into subdirectories based on the feature they are related to, for example: -- **[`Errors/`](Errors/AGENTS.md)**: Internal error types. -- **[`Imagen/`](Imagen/AGENTS.md)**: Internal types related to Imagen models. -- **[`Live/`](Live/AGENTS.md)**: Internal types related to real-time features. -- **[`Requests/`](Requests/AGENTS.md)**: Internal types for API requests. -- **[`Tools/`](Tools/AGENTS.md)**: Internal types for function calling. diff --git a/FirebaseAI/Sources/Types/Internal/Errors/AGENTS.md b/FirebaseAI/Sources/Types/Internal/Errors/AGENTS.md deleted file mode 100644 index 88a5c36121c..00000000000 --- a/FirebaseAI/Sources/Types/Internal/Errors/AGENTS.md +++ /dev/null @@ -1,10 +0,0 @@ -# FirebaseAI Internal Error Types - -This directory contains internal error types used within the FirebaseAI library. -These errors are not part of the public API and are used to handle specific error conditions within the SDK. - -### Files - -- **`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. - -- **`EmptyContentError.swift`**: Defines a specific error for when a `Candidate` is returned with no content and no finish reason. This is a nested struct within an extension of `Candidate`. diff --git a/FirebaseAI/Sources/Types/Internal/Imagen/AGENTS.md b/FirebaseAI/Sources/Types/Internal/Imagen/AGENTS.md deleted file mode 100644 index d00f98f34df..00000000000 --- a/FirebaseAI/Sources/Types/Internal/Imagen/AGENTS.md +++ /dev/null @@ -1,29 +0,0 @@ -# FirebaseAI Internal Imagen Types - -This directory contains internal data types related to the Imagen feature. -These types are used for constructing requests and parsing responses from the Imagen image generation service. -They are not meant for public consumption and can change at any time. - -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. - -### Files - -- **`ImageGenerationInstance.swift`**: Defines the `ImageGenerationInstance` struct, which contains a `prompt` string for the image generation. - -- **`ImageGenerationOutputOptions.swift`**: Defines the `ImageGenerationOutputOptions` struct, containing `mimeType` and `compressionQuality` for the generated image. - -- **`ImageGenerationParameters.swift`**: Defines the `ImageGenerationParameters` struct, which holds all the parameters for an image generation request, such as `sampleCount`, `storageURI`, `negativePrompt`, etc. - -- **`ImagenConstants.swift`**: Defines constants for the Imagen feature, including the error domain and specific error codes like `imagesBlocked`. - -- **`ImagenGCSImage.swift`**: Defines the `ImagenGCSImage` struct, representing an image generated by Imagen and stored in Google Cloud Storage (GCS). It includes the `mimeType` and `gcsURI`. - -- **`ImagenGenerationRequest.swift`**: Defines the `ImagenGenerationRequest` struct, which encapsulates the entire request sent to the Imagen API, including the model, API configuration, instances, and parameters. - -- **`ImagenImageRepresentable.swift`**: Defines the `ImagenImageRepresentable` protocol for types that can be represented as an Imagen image. This is for internal use. - -- **`ImagenSafetyAttributes.swift`**: Defines the `ImagenSafetyAttributes` struct. This is a prediction from Imagen related to safety, but it is currently unused by the SDK. - -- **`InternalImagenImage.swift`**: Defines the `_InternalImagenImage` struct, which is the internal representation of an Imagen image, containing the `mimeType`, `bytesBase64Encoded`, and `gcsURI`. - -- **`RAIFilteredReason.swift`**: Defines the `RAIFilteredReason` struct, which contains the reason why an image was filtered by Responsible AI (RAI). diff --git a/FirebaseAI/Sources/Types/Internal/Live/AGENTS.md b/FirebaseAI/Sources/Types/Internal/Live/AGENTS.md deleted file mode 100644 index a8fb553a715..00000000000 --- a/FirebaseAI/Sources/Types/Internal/Live/AGENTS.md +++ /dev/null @@ -1,42 +0,0 @@ -# FirebaseAI Internal Live Types - -This directory contains internal data types for real-time and streaming features of the FirebaseAI library. -The types here are used for bidirectional communication with the backend, for example, in streaming chat sessions or real-time transcription. - -These types are not part of the public API and are subject to change. - -### Files - -- **`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. - -- **`BidiGenerateContentClientContent.swift`**: Defines the `BidiGenerateContentClientContent` struct, which represents an incremental update of the current conversation delivered from the client. - -- **`BidiGenerateContentClientMessage.swift`**: Defines the `BidiGenerateContentClientMessage` enum, which represents all possible messages a client can send in a bidirectional streaming RPC. This includes setup, content, real-time input, and tool responses. - -- **`BidiGenerateContentRealtimeInput.swift`**: Defines the `BidiGenerateContentRealtimeInput` struct, for user input that is sent in real time, such as audio, video, or text. - -- **`BidiGenerateContentServerContent.swift`**: Defines the `BidiGenerateContentServerContent` struct, which is an incremental server update generated by the model in response to client messages. - -- **`BidiGenerateContentServerMessage.swift`**: Defines the `BidiGenerateContentServerMessage` struct and its nested `MessageType` enum, representing a response message from the server in a bidirectional streaming RPC. It can be a setup completion, server content, a tool call, a tool call cancellation, or a go-away notification. - -- **`BidiGenerateContentSetup.swift`**: Defines the `BidiGenerateContentSetup` struct, which is the first message sent by the client to configure the streaming RPC. It contains the model name, generation config, system instruction, tools, and other settings. - -- **`BidiGenerateContentSetupComplete.swift`**: Defines the `BidiGenerateContentSetupComplete` struct, which is an empty struct sent by the server to indicate that the setup is complete. - -- **`BidiGenerateContentToolCall.swift`**: Defines the `BidiGenerateContentToolCall` struct, which is a request from the server for the client to execute one or more function calls. - -- **`BidiGenerateContentToolCallCancellation.swift`**: Defines the `BidiGenerateContentToolCallCancellation` struct, a notification from the server to cancel a previously issued tool call. - -- **`BidiGenerateContentToolResponse.swift`**: Defines the `BidiGenerateContentToolResponse` struct, which is a client-generated response to a `ToolCall` from the server. - -- **`BidiGenerateContentTranscription.swift`**: Defines the `BidiGenerateContentTranscription` struct, which contains the transcribed text from an audio input. - -- **`BidiGenerationConfig.swift`**: Defines the `BidiGenerationConfig` struct, which holds configuration options for live content generation, such as temperature, topP, topK, etc. - -- **`BidiSpeechConfig.swift`**: Defines the `BidiSpeechConfig` struct, for speech generation configuration, including voice configuration and language code. - -- **`GoAway.swift`**: Defines the `GoAway` struct, which is a notification from the server that it will disconnect soon, providing the time left before termination. - -- **`LiveSessionService.swift`**: Defines the `LiveSessionService` actor, which manages the connection and communication with the backend for a `LiveSession`. It handles setting up the web socket, sending and receiving messages, and managing the session's lifecycle. - -- **`VoiceConfig.swift`**: Defines the `VoiceConfig` enum, which represents the configuration for the speaker's voice. It can be either a `prebuiltVoiceConfig` with a voice name or a `customVoiceConfig` with a voice sample. diff --git a/FirebaseAI/Sources/Types/Internal/Requests/AGENTS.md b/FirebaseAI/Sources/Types/Internal/Requests/AGENTS.md deleted file mode 100644 index 2ade19c79ab..00000000000 --- a/FirebaseAI/Sources/Types/Internal/Requests/AGENTS.md +++ /dev/null @@ -1,9 +0,0 @@ -# FirebaseAI Internal Request Types - -This directory contains internal data types for API requests. -These types encapsulate the data that needs to be sent to the backend for various operations. -They are not part of the public API and can change at any time. - -### Files - -- **`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. diff --git a/FirebaseAI/Sources/Types/Internal/Tools/AGENTS.md b/FirebaseAI/Sources/Types/Internal/Tools/AGENTS.md deleted file mode 100644 index a9ace8dd4c4..00000000000 --- a/FirebaseAI/Sources/Types/Internal/Tools/AGENTS.md +++ /dev/null @@ -1,9 +0,0 @@ -# FirebaseAI Internal Tool-related Types - -This directory contains internal data types related to tools and function calling. -These types are used to provide context to tools that can be executed by the model. -These types are internal and subject to change. - -### Files - -- **`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. diff --git a/FirebaseAI/Sources/Types/Public/AGENTS.md b/FirebaseAI/Sources/Types/Public/AGENTS.md deleted file mode 100644 index fe6e22a1362..00000000000 --- a/FirebaseAI/Sources/Types/Public/AGENTS.md +++ /dev/null @@ -1,22 +0,0 @@ -# FirebaseAI Public Types - -This directory contains public data types that are part of the FirebaseAI library's public API. -These types are safe for developers to use and are documented in the official Firebase documentation. - -The types are organized into subdirectories based on the feature they are related to, for example: -- **[`Imagen/`](Imagen/AGENTS.md)**: Public types related to Imagen models. -- **[`Live/`](Live/AGENTS.md)**: Public types related to real-time features. -- **[`Tools/`](Tools/AGENTS.md)**: Public types for function calling. - -When adding a new public type, it should be placed in the appropriate subdirectory. -Any changes to these types must be done carefully to avoid breaking changes for users. - -### Files - -- **`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. -- **`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. -- **`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`). -- **`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. -- **`ThinkingConfig.swift`**: Defines the `ThinkingConfig` struct, for controlling the "thinking" behavior of compatible Gemini models. It includes parameters like `thinkingBudget` and `includeThoughts`. -- **`URLContextMetadata.swift`**: Defines the `URLContextMetadata` struct, which contains metadata related to the `Tool.urlContext()` tool. -- **`URLMetadata.swift`**: Defines the `URLMetadata` struct, which contains metadata for a single URL retrieved by the `Tool.urlContext()` tool, including the `retrievalStatus`. diff --git a/FirebaseAI/Sources/Types/Public/Imagen/AGENTS.md b/FirebaseAI/Sources/Types/Public/Imagen/AGENTS.md deleted file mode 100644 index 54aaebf5f6c..00000000000 --- a/FirebaseAI/Sources/Types/Public/Imagen/AGENTS.md +++ /dev/null @@ -1,26 +0,0 @@ -# FirebaseAI Public Imagen Types - -This directory contains public data types for the Imagen image generation feature. -These types are part of the public API and are used by developers to interact with the Imagen service. - -### Files - -- **`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. - -- **`ImagenGenerationConfig.swift`**: Defines the `ImagenGenerationConfig` struct, which contains configuration options for generating images with Imagen, such as `negativePrompt`, `numberOfImages`, `aspectRatio`, `imageFormat`, and `addWatermark`. - -- **`ImagenGenerationResponse.swift`**: Defines the `ImagenGenerationResponse` struct, which is the response from a request to generate images. It contains the generated `images` and a `filteredReason` if any images were filtered. - -- **`ImagenImageFormat.swift`**: Defines the `ImagenImageFormat` struct, which represents the image format for generated images. It provides static methods for `png()` and `jpeg(compressionQuality:)`. - -- **`ImagenImagesBlockedError.swift`**: Defines the `ImagenImagesBlockedError` error, which occurs when image generation fails due to all generated images being blocked. - -- **`ImagenInlineImage.swift`**: Defines the `ImagenInlineImage` struct, which represents an image generated by Imagen as inline data. It contains the `mimeType` and the image `data`. - -- **`ImagenModel.swift`**: Defines the `ImagenModel` class, which is the main entry point for generating images. It has methods like `generateImages(prompt:)` to generate images from a text prompt. - -- **`ImagenPersonFilterLevel.swift`**: Defines the `ImagenPersonFilterLevel` struct, which is a filter level controlling whether generation of images containing people or faces is allowed. - -- **`ImagenSafetyFilterLevel.swift`**: Defines the `ImagenSafetyFilterLevel` struct, which is a filter level controlling how aggressively to filter sensitive content. - -- **`ImagenSafetySettings.swift`**: Defines the `ImagenSafetySettings` struct, which contains settings for controlling the aggressiveness of filtering out sensitive content, including `safetyFilterLevel` and `personFilterLevel`. diff --git a/FirebaseAI/Sources/Types/Public/Live/AGENTS.md b/FirebaseAI/Sources/Types/Public/Live/AGENTS.md deleted file mode 100644 index b5ed6f9d20f..00000000000 --- a/FirebaseAI/Sources/Types/Public/Live/AGENTS.md +++ /dev/null @@ -1,30 +0,0 @@ -# FirebaseAI Public Live Types - -This directory contains public data types for real-time and streaming features of the FirebaseAI library. -These types are used by developers to interact with live, streaming services, such as real-time chat sessions or audio transcription. - -### Files - -- **`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. - -- **`LiveAudioTranscription.swift`**: Defines the `LiveAudioTranscription` struct, which represents the text transcription of audio during a live interaction with the model. - -- **`LiveGenerationConfig.swift`**: Defines the `LiveGenerationConfig` struct, which contains a wide range of configuration options for live content generation, such as `temperature`, `topP`, `topK`, `candidateCount`, `maxOutputTokens`, etc. - -- **`LiveGenerativeModel.swift`**: Defines the `LiveGenerativeModel` class, which is a multimodal model capable of real-time content generation based on various input types, supporting bidirectional streaming. Its main function is `connect()`, which starts a `LiveSession`. - -- **`LiveServerContent.swift`**: Defines the `LiveServerContent` struct, which represents an incremental server update generated by the model in response to client messages. It includes properties like `modelTurn`, `isTurnComplete`, `wasInterrupted`, etc. - -- **`LiveServerGoingAwayNotice.swift`**: Defines the `LiveServerGoingAwayNotice` struct, which is a notification from the server that it will disconnect soon, including the `timeLeft`. - -- **`LiveServerMessage.swift`**: Defines the `LiveServerMessage` struct, which represents an update from the server. It contains a `payload` enum that can be content, a tool call, a tool call cancellation, or a going away notice. - -- **`LiveServerToolCall.swift`**: Defines the `LiveServerToolCall` struct, which is a request from the server for the client to execute the provided function calls. - -- **`LiveServerToolCallCancellation.swift`**: Defines the `LiveServerToolCallCancellation` struct, a notification for the client to cancel a previous function call. - -- **`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. - -- **`LiveSessionErrors.swift`**: Defines several public error structs related to live sessions: `LiveSessionUnsupportedMessageError`, `LiveSessionLostConnectionError`, `LiveSessionUnexpectedClosureError`, and `LiveSessionSetupError`. - -- **`SpeechConfig.swift`**: Defines the `SpeechConfig` struct, for controlling the voice of the model during conversation, including the `voiceName` and `languageCode`. diff --git a/FirebaseAI/Sources/Types/Public/Tools/AGENTS.md b/FirebaseAI/Sources/Types/Public/Tools/AGENTS.md deleted file mode 100644 index 0da289bfec8..00000000000 --- a/FirebaseAI/Sources/Types/Public/Tools/AGENTS.md +++ /dev/null @@ -1,9 +0,0 @@ -# FirebaseAI Public Tool-related Types - -This directory contains public data types related to tools and function calling. -These types are used by developers to define and configure tools that the model can execute. - -### Files - -- **`GoogleMaps.swift`**: Defines the `GoogleMaps` struct, which is a tool that allows the model to ground its responses in data from Google Maps. It also defines the `GoogleMapsGroundingChunk` struct, which represents a grounding chunk sourced from Google Maps. -- **`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. diff --git a/Package.swift b/Package.swift index 2b21de6085c..f50079b489a 100644 --- a/Package.swift +++ b/Package.swift @@ -193,23 +193,6 @@ let package = Package( "FirebaseCoreExtension", ], path: "FirebaseAI/Sources", - exclude: [ - "AGENTS.md", - "Types/Internal/Imagen/AGENTS.md", - "Extensions/Internal/AGENTS.md", - "Types/Public/AGENTS.md", - "Types/Public/Imagen/AGENTS.md", - "Types/Public/Live/AGENTS.md", - "Protocols/Internal/AGENTS.md", - "Types/Internal/AGENTS.md", - "Types/Internal/Tools/AGENTS.md", - "Types/Internal/Live/AGENTS.md", - "Types/Internal/Errors/AGENTS.md", - "Types/Public/Tools/AGENTS.md", - "Types/AGENTS.md", - "Protocols/AGENTS.md", - "Types/Internal/Requests/AGENTS.md", - ], swiftSettings: [ isFoundationModelsSupportedPlatformSwiftSetting(), ], From 7fdd7cd1de9430cade424eabcbbcab1739a9fda0 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 9 Apr 2026 15:53:56 -0700 Subject: [PATCH 10/10] review --- Package.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index f50079b489a..c93b1bd9522 100644 --- a/Package.swift +++ b/Package.swift @@ -563,10 +563,7 @@ let package = Package( .target( name: "FirebaseCrashlyticsSwift", dependencies: ["FirebaseRemoteConfigInterop"], - path: "Crashlytics/Crashlytics/Rollouts", - sources: [ - ".", - ] + path: "Crashlytics/Crashlytics/Rollouts" ), .testTarget( name: "FirebaseCrashlyticsSwiftUnit",