From f0114a755612c2f92a0cc351ad7fa15ca32d0e91 Mon Sep 17 00:00:00 2001 From: Jaycee Li Date: Wed, 25 Nov 2026 14:52:04 -0800 Subject: [PATCH] chore: remove unused apiClient fields in Chat/AsyncChat and fix typos PiperOrigin-RevId: 1030208089 --- src/main/java/com/google/genai/AfcUtil.java | 2 +- src/main/java/com/google/genai/AsyncChat.java | 4 +--- src/main/java/com/google/genai/Chat.java | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/google/genai/AfcUtil.java b/src/main/java/com/google/genai/AfcUtil.java index 7d1a53e558c3..2987c1a0d9c0 100644 --- a/src/main/java/com/google/genai/AfcUtil.java +++ b/src/main/java/com/google/genai/AfcUtil.java @@ -195,7 +195,7 @@ static boolean shouldDisableAfc(GenerateContentConfig config) { if (maximumRemoteCalls.isPresent() && maximumRemoteCalls.get() <= 0) { logger.warning( String.format( - "maxRemoteCalls in AfautomaticFunctionCallingConfig %s is less than or equal to 0." + "maxRemoteCalls in AutomaticFunctionCallingConfig %s is less than or equal to 0." + " Disabling automatic function calling. Please set maximumRemoteCalls to a" + " positive integer.", maximumRemoteCalls.get())); diff --git a/src/main/java/com/google/genai/AsyncChat.java b/src/main/java/com/google/genai/AsyncChat.java index d2ce4e0dcb44..77c647c08b8a 100644 --- a/src/main/java/com/google/genai/AsyncChat.java +++ b/src/main/java/com/google/genai/AsyncChat.java @@ -40,7 +40,6 @@ * automaticContinuation(false)} in the {@link GenerateContentConfig} to turn this off. */ public class AsyncChat extends ChatBase { - private final ApiClient apiClient; private final AsyncModels models; private final String model; private final GenerateContentConfig config; @@ -55,7 +54,6 @@ public class AsyncChat extends ChatBase { ApiClient apiClient, String model, GenerateContentConfig config, List history) { super(new ArrayList<>(history), new ArrayList<>()); curatedHistory.addAll(extractCuratedHistory(history)); - this.apiClient = apiClient; this.models = new AsyncModels(apiClient); this.model = model; this.config = config; @@ -98,7 +96,7 @@ public CompletableFuture sendMessage(String text) { * *

This appends the message and the model's response to the chat history, which is sent back to * the model in subsequent calls to sendMessage. Be sure to initialize a chat session using - * cilent.async.chats.create() before calling sendMessage. + * client.async.chats.create() before calling sendMessage. * * @param content a {@link com.google.genai.types.Content} to send to the generative model * @param config a {@link com.google.genai.types.GenerateContentConfig} instance that specifies diff --git a/src/main/java/com/google/genai/Chat.java b/src/main/java/com/google/genai/Chat.java index 47b61455da36..b504fe4d48eb 100644 --- a/src/main/java/com/google/genai/Chat.java +++ b/src/main/java/com/google/genai/Chat.java @@ -38,7 +38,6 @@ *

Note: this class is NOT thread-safe. */ public class Chat extends ChatBase { - private final ApiClient apiClient; private final Models models; private final String model; private final GenerateContentConfig config; @@ -50,7 +49,6 @@ public class Chat extends ChatBase { Chat(ApiClient apiClient, String model, GenerateContentConfig config, List history) { super(new ArrayList<>(history), new ArrayList<>()); curatedHistory.addAll(extractCuratedHistory(history)); - this.apiClient = apiClient; this.models = new Models(apiClient); this.model = model; this.config = config;