Skip to content

Commit 02c5b78

Browse files
committed
Added Gemini debug logs
1 parent 3647d51 commit 02c5b78

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ async function callLLM(prompt) {
3737
headers: { "Content-Type": "application/json" },
3838
body: JSON.stringify({ contents: [{ parts: [{ text: prompt }] }] }),
3939
});
40+
4041
const data = await res.json();
41-
return data.candidates?.[0]?.content?.parts?.[0]?.text || "Sorry, I couldn't generate a response.";
42+
console.log("GEMINI RESPONSE:", JSON.stringify(data, null, 2));
43+
44+
return data?.candidates?.[0]?.content?.parts?.[0]?.text
45+
|| data?.candidates?.[0]?.output
46+
|| "Sorry, I couldn't generate a response.";
4247
}
4348

4449
async function postComment(owner, repo, issueNumber, body) {

0 commit comments

Comments
 (0)