AutoPEP8
This commit is contained in:
@@ -58,9 +58,10 @@ tigerbot:
|
||||
key: key
|
||||
model: tigerbot-7b-sft
|
||||
|
||||
# 使用讯飞星火模型api需要抓取以下参数
|
||||
# 抓取方式详见:https://github.com/HildaM/sparkdesk-api/tree/main/docs
|
||||
xinghuo_web:
|
||||
cookie: cookie
|
||||
fd: fd
|
||||
GtToken: GtToken
|
||||
# 使用讯飞星火web模式api需要抓取以下参数
|
||||
# 抓取方式详见文档:https://www.bilibili.com/read/cv27066577
|
||||
# xinghuo_web:
|
||||
# cookie: cookie
|
||||
# fd: fd
|
||||
# GtToken: GtToken
|
||||
# prompt: 你是智能聊天机器人,你叫wcferry。请用这个角色回答我的问题 # 根据需要对角色进行设定
|
||||
@@ -2,20 +2,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from sparkdesk_web.core import SparkWeb
|
||||
|
||||
|
||||
class XinghuoWeb():
|
||||
def __init__(self, xhconf=None) -> None:
|
||||
|
||||
self._sparkWeb = SparkWeb(
|
||||
cookie=xhconf["cookie"],
|
||||
fd=xhconf["fd"],
|
||||
GtToken=xhconf["GtToken"]
|
||||
GtToken=xhconf["GtToken"],
|
||||
)
|
||||
self._chat = self._sparkWeb.create_continuous_chat()
|
||||
# 如果有提示词
|
||||
if xhconf["prompt"]:
|
||||
self._chat.chat(xhconf["prompt"])
|
||||
|
||||
def get_answer(self, msg: str, sender: str = None) -> str:
|
||||
answer = self._chat.chat(msg)
|
||||
return answer
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from configuration import Config
|
||||
c = Config()
|
||||
|
||||
Reference in New Issue
Block a user