Skip to content

Commit

Permalink
Improve dimension completion prompt processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Keskimaki committed Mar 17, 2023
1 parent d00ac68 commit 7770688
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ const CompletionResult = ({

const { label, data } = dimension

const dimensionName = label[i18n.language as keyof Locales].toLowerCase()

const recommendationNames = data.map(
({ name }) => name.charAt(0).toUpperCase() + name.slice(1)
)
const recommendations = recommendationNames.join(t('openai:or'))

const dimensionName = label[i18n.language as keyof Locales].toLowerCase()
const recommendations =
recommendationNames.slice(0, -1).join(', ') +
t('openai:or') +
recommendationNames.slice(-1)

const prompt = t('openai:dimensionCompletionPrompt', {
dimensionName,
Expand Down

0 comments on commit 7770688

Please sign in to comment.