Skip to content

Commit 8fbf646

Browse files
committed
chore: Fix more
1 parent 3a9c681 commit 8fbf646

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gmail-sentiment-analysis/Gmail.gs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ function analyzeAndLabelEmailSentiment() {
6161
* @returns {boolean} True if the sentiment is negative, false otherwise.
6262
*/
6363
function isNegativeSentiment(text) {
64-
return processSentiment(text);
64+
return processSentiment(text) === 'negative';
6565
}

gmail-sentiment-analysis/Vertex.gs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
const PROJECT_ID = 'qwiklabs-gcp-01-e6ca251b4715';
17+
const PROJECT_ID = '[ADD YOUR GCP PROJECT ID HERE]';
1818
const VERTEX_AI_LOCATION = 'us-central1';
1919
const 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
}

0 commit comments

Comments
 (0)