From 2c94840301e7822c54bb87c5fbcb30da6e8895c1 Mon Sep 17 00:00:00 2001 From: ruru <142723369+ruru-m07@users.noreply.github.com> Date: Sat, 11 May 2024 18:38:43 +0530 Subject: [PATCH] fix(debug): add console logs to identify bugs --- action/index.ts | 8 ++++++++ utils/index.ts | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/action/index.ts b/action/index.ts index 9b807a3..b743d5b 100644 --- a/action/index.ts +++ b/action/index.ts @@ -37,6 +37,14 @@ export const commitChange = async ({ const response = (await modelResponse).response.text(); + console.log({ + message: message, + response: response, + data: { + time: new Date().toISOString(), + }, + }); + return { data: { text: response, diff --git a/utils/index.ts b/utils/index.ts index 34512df..1ad67e6 100644 --- a/utils/index.ts +++ b/utils/index.ts @@ -1,6 +1,6 @@ import { GoogleGenerativeAI } from "@google/generative-ai"; -export const runtime = 'edge'; +export const runtime = "node"; // Get your API key from https://makersuite.google.com/app/apikey if (!process.env.API_KEY) { @@ -10,4 +10,6 @@ if (!process.env.API_KEY) { const genAI = new GoogleGenerativeAI(process.env.API_KEY!); -export const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" }); +export const model = genAI.getGenerativeModel({ + model: "gemini-1.5-pro-latest", +});