Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vertex AI] Make Constants file internal and fix typos #12916

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import Foundation
#warning("Only iOS, macOS, and Catalyst targets are currently fully supported.")
#endif

/// Constants associated with the GenerativeAISwift SDK.
/// Constants associated with the Vertex AI for Firebase SDK.
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
public enum GenerativeAISwift {
enum Constants {
/// The Vertex AI backend endpoint URL.
static let baseURL = "https://firebaseml.googleapis.com"
}
2 changes: 1 addition & 1 deletion FirebaseVertexAI/Sources/CountTokensRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension CountTokensRequest: GenerativeAIRequest {
typealias Response = CountTokensResponse

var url: URL {
URL(string: "\(GenerativeAISwift.baseURL)/\(options.apiVersion)/\(model):countTokens")!
URL(string: "\(Constants.baseURL)/\(options.apiVersion)/\(model):countTokens")!
}
}

Expand Down
2 changes: 1 addition & 1 deletion FirebaseVertexAI/Sources/GenerateContentRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extension GenerateContentRequest: GenerativeAIRequest {
typealias Response = GenerateContentResponse

var url: URL {
let modelURL = "\(GenerativeAISwift.baseURL)/\(options.apiVersion)/\(model)"
let modelURL = "\(Constants.baseURL)/\(options.apiVersion)/\(model)"
if isStreaming {
return URL(string: "\(modelURL):streamGenerateContent?alt=sse")!
} else {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseVertexAI/Sources/ModelContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Foundation
/// may comprise multiple heterogeneous ``ModelContent/Part``s.
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
public struct ModelContent: Equatable {
/// A discrete piece of data in a media format intepretable by an AI model. Within a single value
/// A discrete piece of data in a media format interpretable by an AI model. Within a single value
/// of ``Part``, different data types may not mix.
public enum Part: Equatable {
/// Text value.
Expand Down
5 changes: 2 additions & 3 deletions FirebaseVertexAI/Sources/Safety.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ public struct SafetyRating: Equatable, Hashable {
public let category: SafetySetting.HarmCategory

/// The model-generated probability that a given piece of content falls under the harm category
/// described in ``category``. This does not
/// indiciate the severity of harm for a piece of content. See ``HarmProbability`` for a list of
/// possible values.
/// described in ``SafetySetting/HarmCategory``. This does not indicate the severity of harm for a
/// piece of content. See ``HarmProbability`` for a list of possible values.
public let probability: HarmProbability

/// Initializes a new `SafetyRating` instance with the given category and probability.
Expand Down
2 changes: 1 addition & 1 deletion FirebaseVertexAI/Sources/VertexAI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Foundation
// Avoids exposing internal FirebaseCore APIs to Swift users.
@_implementationOnly import FirebaseCoreExtension

/// The Vertex AI service for Firebase.
/// The Vertex AI for Firebase SDK provides access to Gemini models directly from your app.
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
public class VertexAI: NSObject {
// MARK: - Public APIs
Expand Down
Loading