Skip to content

Please implement another version of this#30

Open
colin-codegen[bot] wants to merge 1 commit into
mainfrom
codegen/col-82-please-implement-another-version-of-th-9baa4e-362
Open

Please implement another version of this#30
colin-codegen[bot] wants to merge 1 commit into
mainfrom
codegen/col-82-please-implement-another-version-of-th-9baa4e-362

Conversation

@colin-codegen

@colin-codegen colin-codegen Bot commented Sep 7, 2023

Copy link
Copy Markdown
Contributor

Codegen PR • View Issue

The approach basically introduces a mechanism to toggle between different versions of the bot. A new file src/server/chat/gpt3Alternate.ts (analogous to the existing gpt3 file) is proposed to hold the alternate chatbot strategy. Another new file src/server/chat/botConfig.ts would contain configuration to dynamically switch between the two versions ('original' and 'alternate'). The main code adjustment happens in the chat.ts file, where the import of getReply function is made dependent on the value in BOT_VERSION from botConfig.ts:

import { BOT_VERSION } from '../../server/chat/botConfig';
import { getReply as getOriginalReply } from '../../server/chat/gpt3';
import { getReply as getAlternateReply } from '../../server/chat/gpt3Alternate';

const getReply = BOT_VERSION === 'original' ? getOriginalReply : getAlternateReply;

The getReply function from the chosen file will then be used by the chat bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants