mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-27 07:54:19 +00:00
+6
-6
@@ -33,9 +33,9 @@ mirai_http_api_config = {
|
|||||||
# },
|
# },
|
||||||
# "http_proxy": "http://127.0.0.1:12345"
|
# "http_proxy": "http://127.0.0.1:12345"
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# 现已支持反向代理,可以添加reverse_proxy字段以使用反向代理
|
# 现已支持反向代理,可以添加reverse_proxy字段以使用反向代理
|
||||||
# 使用反向代理可以在国内使用OpenAI的API,反向代理的配置请参考
|
# 使用反向代理可以在国内使用OpenAI的API,反向代理的配置请参考
|
||||||
# https://github.com/Ice-Hazymoon/openai-scf-proxy
|
# https://github.com/Ice-Hazymoon/openai-scf-proxy
|
||||||
#
|
#
|
||||||
# 反向代理填写示例:
|
# 反向代理填写示例:
|
||||||
@@ -63,7 +63,7 @@ admin_qq = 0
|
|||||||
# 情景预设(机器人人格)
|
# 情景预设(机器人人格)
|
||||||
# 每个会话的预设信息,影响所有会话,无视指令重置
|
# 每个会话的预设信息,影响所有会话,无视指令重置
|
||||||
# 可以通过这个字段指定某些情况的回复,可直接用自然语言描述指令
|
# 可以通过这个字段指定某些情况的回复,可直接用自然语言描述指令
|
||||||
# 例如:
|
# 例如:
|
||||||
# default_prompt = "如果我之后想获取帮助,请你说“输入!help获取帮助”"
|
# default_prompt = "如果我之后想获取帮助,请你说“输入!help获取帮助”"
|
||||||
# 这样用户在不知所措的时候机器人就会提示其输入!help获取帮助
|
# 这样用户在不知所措的时候机器人就会提示其输入!help获取帮助
|
||||||
# 可参考 https://github.com/PlexPt/awesome-chatgpt-prompts-zh
|
# 可参考 https://github.com/PlexPt/awesome-chatgpt-prompts-zh
|
||||||
@@ -81,14 +81,14 @@ admin_qq = 0
|
|||||||
# 例如:
|
# 例如:
|
||||||
# !reset linux-terminal
|
# !reset linux-terminal
|
||||||
# 若不指定名称,则使用默认情景预设
|
# 若不指定名称,则使用默认情景预设
|
||||||
#
|
#
|
||||||
# 也可以使用指令:
|
# 也可以使用指令:
|
||||||
# !default <名称>
|
# !default <名称>
|
||||||
# 将指定的情景预设设置为默认情景预设
|
# 将指定的情景预设设置为默认情景预设
|
||||||
# 例如:
|
# 例如:
|
||||||
# !default linux-terminal
|
# !default linux-terminal
|
||||||
# 之后的会话重置时若不指定名称,则使用linux-terminal情景预设
|
# 之后的会话重置时若不指定名称,则使用linux-terminal情景预设
|
||||||
#
|
#
|
||||||
# 还可以加载文件中的预设文字,使用方法请查看:https://github.com/RockChinQ/QChatGPT/wiki/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8#%E9%A2%84%E8%AE%BE%E6%96%87%E5%AD%97
|
# 还可以加载文件中的预设文字,使用方法请查看:https://github.com/RockChinQ/QChatGPT/wiki/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8#%E9%A2%84%E8%AE%BE%E6%96%87%E5%AD%97
|
||||||
default_prompt = {
|
default_prompt = {
|
||||||
"default": "如果我之后想获取帮助,请你说“输入!help获取帮助”",
|
"default": "如果我之后想获取帮助,请你说“输入!help获取帮助”",
|
||||||
@@ -160,7 +160,7 @@ prompt_submit_length = 2048
|
|||||||
# OpenAI补全API的参数
|
# OpenAI补全API的参数
|
||||||
# 请在下方填写模型,程序自动选择接口
|
# 请在下方填写模型,程序自动选择接口
|
||||||
# 现已支持的模型有:
|
# 现已支持的模型有:
|
||||||
#
|
#
|
||||||
# 'gpt-4'
|
# 'gpt-4'
|
||||||
# 'gpt-4-0314'
|
# 'gpt-4-0314'
|
||||||
# 'gpt-4-32k'
|
# 'gpt-4-32k'
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ class OpenAIInteract:
|
|||||||
|
|
||||||
# 根据模型选择使用的接口
|
# 根据模型选择使用的接口
|
||||||
ai: ModelRequest = create_openai_model_request(
|
ai: ModelRequest = create_openai_model_request(
|
||||||
config.completion_api_params['model'],
|
config.completion_api_params['model'],
|
||||||
'user',
|
'user',
|
||||||
config.openai_config["http_proxy"] if "http_proxy" in config.openai_config else None
|
config.openai_config["http_proxy"] if "http_proxy" in config.openai_config else None
|
||||||
)
|
)
|
||||||
ai.request(
|
ai.request(
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ def process_command(session_name: str, text_message: str, mgr, config,
|
|||||||
|
|
||||||
params = text_message[1:].strip().split(' ')[1:]
|
params = text_message[1:].strip().split(' ')[1:]
|
||||||
|
|
||||||
# 把!~开头的转换成!cfg
|
# 把!~开头的转换成!cfg
|
||||||
if cmd.startswith('~'):
|
if cmd.startswith('~'):
|
||||||
params = [cmd[1:]] + params
|
params = [cmd[1:]] + params
|
||||||
cmd = 'cfg'
|
cmd = 'cfg'
|
||||||
|
|||||||
+2
-2
@@ -50,8 +50,8 @@ class ReplyFilter:
|
|||||||
|
|
||||||
# 百度云审核URL
|
# 百度云审核URL
|
||||||
baidu_url = "https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined?access_token=" + \
|
baidu_url = "https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined?access_token=" + \
|
||||||
str(requests.post("https://aip.baidubce.com/oauth/2.0/token",
|
str(requests.post("https://aip.baidubce.com/oauth/2.0/token",
|
||||||
params={"grant_type": "client_credentials",
|
params={"grant_type": "client_credentials",
|
||||||
"client_id": self.baidu_api_key,
|
"client_id": self.baidu_api_key,
|
||||||
"client_secret": self.baidu_secret_key}).json().get("access_token"))
|
"client_secret": self.baidu_secret_key}).json().get("access_token"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user