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

make SafetySettings#method nullable #6379

Merged
merged 3 commits into from
Oct 17, 2024
Merged

Conversation

davidmotson
Copy link
Collaborator

No description provided.

Copy link
Contributor

github-actions bot commented Oct 11, 2024

Javadoc Changes:
--- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/vertexai/type/SafetySetting.html	2024-10-16 18:31:21.084370106 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/vertexai/type/SafetySetting.html	2024-10-16 18:29:14.643152300 +0000
@@ -27,7 +27,7 @@
         <tbody class="list">
           <tr>
             <td>
-              <div><code><a href="/docs/reference/android/com/google/firebase/vertexai/type/SafetySetting.html#SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmCategory.html">HarmCategory</a>&nbsp;harmCategory,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockThreshold.html">HarmBlockThreshold</a>&nbsp;threshold,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a>&nbsp;method<br>)</code></div>
+              <div><code><a href="/docs/reference/android/com/google/firebase/vertexai/type/SafetySetting.html#SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmCategory.html">HarmCategory</a>&nbsp;harmCategory,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockThreshold.html">HarmBlockThreshold</a>&nbsp;threshold,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a>&nbsp;method<br>)</code></div>
             </td>
           </tr>
         </tbody>
@@ -37,7 +37,7 @@
       <h2>Public constructors</h2>
       <div class="api-item"><a name="SafetySetting(com.google.firebase.vertexai.type.HarmCategory, com.google.firebase.vertexai.type.HarmBlockThreshold, com.google.firebase.vertexai.type.HarmBlockMethod)"></a><a name="SafetySetting-com.google.firebase.vertexai.type.HarmCategory-com.google.firebase.vertexai.type.HarmBlockThreshold-com.google.firebase.vertexai.type.HarmBlockMethod-"></a><a name="safetysetting"></a>
         <h3 class="api-name" id="SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</h3>
-        <pre class="api-signature no-pretty-print">public&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/SafetySetting.html#SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmCategory.html">HarmCategory</a>&nbsp;harmCategory,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockThreshold.html">HarmBlockThreshold</a>&nbsp;threshold,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a>&nbsp;method<br>)</pre>
+        <pre class="api-signature no-pretty-print">public&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/SafetySetting.html#SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmCategory.html">HarmCategory</a>&nbsp;harmCategory,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockThreshold.html">HarmBlockThreshold</a>&nbsp;threshold,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a>&nbsp;method<br>)</pre>
         <div class="devsite-table-wrapper">
           <table class="responsive">
             <colgroup>
@@ -63,9 +63,9 @@
                 </td>
               </tr>
               <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/HarmBlockMethod.html">HarmBlockMethod</a>&nbsp;method</code></td>
+                <td><code><a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a>&nbsp;method</code></td>
                 <td>
-                  <p>Specify if the threshold is used for probability or severity score.</p>
+                  <p>Specify if the threshold is used for probability or severity score, if not specified it will default to <code><a href="/docs/reference/android/com/google/firebase/vertexai/type/HarmBlockMethod.Companion.html#PROBABILITY()">HarmBlockMethod.PROBABILITY</a></code>.</p>
                 </td>
               </tr>
             </tbody>
--- /home/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/SafetySetting.html	2024-10-16 18:31:21.076370029 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/SafetySetting.html	2024-10-16 18:29:14.631152184 +0000
@@ -27,7 +27,7 @@
         <tbody class="list">
           <tr>
             <td>
-              <div><code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/SafetySetting.html#SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;harmCategory:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmCategory.html">HarmCategory</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;threshold:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.html">HarmBlockThreshold</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;method:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a><br>)</code></div>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/SafetySetting.html#SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;harmCategory:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmCategory.html">HarmCategory</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;threshold:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.html">HarmBlockThreshold</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;method:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a>?<br>)</code></div>
             </td>
           </tr>
         </tbody>
@@ -37,7 +37,7 @@
       <h2>Public constructors</h2>
       <div class="api-item"><a name="SafetySetting(com.google.firebase.vertexai.type.HarmCategory, com.google.firebase.vertexai.type.HarmBlockThreshold, com.google.firebase.vertexai.type.HarmBlockMethod)"></a><a name="SafetySetting-com.google.firebase.vertexai.type.HarmCategory-com.google.firebase.vertexai.type.HarmBlockThreshold-com.google.firebase.vertexai.type.HarmBlockMethod-"></a><a name="safetysetting"></a>
         <h3 class="api-name" id="SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</h3>
-        <pre class="api-signature no-pretty-print"><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/SafetySetting.html#SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;harmCategory:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmCategory.html">HarmCategory</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;threshold:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.html">HarmBlockThreshold</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;method:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a> = HarmBlockMethod.PROBABILITY<br>)</pre>
+        <pre class="api-signature no-pretty-print"><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/SafetySetting.html#SafetySetting(com.google.firebase.vertexai.type.HarmCategory,com.google.firebase.vertexai.type.HarmBlockThreshold,com.google.firebase.vertexai.type.HarmBlockMethod)">SafetySetting</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;harmCategory:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmCategory.html">HarmCategory</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;threshold:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.html">HarmBlockThreshold</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;method:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a>? = null<br>)</pre>
         <div class="devsite-table-wrapper">
           <table class="responsive">
             <colgroup>
@@ -63,9 +63,9 @@
                 </td>
               </tr>
               <tr>
-                <td><code>method:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a> = HarmBlockMethod.PROBABILITY</code></td>
+                <td><code>method:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockMethod.html">HarmBlockMethod</a>? = null</code></td>
                 <td>
-                  <p>Specify if the threshold is used for probability or severity score.</p>
+                  <p>Specify if the threshold is used for probability or severity score, if not specified it will default to <code><a href="/docs/reference/kotlin/com/google/firebase/vertexai/type/HarmBlockMethod.Companion.html#PROBABILITY()">HarmBlockMethod.PROBABILITY</a></code>.</p>
                 </td>
               </tr>
             </tbody>

Copy link
Contributor

github-actions bot commented Oct 11, 2024

Test Results

 20 files  ±  0   20 suites  ±0   15s ⏱️ -18s
112 tests + 89  112 ✅ + 89  0 💤 ±0  0 ❌ ±0 
224 runs  +156  224 ✅ +156  0 💤 ±0  0 ❌ ±0 

Results for commit 8bf3672. ± Comparison against base commit 2dd9beb.

This pull request removes 23 and adds 112 tests. Note that renamed tests count towards both.
com.google.firebase.functions.AppCheckLimitedUseTest ‑ FirebaseFunctions#getHttpsCallable should build callable with FAC settings (when false)
com.google.firebase.functions.AppCheckLimitedUseTest ‑ FirebaseFunctions#getHttpsCallable should build callable with FAC settings (when true)
com.google.firebase.functions.AppCheckLimitedUseTest ‑ FirebaseFunctions#getHttpsCallable should not use limited-use tokens by default
com.google.firebase.functions.AppCheckLimitedUseTest ‑ FirebaseFunctions#getHttpsCallableFromUrl callable with FAC settings (when false)
com.google.firebase.functions.AppCheckLimitedUseTest ‑ FirebaseFunctions#getHttpsCallableFromUrl callable with FAC settings (when true)
com.google.firebase.functions.AppCheckLimitedUseTest ‑ FirebaseFunctions#getHttpsCallableFromUrl should not use limited-use tokens by default
com.google.firebase.functions.FunctionsRegistrarTest ‑ getComponents_publishesLibVersionComponent
com.google.firebase.functions.FunctionsTests ‑ Firebase#functions should delegate to FirebaseFunctions#getInstance(FirebaseApp, region)
com.google.firebase.functions.FunctionsTests ‑ Firebase#functions should delegate to FirebaseFunctions#getInstance(region)
com.google.firebase.functions.FunctionsTests ‑ FirebaseApp#functions should delegate to FirebaseFunctions#getInstance(FirebaseApp)
…
com.google.firebase.vertexai.GenerativeModelTesting ‑ addition
com.google.firebase.vertexai.SchemaTests ‑ basic schema declaration
com.google.firebase.vertexai.SchemaTests ‑ full schema declaration
com.google.firebase.vertexai.StreamingSnapshotTests ‑ citation parsed correctly
com.google.firebase.vertexai.StreamingSnapshotTests ‑ empty content
com.google.firebase.vertexai.StreamingSnapshotTests ‑ http errors
com.google.firebase.vertexai.StreamingSnapshotTests ‑ image rejected
com.google.firebase.vertexai.StreamingSnapshotTests ‑ invalid api key
com.google.firebase.vertexai.StreamingSnapshotTests ‑ invalid json
com.google.firebase.vertexai.StreamingSnapshotTests ‑ long reply
…

♻️ This comment has been updated with latest results.

Copy link
Contributor

Vertex AI Mock Responses Check ⚠️

A newer major version of the mock responses for Vertex AI unit tests is available. update_responses.sh should be updated to clone the latest version of the responses: v5.0

@rlazo rlazo merged commit dd23959 into main Oct 17, 2024
27 checks passed
@rlazo rlazo deleted the davidmotson.optional_harm_block_method branch October 17, 2024 14:29
daymxn pushed a commit that referenced this pull request Oct 17, 2024
Co-authored-by: David Motsonashvili <davidmotson@google.com>
Co-authored-by: Rodrigo Lazo <rlazo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants