@@ -30,7 +30,11 @@ public class Chat {
30
30
/// model. This will be provided to the model for each message sent as context for the discussion.
31
31
public var history : [ ModelContent ]
32
32
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.
34
38
public func sendMessage( _ parts: any ThrowingPartsRepresentable ... ) async throws
35
39
-> GenerateContentResponse {
36
40
return try await sendMessage ( [ ModelContent ( parts: parts) ] )
@@ -98,7 +102,10 @@ public class Chat {
98
102
return try await sendMessage ( [ functionResponseContent] )
99
103
}
100
104
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.
102
109
@available ( macOS 12 . 0 , * )
103
110
public func sendMessageStream( _ parts: any ThrowingPartsRepresentable ... )
104
111
-> AsyncThrowingStream < GenerateContentResponse , Error > {
0 commit comments