Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please implement another version of this #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

colin-codegen[bot]
Copy link
Contributor

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

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