Finetuning logging msg [review]

This commit is contained in:
Jimmy Royer 2024-09-18 17:42:03 -04:00
parent bbd546b889
commit 7f6dd34aa7
3 changed files with 6 additions and 3 deletions

5
dist/index.js vendored
View file

@ -28,6 +28,9 @@ require("./sourcemap-register.js");
* - OPENAI_BASE_URL: Base URL for the OpenAI API (optional) * - OPENAI_BASE_URL: Base URL for the OpenAI API (optional)
* - DEBUG_HTTP: Enable HTTP request debugging (optional) * - DEBUG_HTTP: Enable HTTP request debugging (optional)
* *
* Example Usage:
* npx ts-node main.ts
*
* Note: It is recommended to set the GITHUB_TOKEN and OPENAI_API_KEY environment variables to avoid exposing sensitive information. * Note: It is recommended to set the GITHUB_TOKEN and OPENAI_API_KEY environment variables to avoid exposing sensitive information.
*/ */
var __createBinding = var __createBinding =
@ -424,7 +427,7 @@ ${chunk.changes
: _b.trim()) || "{}"; : _b.trim()) || "{}";
return JSON.parse(res).reviews; return JSON.parse(res).reviews;
} catch (error) { } catch (error) {
console.error("Error:", error); console.error("Could not fetch AI response:", error);
return null; return null;
} }
}); });

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -325,7 +325,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
const res = response.choices[0].message?.content?.trim() || "{}"; const res = response.choices[0].message?.content?.trim() || "{}";
return JSON.parse(res).reviews; return JSON.parse(res).reviews;
} catch (error) { } catch (error) {
console.error("Error:", error); console.error("Could not fetch AI response:", error);
return null; return null;
} }
} }