File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -61,5 +61,5 @@ function analyzeAndLabelEmailSentiment() {
6161 * @returns {boolean } True if the sentiment is negative, false otherwise.
6262 */
6363function isNegativeSentiment ( text ) {
64- return processSentiment ( text ) ;
64+ return processSentiment ( text ) === 'negative' ;
6565}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414limitations under the License.
1515*/
1616
17- const PROJECT_ID = 'qwiklabs-gcp-01-e6ca251b4715 ' ;
17+ const PROJECT_ID = '[ADD YOUR GCP PROJECT ID HERE] ' ;
1818const VERTEX_AI_LOCATION = 'us-central1' ;
1919const MODEL_ID = 'gemini-1.5-pro-002' ;
2020
@@ -74,5 +74,5 @@ function processSentiment(emailText) {
7474 const payload = JSON . parse ( response . getContentText ( ) ) ;
7575 const text = JSON . parse ( payload . candidates [ 0 ] . content . parts [ 0 ] . text ) ;
7676
77- return text . response === 'negative' ;
77+ return text . response ;
7878}
You can’t perform that action at this time.
0 commit comments