Skip to content

Commit 440a2e2

Browse files
morganchen12G.Dev.Ssomsak
authored and
G.Dev.Ssomsak
committed
update doc comments (google-gemini#166)
1 parent 9612bb8 commit 440a2e2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Sources/GoogleAI/Chat.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ public class Chat {
3030
/// model. This will be provided to the model for each message sent as context for the discussion.
3131
public var history: [ModelContent]
3232

33-
/// See ``sendMessage(_:)-3ify5``.
33+
/// Sends a message using the existing history of this chat as context. If successful, the message
34+
/// and response will be added to the history. If unsuccessful, history will remain unchanged.
35+
/// - Parameter parts: The new content to send as a single chat message.
36+
/// - Returns: The model's response if no error occurred.
37+
/// - Throws: A ``GenerateContentError`` if an error occurred.
3438
public func sendMessage(_ parts: any ThrowingPartsRepresentable...) async throws
3539
-> GenerateContentResponse {
3640
return try await sendMessage([ModelContent(parts: parts)])
@@ -98,7 +102,10 @@ public class Chat {
98102
return try await sendMessage([functionResponseContent])
99103
}
100104

101-
/// See ``sendMessageStream(_:)-4abs3``.
105+
/// Sends a message using the existing history of this chat as context. If successful, the message
106+
/// and response will be added to the history. If unsuccessful, history will remain unchanged.
107+
/// - Parameter parts: The new content to send as a single chat message.
108+
/// - Returns: A stream containing the model's response or an error if an error occurred.
102109
@available(macOS 12.0, *)
103110
public func sendMessageStream(_ parts: any ThrowingPartsRepresentable...)
104111
-> AsyncThrowingStream<GenerateContentResponse, Error> {

Sources/GoogleAI/GenerativeAISwift.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ import Foundation
1717
#warning("Only iOS, macOS, and Catalyst targets are currently fully supported.")
1818
#endif
1919

20-
/// Constants associated with the GenerativeAISwift SDK
20+
/// Constants associated with the GenerativeAISwift SDK.
2121
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
2222
public enum GenerativeAISwift {
2323
/// String value of the SDK version
2424
public static let version = "0.5.2"
25+
/// The Google AI backend endpoint URL.
2526
static let baseURL = "https://generativelanguage.googleapis.com"
2627
}

0 commit comments

Comments
 (0)