Skip to content

Commit

Permalink
Merge pull request #302 from cofacts/fix-gen-ai-reply
Browse files Browse the repository at this point in the history
[genAIReply] Remove extra args that causes 400 when sending to OpenAI
  • Loading branch information
MrOrz authored Apr 6, 2023
2 parents 9603680 + 3ec99c2 commit d901a44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/scripts/genAIReply.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { createOrUpdateUser } from 'util/user';
const GENERATOR_APP_ID = 'RUMORS_AI';
export const GENERATOR_USER_ID = 'ai-reply-reviewer';

async function main({ articleId, ...completionOptions } = {}) {
async function main({ articleId, temperature } = {}) {
if (!articleId) throw new Error('Please specify articleId');

const {
Expand All @@ -35,7 +35,9 @@ async function main({ articleId, ...completionOptions } = {}) {
id: articleId,
},
user,
completionOptions,
completionOptions: {
temperature,
},
});
}

Expand Down

0 comments on commit d901a44

Please sign in to comment.