Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove functionResponse accessor, and mark functionCallingConfig nullable #6373

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

rlazo
Copy link
Collaborator

@rlazo rlazo commented Oct 10, 2024

There's no need for the response accessor, as under normal circunstances there's no need to have easy access to the [FunctionResponsePart] the app adds to a prompt.

Additionally, to make evolving the API easier and backward compatible, made functionCallingConfig parameter nullable in ToolConfig.

…nullable

There's no need for the response accessor, as under normal
circunstances there's no need to have easy access to the
[FunctionResponsePart] the app adds to a prompt.

Additionally, to make evolving the API easier and backward compatible,
made `functionCallingConfig` parameter nullable in `ToolConfig`.
Copy link
Contributor

github-actions bot commented Oct 10, 2024

Javadoc Changes:
--- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/vertexai/type/GenerateContentResponse.html	2024-10-10 21:35:08.964641726 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/vertexai/type/GenerateContentResponse.html	2024-10-10 21:33:07.392815548 +0000
@@ -40,13 +40,6 @@
             </td>
           </tr>
           <tr>
-            <td><code>final <a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionResponsePart.html">FunctionResponsePart</a></code></td>
-            <td>
-              <div><code><a href="/docs/reference/android/com/google/firebase/vertexai/type/GenerateContentResponse.html#functionResponse()">functionResponse</a></code></div>
-              <p>Convenience field representing the first function response part in the response, if it exists.</p>
-            </td>
-          </tr>
-          <tr>
             <td><code>final <a href="/docs/reference/android/com/google/firebase/vertexai/type/PromptFeedback.html">PromptFeedback</a></code></td>
             <td>
               <div><code><a href="/docs/reference/android/com/google/firebase/vertexai/type/GenerateContentResponse.html#promptFeedback()">promptFeedback</a></code></div>
@@ -101,11 +94,6 @@
         <pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/util/List.html">List</a>&lt;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionCallPart.html">FunctionCallPart</a>&gt;&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/GenerateContentResponse.html#functionCalls()">functionCalls</a></pre>
         <p>Convenience field to get all the function call parts in the request, if they exist</p>
       </div>
-      <div class="api-item"><a name="getFunctionResponse()"></a><a name="setFunctionResponse()"></a><a name="getFunctionResponse--"></a><a name="setFunctionResponse--"></a>
-        <h3 class="api-name" id="functionResponse()">functionResponse</h3>
-        <pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionResponsePart.html">FunctionResponsePart</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/GenerateContentResponse.html#functionResponse()">functionResponse</a></pre>
-        <p>Convenience field representing the first function response part in the response, if it exists.</p>
-      </div>
       <div class="api-item"><a name="getPromptFeedback()"></a><a name="setPromptFeedback()"></a><a name="getPromptFeedback--"></a><a name="setPromptFeedback--"></a>
         <h3 class="api-name" id="promptFeedback()">promptFeedback</h3>
         <pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/PromptFeedback.html">PromptFeedback</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/GenerateContentResponse.html#promptFeedback()">promptFeedback</a></pre>
--- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/vertexai/type/ToolConfig.html	2024-10-10 21:35:08.960641730 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/vertexai/type/ToolConfig.html	2024-10-10 21:33:07.388815553 +0000
@@ -27,7 +27,7 @@
         <tbody class="list">
           <tr>
             <td>
-              <div><code><a href="/docs/reference/android/com/google/firebase/vertexai/type/ToolConfig.html#ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>&nbsp;functionCallingConfig)</code></div>
+              <div><code><a href="/docs/reference/android/com/google/firebase/vertexai/type/ToolConfig.html#ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</a>(<a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>&nbsp;functionCallingConfig)</code></div>
             </td>
           </tr>
         </tbody>
@@ -37,7 +37,7 @@
       <h2>Public constructors</h2>
       <div class="api-item"><a name="ToolConfig-com.google.firebase.vertexai.type.FunctionCallingConfig-"></a><a name="toolconfig"></a>
         <h3 class="api-name" id="ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</h3>
-        <pre class="api-signature no-pretty-print">public&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/ToolConfig.html#ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>&nbsp;functionCallingConfig)</pre>
+        <pre class="api-signature no-pretty-print">public&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/ToolConfig.html#ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</a>(<a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>&nbsp;functionCallingConfig)</pre>
         <div class="devsite-table-wrapper">
           <table class="responsive">
             <colgroup>
@@ -51,7 +51,7 @@
             </thead>
             <tbody class="list">
               <tr>
