@@ -30,11 +30,7 @@ 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
- /// 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.
33
+ /// See ``sendMessage(_:)-3ify5``.
38
34
public func sendMessage( _ parts: any ThrowingPartsRepresentable ... ) async throws
39
35
-> GenerateContentResponse {
40
36
return try await sendMessage ( [ ModelContent ( parts: parts) ] )
@@ -102,10 +98,7 @@ public class Chat {
102
98
return try await sendMessage ( [ functionResponseContent] )
103
99
}
104
100
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.
101
+ /// See ``sendMessageStream(_:)-4abs3``.
109
102
@available ( macOS 12 . 0 , * )
110
103
public func sendMessageStream( _ parts: any ThrowingPartsRepresentable ... )
111
104
-> AsyncThrowingStream < GenerateContentResponse , Error > {
@@ -182,7 +175,7 @@ public class Chat {
182
175
case let . text( str) :
183
176
combinedText += str
184
177
185
- case . data, . fileData , . functionCall, . functionResponse:
178
+ case . data, . functionCall, . functionResponse:
186
179
// Don't combine it, just add to the content. If there's any text pending, add that as
187
180
// a part.
188
181
if !combinedText. isEmpty {
0 commit comments