Skip to content

Commit

Permalink
docs: [vertexai] Mark generateContent variants with GenerationConfig …
Browse files Browse the repository at this point in the history
…and List<SafetySetting> as deprecated. (#10474)

PiperOrigin-RevId: 612859526

Co-authored-by: Zhenyi Qi <zhenyiqi@google.com>
  • Loading branch information
copybara-service[bot] and ZhenyiQ committed Mar 5, 2024
1 parent bcec849 commit 7cf463b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ public ResponseStream<GenerateContentResponse> sendMessageStream(
* @param generationConfig the generation config.
* @return an iterable in which each element is a GenerateContentResponse. Can be converted to
* stream by stream() method.
* @deprecated use {@link #sendMessageStream(String, GenerateContentConfig)} instead
*/
@BetaApi
@Deprecated
public ResponseStream<GenerateContentResponse> sendMessageStream(
String text, GenerationConfig generationConfig) throws IOException {
return sendMessageStream(text, generationConfig, null);
Expand All @@ -94,8 +96,10 @@ public ResponseStream<GenerateContentResponse> sendMessageStream(
* @param safetySettings the safety settings.
* @return an iterable in which each element is a GenerateContentResponse. Can be converted to
* stream by stream() method.
* @deprecated use {@link #sendMessageStream(String, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> sendMessageStream(
String text, List<SafetySetting> safetySettings) throws IOException {
return sendMessageStream(text, null, safetySettings);
Expand All @@ -109,8 +113,10 @@ public ResponseStream<GenerateContentResponse> sendMessageStream(
* @param safetySettings the safety settings.
* @return an iterable in which each element is a GenerateContentResponse. Can be converted to
* stream by stream() method.
* @deprecated use {@link #sendMessageStream(String, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> sendMessageStream(
String text, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down Expand Up @@ -166,8 +172,10 @@ public ResponseStream<GenerateContentResponse> sendMessageStream(
* @param generationConfig the generation config.
* @return an iterable in which each element is a GenerateContentResponse. Can be converted to
* stream by stream() method.
* @deprecated use {@link #sendMessageStream(Content, GenerateContentConfig)} instead
*/
@BetaApi
@Deprecated
public ResponseStream<GenerateContentResponse> sendMessageStream(
Content content, GenerationConfig generationConfig)
throws IOException, IllegalArgumentException {
Expand All @@ -181,8 +189,10 @@ public ResponseStream<GenerateContentResponse> sendMessageStream(
* @param safetySettings the safety settings.
* @return an iterable in which each element is a GenerateContentResponse. Can be converted to
* stream by stream() method.
* @deprecated use {@link #sendMessageStream(Content, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> sendMessageStream(
Content content, List<SafetySetting> safetySettings)
throws IOException, IllegalArgumentException {
Expand All @@ -197,8 +207,10 @@ public ResponseStream<GenerateContentResponse> sendMessageStream(
* @param safetySettings the safety settings.
* @return an iterable in which each element is a GenerateContentResponse. Can be converted to
* stream by stream() method.
* @deprecated use {@link #sendMessageStream(Content, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> sendMessageStream(
Content content, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down Expand Up @@ -243,8 +255,10 @@ public GenerateContentResponse sendMessage(String text, GenerateContentConfig co
* @param text the message to be sent.
* @param generationConfig the generation config.
* @return a response.
* @deprecated use {@link #sendMessage(Content, GenerateContentConfig)} instead
*/
@BetaApi
@Deprecated
public GenerateContentResponse sendMessage(String text, GenerationConfig generationConfig)
throws IOException {
return sendMessage(text, generationConfig, null);
Expand All @@ -256,8 +270,10 @@ public GenerateContentResponse sendMessage(String text, GenerationConfig generat
* @param text the message to be sent.
* @param safetySettings the safety settings.
* @return a response.
* @deprecated use {@link #sendMessage(String, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public GenerateContentResponse sendMessage(String text, List<SafetySetting> safetySettings)
throws IOException {
return sendMessage(text, null, safetySettings);
Expand All @@ -270,8 +286,10 @@ public GenerateContentResponse sendMessage(String text, List<SafetySetting> safe
* @param generationConfig the generation config.
* @param safetySettings the safety settings.
* @return a response.
* @deprecated use {@link #sendMessage(String, GenerateContentConfig)} instead
*/
@BetaApi("Both sendMessage and safetySettings are preview features.")
@Deprecated
public GenerateContentResponse sendMessage(
String text, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down Expand Up @@ -321,8 +339,10 @@ public GenerateContentResponse sendMessage(Content content, GenerateContentConfi
* @param content the content to be sent.
* @param generationConfig the generation config.
* @return a response.
* @deprecated use {@link #sendMessage(Content, GenerateContentConfig)} instead
*/
@BetaApi
@Deprecated
public GenerateContentResponse sendMessage(Content content, GenerationConfig generationConfig)
throws IOException {
return sendMessage(content, generationConfig, null);
Expand All @@ -334,8 +354,10 @@ public GenerateContentResponse sendMessage(Content content, GenerationConfig gen
* @param content the content to be sent.
* @param safetySettings the safety settings.
* @return a response.
* @deprecated use {@link #sendMessage(Content, GenerateContentConfig)} instead
*/
@BetaApi("Both sendMessage and safetySettings are preview features.")
@Deprecated
public GenerateContentResponse sendMessage(Content content, List<SafetySetting> safetySettings)
throws IOException {
return sendMessage(content, null, safetySettings);
Expand All @@ -348,8 +370,10 @@ public GenerateContentResponse sendMessage(Content content, List<SafetySetting>
* @param generationConfig the generation config.
* @param safetySettings the safety settings.
* @return a response.
* @deprecated use {@link #sendMessage(Content, GenerateContentConfig)} instead
*/
@BetaApi("Both sendMessage and safetySettings are preview features.")
@Deprecated
public GenerateContentResponse sendMessage(
Content content, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ public GenerateContentResponse generateContent(String text, GenerateContentConfi
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(String, GenerateContentConfig)} instead
*/
@BetaApi
@Deprecated
public GenerateContentResponse generateContent(String text, GenerationConfig generationConfig)
throws IOException {
return generateContent(text, generationConfig, null);
Expand All @@ -450,8 +452,10 @@ public GenerateContentResponse generateContent(String text, GenerationConfig gen
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(String, GenerateContentConfig)} instead
*/
@BetaApi("Both generateContent and safetySettings are preview features.")
@Deprecated
public GenerateContentResponse generateContent(String text, List<SafetySetting> safetySettings)
throws IOException {
return generateContent(text, null, safetySettings);
Expand All @@ -468,8 +472,10 @@ public GenerateContentResponse generateContent(String text, List<SafetySetting>
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(String, GenerateContentConfig)} instead
*/
@BetaApi("Both generateContent and safetySettings are preview features.")
@Deprecated
public GenerateContentResponse generateContent(
String text, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down Expand Up @@ -503,8 +509,10 @@ public GenerateContentResponse generateContent(List<Content> contents) throws IO
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(List<Content>, GenerateContentConfig)} instead
*/
@BetaApi("generateContent is a preview feature.")
@Deprecated
public GenerateContentResponse generateContent(
List<Content> contents, GenerationConfig generationConfig) throws IOException {
return generateContent(contents, generationConfig, null);
Expand All @@ -520,8 +528,10 @@ public GenerateContentResponse generateContent(
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(List<Content>, GenerateContentConfig)} instead
*/
@BetaApi("Both generateContent and safetySettings are preview features")
@Deprecated
public GenerateContentResponse generateContent(
List<Content> contents, List<SafetySetting> safetySettings) throws IOException {
return generateContent(contents, null, safetySettings);
Expand Down Expand Up @@ -575,8 +585,10 @@ public GenerateContentResponse generateContent(
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(List<Content>, GenerateContentConfig)} instead
*/
@BetaApi("Both generateContent and safetySettings are preview features")
@Deprecated
public GenerateContentResponse generateContent(
List<Content> contents, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down Expand Up @@ -657,8 +669,10 @@ public GenerateContentResponse generateContent(Content content, GenerateContentC
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(Content, GenerateContentConfig)} instead
*/
@BetaApi("generateContent is a preview feature.")
@Deprecated
public GenerateContentResponse generateContent(Content content, GenerationConfig generationConfig)
throws IOException {
return generateContent(content, generationConfig, null);
Expand All @@ -673,8 +687,10 @@ public GenerateContentResponse generateContent(Content content, GenerationConfig
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(Content, GenerateContentConfig)} instead
*/
@BetaApi("generateContent is a preview feature.")
@Deprecated
public GenerateContentResponse generateContent(
Content content, List<SafetySetting> safetySettings) throws IOException {
return generateContent(content, null, safetySettings);
Expand All @@ -692,8 +708,10 @@ public GenerateContentResponse generateContent(
* @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains
* response contents and other metadata
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContent(Content, GenerateContentConfig)} instead
*/
@BetaApi("Both generateContent and safetySettings are preview features.")
@Deprecated
public GenerateContentResponse generateContent(
Content content, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down Expand Up @@ -738,8 +756,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(String, GenerateContentConfig)} instead
*/
@BetaApi
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
String text, GenerationConfig generationConfig) throws IOException {
return generateContentStream(text, generationConfig, null);
Expand All @@ -754,8 +774,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(String, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
String text, List<SafetySetting> safetySettings) throws IOException {
return generateContentStream(text, null, safetySettings);
Expand All @@ -773,8 +795,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(String, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
String text, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down Expand Up @@ -824,8 +848,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(Content, GenerateContentConfig)} instead
*/
@BetaApi
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
Content content, GenerationConfig generationConfig) throws IOException {
return generateContentStream(content, generationConfig, null);
Expand All @@ -841,8 +867,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(Content, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
Content content, List<SafetySetting> safetySettings) throws IOException {
return generateContentStream(content, null, safetySettings);
Expand All @@ -860,8 +888,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(Content, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
Content content, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down Expand Up @@ -893,8 +923,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(List<Conten
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(List<Content>, GenerateContentConfig)} instead
*/
@BetaApi
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
List<Content> contents, GenerationConfig generationConfig) throws IOException {
return generateContentStream(contents, generationConfig, null);
Expand All @@ -911,8 +943,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(List<Content>, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
List<Content> contents, List<SafetySetting> safetySettings) throws IOException {
return generateContentStream(contents, null, safetySettings);
Expand All @@ -931,8 +965,10 @@ public ResponseStream<GenerateContentResponse> generateContentStream(
* @return a {@link ResponseStream} that contains a streaming of {@link
* com.google.cloud.vertexai.api.GenerateContentResponse}
* @throws IOException if an I/O error occurs while making the API call
* @deprecated use {@link #generateContentStream(List<Content>, GenerateContentConfig)} instead
*/
@BetaApi("safetySettings is a preview feature.")
@Deprecated
public ResponseStream<GenerateContentResponse> generateContentStream(
List<Content> contents, GenerationConfig generationConfig, List<SafetySetting> safetySettings)
throws IOException {
Expand Down

0 comments on commit 7cf463b

Please sign in to comment.