Skip to content

Commit

Permalink
šŸ› fix(createAnalysis.ts): refactor createAnalysis function to improveā€¦
Browse files Browse the repository at this point in the history
ā€¦ readability and maintainability
  • Loading branch information
romantech committed Aug 27, 2023
1 parent 76a3515 commit bf25fb9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/controllers/analyzer/createAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ export const createAnalysis = [
const prompt = await redis.hget(KEYS.PROMPT, FIELDS.ANALYSIS);
if (!prompt) return throwCustomError(RETRIEVE_FAILED('prompt'), 500);

const analysis = await fetchAnalysisFromOpenAI(
sentence,
getFineTunedModel(model),
prompt,
);
const fineTuned = getFineTunedModel(model);
const analysis = await fetchAnalysisFromOpenAI(sentence, fineTuned, prompt);
if (!analysis) return throwCustomError(GENERATE_FAILED('analysis'), 500);

await decrementRedisCounters(
Expand Down

0 comments on commit bf25fb9

Please sign in to comment.