-                <td><code>@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>&nbsp;functionCallingConfig</code></td>
+                <td><code><a href="/docs/reference/android/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>&nbsp;functionCallingConfig</code></td>
                 <td>
                   <p>The config for function calling</p>
                 </td>
--- /home/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/GenerateContentResponse.html	2024-10-10 21:35:08.956641737 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/GenerateContentResponse.html	2024-10-10 21:33:07.384815559 +0000
@@ -60,13 +60,6 @@
             </td>
           </tr>
           <tr>
-            <td><code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionResponsePart.html">FunctionResponsePart</a>?</code></td>
-            <td>
-              <div><code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/GenerateContentResponse.html#functionResponse()">functionResponse</a></code></div>
-              <p>Convenience field representing the first function response part in the response, if it exists.</p>
-            </td>
-          </tr>
-          <tr>
             <td><code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/PromptFeedback.html">PromptFeedback</a>?</code></td>
             <td>
               <div><code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/GenerateContentResponse.html#promptFeedback()">promptFeedback</a></code></div>
@@ -108,11 +101,6 @@
         <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/GenerateContentResponse.html#functionCalls()">functionCalls</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html">List</a>&lt;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionCallPart.html">FunctionCallPart</a>&gt;</pre>
         <p>Convenience field to get all the function call parts in the request, if they exist</p>
       </div>
-      <div class="api-item"><a name="getFunctionResponse()"></a><a name="setFunctionResponse()"></a><a name="getFunctionResponse--"></a><a name="setFunctionResponse--"></a>
-        <h3 class="api-name" id="functionResponse()">functionResponse</h3>
-        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/GenerateContentResponse.html#functionResponse()">functionResponse</a>:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionResponsePart.html">FunctionResponsePart</a>?</pre>
-        <p>Convenience field representing the first function response part in the response, if it exists.</p>
-      </div>
       <div class="api-item"><a name="getPromptFeedback()"></a><a name="setPromptFeedback()"></a><a name="getPromptFeedback--"></a><a name="setPromptFeedback--"></a>
         <h3 class="api-name" id="promptFeedback()">promptFeedback</h3>
         <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/GenerateContentResponse.html#promptFeedback()">promptFeedback</a>:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/PromptFeedback.html">PromptFeedback</a>?</pre>
--- /home/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/ToolConfig.html	2024-10-10 21:35:08.956641737 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/ToolConfig.html	2024-10-10 21:33:07.380815564 +0000
@@ -27,7 +27,7 @@
         <tbody class="list">
           <tr>
             <td>
-              <div><code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/ToolConfig.html#ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</a>(functionCallingConfig:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>)</code></div>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/ToolConfig.html#ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</a>(functionCallingConfig:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>?)</code></div>
             </td>
           </tr>
         </tbody>
@@ -37,7 +37,7 @@
       <h2>Public constructors</h2>
       <div class="api-item"><a name="ToolConfig-com.google.firebase.vertexai.type.FunctionCallingConfig-"></a><a name="toolconfig"></a>
         <h3 class="api-name" id="ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</h3>
-        <pre class="api-signature no-pretty-print"><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/ToolConfig.html#ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</a>(functionCallingConfig:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>)</pre>
+        <pre class="api-signature no-pretty-print"><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/ToolConfig.html#ToolConfig(com.google.firebase.vertexai.type.FunctionCallingConfig)">ToolConfig</a>(functionCallingConfig:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>?)</pre>
         <div class="devsite-table-wrapper">
           <table class="responsive">
             <colgroup>
@@ -51,7 +51,7 @@
             </thead>
             <tbody class="list">
               <tr>
-                <td><code>functionCallingConfig:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a></code></td>
+                <td><code>functionCallingConfig:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/FunctionCallingConfig.html">FunctionCallingConfig</a>?</code></td>
                 <td>
                   <p>The config for function calling</p>
                 </td>

@rlazo rlazo enabled auto-merge (squash) October 10, 2024 20:58
Copy link
Contributor

github-actions bot commented Oct 10, 2024

Test Results

 20 files  ±0   20 suites  ±0   15s ⏱️ ±0s
112 tests ±0  112 ✅ ±0  0 💤 ±0  0 ❌ ±0 
224 runs  ±0  224 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 2eaa3c2. ± Comparison against base commit 7cf67aa.

♻️ This comment has been updated with latest results.

@rlazo rlazo merged commit 2d6c899 into main Oct 10, 2024
27 checks passed
@rlazo rlazo deleted the rl.vertexapi.2 branch October 10, 2024 21:36
@rlazo rlazo added this to the vertexai-ga milestone Oct 18, 2024
@firebase firebase locked and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants