mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
fix: merge plugins to dev
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
from bridge.context import *
|
||||
from channel.channel import Channel
|
||||
import sys
|
||||
|
||||
class TerminalChannel(Channel):
|
||||
def startup(self):
|
||||
context = {"from_user_id": "User"}
|
||||
context = Context()
|
||||
print("\nPlease input your question")
|
||||
while True:
|
||||
try:
|
||||
@@ -12,12 +13,13 @@ class TerminalChannel(Channel):
|
||||
print("\nExiting...")
|
||||
sys.exit()
|
||||
|
||||
context.type = ContextType.TEXT
|
||||
context['session_id'] = "User"
|
||||
context.content = prompt
|
||||
print("Bot:")
|
||||
sys.stdout.flush()
|
||||
for res in super().build_reply_content(prompt, context):
|
||||
print(res, end="")
|
||||
sys.stdout.flush()
|
||||
print("\n")
|
||||
res = super().build_reply_content(prompt, context).content
|
||||
print(res)
|
||||
|
||||
|
||||
def get_input(self, prompt):
|
||||
|
||||
Reference in New Issue
Block a user