feat: add config for model selection #471

This commit is contained in:
zhayujie
2023-03-15 23:27:51 +08:00
parent b404e2c51f
commit 3c04325aae
9 changed files with 54 additions and 12 deletions

View File

@@ -0,0 +1,29 @@
from channel.channel import Channel
import sys
class TerminalChannel(Channel):
def startup(self):
context = {"from_user_id": "User"}
print("\nPlease input your question")
while True:
try:
prompt = self.get_input("User:\n")
except KeyboardInterrupt:
print("\nExiting...")
sys.exit()
print("Bot:")
sys.stdout.flush()
for res in super().build_reply_content(prompt, context):
print(res, end="")
sys.stdout.flush()
print("\n")
def get_input(self, prompt):
"""
Multi-line input function
"""
print(prompt, end="")
line = input()
return line