Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
Signed-off-by: San <[email protected]>
  • Loading branch information
zhujunsan authored Jun 5, 2024
2 parents b105846 + 63a0f44 commit 0d9466e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions service/src/chatgpt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export async function initApi(key: KeyConfig, chatModel: string, maxContextCount
// Set the token limits based on the model's type. This is because different models have different token limits.
// The token limit includes the token count from both the message array sent and the model response.
// 'gpt-35-turbo' has a limit of 4096 tokens, 'gpt-4' and 'gpt-4-32k' have limits of 8192 and 32768 tokens respectively.

// Check if the model type is GPT-4-turbo or newer
if (model.toLowerCase().includes('gpt-4o') || model.toLowerCase().includes('gpt-4-turbo') || model.toLowerCase().includes('-preview')) {
// If it's a 'gpt-4o'/'gpt-4-turbo'/'xxxx-preview' model, set the maxModelTokens to 128000
Expand Down

0 comments on commit 0d9466e

Please sign in to comment.