You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"You are a commit message generator. I will provide you with a git diff, and I would like you to generate an appropriate commit message using the conventional commit format. Do not write any explanations or other words, just reply with the commit message.";
96
-
if(config.provider==="openai"){
97
-
constoai=newOpenAI({
98
-
apiKey: config.API_KEY,
99
-
});
100
95
101
-
try{
102
-
if(options.verbose){
103
-
console.debug("Sending request to OpenAI...");
104
-
}
105
-
constresponse=awaitoai.chat.completions.create({
106
-
messages: [
107
-
{
108
-
role: "system",
109
-
content: system_message,
110
-
},
111
-
{
112
-
role: "user",
113
-
content: rendered_template,
114
-
},
115
-
],
116
-
model: config.model,
117
-
response_format: {type: "json_object"},
118
-
});
119
-
120
-
if(options.verbose){
121
-
console.debug("Response received from OpenAI.");
122
-
console.debug(JSON.stringify(response,null,2));
123
-
}
124
-
constcontent=response.choices[0].message.content;
125
-
if(!content){
126
-
console.error("Failed to generate commit message");
0 commit comments