Skip to content

Commit

Permalink
update gpt4 and gpt4o openai commands
Browse files Browse the repository at this point in the history
  • Loading branch information
fegloff committed May 28, 2024
1 parent 47489f3 commit e0d9657
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/modules/llms/openaiBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export class OpenAIBot extends LlmsBase {
ctx.hasCommand([
SupportedCommands.chat,
SupportedCommands.ask,
SupportedCommands.gpt4,
SupportedCommands.gpt,
SupportedCommands.gpto
]) ||
Expand All @@ -149,8 +148,8 @@ export class OpenAIBot extends LlmsBase {
(ctx.message?.text?.startsWith('new ') && ctx.chat?.type === 'private') && this.checkModel(ctx))
) {
await this.onStop(ctx)
this.updateSessionModel(ctx, LlmsModelsEnum.GPT_4)
await this.onChat(ctx, LlmsModelsEnum.GPT_4, true, false)
this.updateSessionModel(ctx, LlmsModelsEnum.GPT_4O)
await this.onChat(ctx, LlmsModelsEnum.GPT_4O, true, false)
return
}

Expand All @@ -160,6 +159,12 @@ export class OpenAIBot extends LlmsBase {
return
}

if (ctx.hasCommand(SupportedCommands.gpt4)) {
this.updateSessionModel(ctx, LlmsModelsEnum.GPT_4)
await this.onChat(ctx, LlmsModelsEnum.GPT_4, true, false)
return
}

if (ctx.hasCommand(SupportedCommands.ask32)) {
this.updateSessionModel(ctx, LlmsModelsEnum.GPT_4_32K)
await this.onChat(ctx, LlmsModelsEnum.GPT_4_32K, true, false)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/subagents/llamaSubagent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class LlamaAgent extends SubagentBase {
await Promise.all(urls.map(async url => {
let collection = ctx.session.collections.activeCollections.find(c => c.url === url)
if (!collection) {
await this.addUrlToCollection(ctx, ctx.chat?.id, url, msg.content as string)
await this.addUrlToCollection(ctx, ctx.chat?.id ?? 0, url, msg.content as string)
if (!ctx.session.collections.isProcessingQueue) {
ctx.session.collections.isProcessingQueue = true
await this.onCheckCollectionStatus(ctx)
Expand Down

0 comments on commit e0d9657

Please sign in to comment.