Skip to content

Commit

Permalink
Merge pull request #7 from dyaskur/fix/unnecessary_new_line
Browse files Browse the repository at this point in the history
Fix/unnecessary new line
  • Loading branch information
dyaskur authored May 22, 2023
2 parents 3d8f176 + c358309 commit f132013
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ name: "Deploy"

on:
workflow_run:
workflows: ["Node.js CI"]
types:
- completed
push:
branches: [ "master" ]
permissions: write-all
workflows: [ "Node.js CI" ]
types: [ completed ]
branches: [ "master" ]
jobs:
tagged-release:
name: "Tagged Release"
deploy:
name: "Deploy Release"
runs-on: "ubuntu-latest"

steps:
Expand Down
3 changes: 2 additions & 1 deletion helpers/gpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ export async function getRandomFromGpt(something) {
model: 'text-davinci-003',
prompt: generatePrompt(something),
temperature: 0.6,
max_tokens: 65,
});
let answer = 'Sorry I don\'t know what you mean';
if (completion.data?.choices.length > 0) {
answer = completion.data?.choices.map((a) => a.text).join(' ');
answer = completion.data?.choices.map((a) => a.text.replace(/(\r\n|\n|\r)/gm, '')).join('\n');
}
return answer;
}

0 comments on commit f132013

Please sign in to comment.