@@ -53,22 +53,7 @@ public ChatSession(GenerativeModel model) {
53
53
*/
54
54
@ BetaApi
55
55
public ResponseStream <GenerateContentResponse > sendMessageStream (String text ) throws IOException {
56
- return sendMessageStream (text , GenerateContentConfig .newBuilder ().build ());
57
- }
58
-
59
- /**
60
- * Sends a message to the model and returns a stream of responses.
61
- *
62
- * @param text the message to be sent.
63
- * @param config a {@link GenerateContentConfig} that contains all the configs for sending message
64
- * in a chat session.
65
- * @return an iterable in which each element is a GenerateContentResponse. Can be converted to
66
- * stream by stream() method.
67
- */
68
- @ BetaApi
69
- public ResponseStream <GenerateContentResponse > sendMessageStream (
70
- String text , GenerateContentConfig config ) throws IOException {
71
- return sendMessageStream (ContentMaker .fromString (text ), config );
56
+ return sendMessageStream (ContentMaker .fromString (text ));
72
57
}
73
58
74
59
/**
@@ -81,25 +66,9 @@ public ResponseStream<GenerateContentResponse> sendMessageStream(
81
66
@ BetaApi
82
67
public ResponseStream <GenerateContentResponse > sendMessageStream (Content content )
83
68
throws IOException , IllegalArgumentException {
84
- return sendMessageStream (content , GenerateContentConfig .newBuilder ().build ());
85
- }
86
-
87
- /**
88
- * Sends a message to the model and returns a stream of responses.
89
- *
90
- * @param content the content to be sent.
91
- * @param config a {@link GenerateContentConfig} that contains all the configs for sending message
92
- * in a chat session.
93
- * @return an iterable in which each element is a GenerateContentResponse. Can be converted to
94
- * stream by stream() method.
95
- */
96
- @ BetaApi
97
- public ResponseStream <GenerateContentResponse > sendMessageStream (
98
- Content content , GenerateContentConfig config ) throws IOException {
99
69
checkLastResponseAndEditHistory ();
100
70
history .add (content );
101
- ResponseStream <GenerateContentResponse > respStream =
102
- model .generateContentStream (history , config );
71
+ ResponseStream <GenerateContentResponse > respStream = model .generateContentStream (history );
103
72
currentResponseStream = respStream ;
104
73
currentResponse = null ;
105
74
return respStream ;
@@ -113,21 +82,7 @@ public ResponseStream<GenerateContentResponse> sendMessageStream(
113
82
*/
114
83
@ BetaApi
115
84
public GenerateContentResponse sendMessage (String text ) throws IOException {
116
- return sendMessage (text , GenerateContentConfig .newBuilder ().build ());
117
- }
118
-
119
- /**
120
- * Sends a message to the model and returns a response.
121
- *
122
- * @param text the message to be sent.
123
- * @param config a {@link GenerateContentConfig} that contains all the configs for sending message
124
- * in a chat session.
125
- * @return a response.
126
- */
127
- @ BetaApi
128
- public GenerateContentResponse sendMessage (String text , GenerateContentConfig config )
129
- throws IOException {
130
- return sendMessage (ContentMaker .fromString (text ), config );
85
+ return sendMessage (ContentMaker .fromString (text ));
131
86
}
132
87
133
88
/**
@@ -138,23 +93,9 @@ public GenerateContentResponse sendMessage(String text, GenerateContentConfig co
138
93
*/
139
94
@ BetaApi
140
95
public GenerateContentResponse sendMessage (Content content ) throws IOException {
141
- return sendMessage (content , GenerateContentConfig .newBuilder ().build ());
142
- }
143
-
144
- /**
145
- * Sends a message to the model and returns a response.
146
- *
147
- * @param content the content to be sent.
148
- * @param config a {@link GenerateContentConfig} that contains all the configs for sending message
149
- * in a chat session.
150
- * @return a response.
151
- */
152
- @ BetaApi
153
- public GenerateContentResponse sendMessage (Content content , GenerateContentConfig config )
154
- throws IOException {
155
96
checkLastResponseAndEditHistory ();
156
97
history .add (content );
157
- GenerateContentResponse response = model .generateContent (history , config );
98
+ GenerateContentResponse response = model .generateContent (history );
158
99
currentResponse = response ;
159
100
currentResponseStream = null ;
160
101
return response ;
0 commit comments