From 753cb331212f14b05911b4e89fa8cc44b0a2e6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ros=C3=A1rio=20P=2E=20Fernandes?= Date: Tue, 9 Apr 2024 17:23:56 +0100 Subject: [PATCH] keep GenerativeModel's original parameter positions (#115) It seems like the `tools` and `toolConfig` parameters were added before `requestOptions`, which could cause a breaking change because in the current version of the SDK the `RequestOptions` is in a different order (right after `safetySettings`). --------- Co-authored-by: Rodrigo Lazo --- .changes/generativeai/beginner-car-club-airport.json | 1 + .../java/com/google/ai/client/generativeai/GenerativeModel.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .changes/generativeai/beginner-car-club-airport.json diff --git a/.changes/generativeai/beginner-car-club-airport.json b/.changes/generativeai/beginner-car-club-airport.json new file mode 100644 index 00000000..86b700c2 --- /dev/null +++ b/.changes/generativeai/beginner-car-club-airport.json @@ -0,0 +1 @@ +{"type":"MAJOR","changes":["Keep argument positions"]} diff --git a/generativeai/src/main/java/com/google/ai/client/generativeai/GenerativeModel.kt b/generativeai/src/main/java/com/google/ai/client/generativeai/GenerativeModel.kt index 84cdfc66..09044103 100644 --- a/generativeai/src/main/java/com/google/ai/client/generativeai/GenerativeModel.kt +++ b/generativeai/src/main/java/com/google/ai/client/generativeai/GenerativeModel.kt @@ -81,10 +81,10 @@ internal constructor( apiKey: String, generationConfig: GenerationConfig? = null, safetySettings: List? = null, + requestOptions: RequestOptions = RequestOptions(), tools: List? = null, toolConfig: ToolConfig? = null, systemInstruction: Content? = null, - requestOptions: RequestOptions = RequestOptions(), ) : this( modelName, apiKey,