Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for commit prefix #160

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
build
  • Loading branch information
amitayk committed May 27, 2023
commit 59bc0059b4665e92b7575025666a34cb4137a324
11 changes: 7 additions & 4 deletions out/cli.cjs
Original file line number Diff line number Diff line change
@@ -21827,10 +21827,8 @@ var OpenAi = class {
try {
const { data } = await this.openAI.createChatCompletion(params);
const message = data.choices[0].message;
const prefix = generatePrefix();
const usePrefix = prefix != void 0 && prefix?.trim() != "";
const finalMessage = (usePrefix ? prefix + " " : "") + (message?.content || "");
return finalMessage;
const fullMessage = stitchMessageWithPrefix(message?.content);
return fullMessage;
} catch (error) {
ce(`${source_default.red("\u2716")} ${JSON.stringify(params)}`);
const err = error;
@@ -21847,6 +21845,11 @@ var OpenAi = class {
}
};
};
function stitchMessageWithPrefix(message) {
const prefix = generatePrefix();
const usePrefix = prefix != void 0 && prefix?.trim() != "";
return (usePrefix ? prefix + " " : "") + (message || "");
}
function generatePrefix() {
const prefix = config2?.OCO_PREFIX;
if (prefix === void 0) {
11 changes: 7 additions & 4 deletions out/github-action.cjs
Original file line number Diff line number Diff line change
@@ -28630,10 +28630,8 @@ var OpenAi = class {
try {
const { data } = await this.openAI.createChatCompletion(params);
const message = data.choices[0].message;
const prefix = generatePrefix();
const usePrefix = prefix != void 0 && prefix?.trim() != "";
const finalMessage = (usePrefix ? prefix + " " : "") + (message?.content || "");
return finalMessage;
const fullMessage = stitchMessageWithPrefix(message?.content);
return fullMessage;
} catch (error) {
ce(`${source_default.red("\u2716")} ${JSON.stringify(params)}`);
const err = error;
@@ -28650,6 +28648,11 @@ var OpenAi = class {
}
};
};
function stitchMessageWithPrefix(message) {
const prefix = generatePrefix();
const usePrefix = prefix != void 0 && prefix?.trim() != "";
return (usePrefix ? prefix + " " : "") + (message || "");
}
function generatePrefix() {
const prefix = config2?.OCO_PREFIX;
if (prefix === void 0) {