Skip to content

Commit

Permalink
use 0613
Browse files Browse the repository at this point in the history
  • Loading branch information
anc95 committed Jun 14, 2023
1 parent a38096a commit 09b5ed8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/common/api/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ export const useQueryOpenAIPrompt = () => {
settings.model === 'gpt-4'

const commonOption = {
max_tokens: 4000 - prompt.replace(/[\u4e00-\u9fa5]/g, 'aa').length,
// max_tokens: 4000 - prompt.replace(/[\u4e00-\u9fa5]/g, 'aa').length,
stream: true,
model: isWritelyService ? defaultSetting.model : settings.model,
model: ensureUsing0613Model(
isWritelyService ? defaultSetting.model : settings.model
),
temperature: parseFloat(settings.temperature),
}

Expand Down Expand Up @@ -245,3 +247,12 @@ export const useModels = () => {
]
}, [])
}

// TODO: remove later
const ensureUsing0613Model = (model: string) => {
if (model.startsWith('gpt-3.5')) {
return model + '-0613'
}

return model
}

0 comments on commit 09b5ed8

Please sign in to comment.