Skip to content

Commit

Permalink
add gpt-4o
Browse files Browse the repository at this point in the history
  • Loading branch information
fegloff committed May 25, 2024
1 parent 27517fa commit 95e6de2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/modules/llms/openaiBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ export class OpenAIBot extends LlmsBase {
return
}

if (
ctx.hasCommand([SupportedCommands.gpto])) {
this.updateSessionModel(ctx, LlmsModelsEnum.GPT_4O)
await this.onChat(ctx, LlmsModelsEnum.GPT_4O, true, false)
return
}

if (ctx.hasCommand([SupportedCommands.pdf, SupportedCommands.ctx]) && this.checkModel(ctx)) {
await this.onChat(ctx, ctx.session.currentModel, true, false)
return
Expand Down
1 change: 1 addition & 0 deletions src/modules/llms/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export enum SupportedCommands {
new = 'new',
gpt4 = 'gpt4',
ask32 = 'ask32',
gpto = 'gpto',
gpt = 'gpt',
last = 'last',
dalle = 'dalle',
Expand Down
10 changes: 9 additions & 1 deletion src/modules/llms/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export enum LlmsModelsEnum {
GPT_4 = 'gpt-4',
GPT_35_TURBO = 'gpt-3.5-turbo',
GPT_35_TURBO_16K = 'gpt-3.5-turbo-16k',
GPT_4_VISION_PREVIEW = 'gpt-4-vision-preview'
GPT_4_VISION_PREVIEW = 'gpt-4-vision-preview',
GPT_4O = 'gpt-4o-2024-05-13'
}

export interface DalleGPTModel {
Expand Down Expand Up @@ -110,6 +111,13 @@ export const LlmsModels: Record<string, ChatModel> = {
outputPrice: 0.06, // 6
maxContextTokens: 16000,
chargeType: 'TOKEN'
},
'gpt-4o-2024-05-13': {
name: 'gpt-4o-2024-05-13',
inputPrice: 0.005, // 3
outputPrice: 0.0015, // 6
maxContextTokens: 128000,
chargeType: 'TOKEN'
}
}

Expand Down

0 comments on commit 95e6de2

Please sign in to comment.