mirror of https://github.com/Mai-with-u/MaiBot.git
better:统计现在统计模型名,限制思考长度
parent
ae1f509cdb
commit
ea5d08ba54
|
|
@ -134,6 +134,11 @@ class DefaultReplyer:
|
||||||
try:
|
try:
|
||||||
content, reasoning_content, model_name, tool_call = await self.llm_generate_content(prompt)
|
content, reasoning_content, model_name, tool_call = await self.llm_generate_content(prompt)
|
||||||
logger.debug(f"replyer生成内容: {content}")
|
logger.debug(f"replyer生成内容: {content}")
|
||||||
|
|
||||||
|
logger.info(f"replyer生成内容: {content}")
|
||||||
|
logger.info(f"replyer生成推理: {reasoning_content}")
|
||||||
|
logger.info(f"replyer生成模型: {model_name}")
|
||||||
|
|
||||||
llm_response.content = content
|
llm_response.content = content
|
||||||
llm_response.reasoning = reasoning_content
|
llm_response.reasoning = reasoning_content
|
||||||
llm_response.model = model_name
|
llm_response.model = model_name
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ def init_replyer_prompt():
|
||||||
尽量简短一些。{keywords_reaction_prompt}请注意把握聊天内容,不要回复的太有条理,可以有个性。
|
尽量简短一些。{keywords_reaction_prompt}请注意把握聊天内容,不要回复的太有条理,可以有个性。
|
||||||
{reply_style}
|
{reply_style}
|
||||||
请注意不要输出多余内容(包括前后缀,冒号和引号,括号,表情等),只输出一句回复内容就好。
|
请注意不要输出多余内容(包括前后缀,冒号和引号,括号,表情等),只输出一句回复内容就好。
|
||||||
{moderation_prompt}不要输出多余内容(包括前后缀,冒号和引号,括号,表情包,at或 @等 )。
|
{moderation_prompt}不要输出多余内容(包括前后缀,冒号和引号,括号,表情包,at或 @等 )。请不要思考太长
|
||||||
现在,你说:""",
|
现在,你说:""",
|
||||||
"replyer_prompt",
|
"replyer_prompt",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -334,7 +334,7 @@ class StatisticOutputTask(AsyncTask):
|
||||||
|
|
||||||
request_type = record.request_type or "unknown"
|
request_type = record.request_type or "unknown"
|
||||||
user_id = record.user_id or "unknown" # user_id is TextField, already string
|
user_id = record.user_id or "unknown" # user_id is TextField, already string
|
||||||
model_name = record.model_name or "unknown"
|
model_name = record.model_assign_name or record.model_name or "unknown"
|
||||||
|
|
||||||
# 提取模块名:如果请求类型包含".",取第一个"."之前的部分
|
# 提取模块名:如果请求类型包含".",取第一个"."之前的部分
|
||||||
module_name = request_type.split(".")[0] if "." in request_type else request_type
|
module_name = request_type.split(".")[0] if "." in request_type else request_type
|
||||||
|
|
@ -1266,7 +1266,7 @@ class StatisticOutputTask(AsyncTask):
|
||||||
total_cost_data[interval_index] += cost # type: ignore
|
total_cost_data[interval_index] += cost # type: ignore
|
||||||
|
|
||||||
# 累加按模型分类的花费
|
# 累加按模型分类的花费
|
||||||
model_name = record.model_name or "unknown"
|
model_name = record.model_assign_name or record.model_name or "unknown"
|
||||||
if model_name not in cost_by_model:
|
if model_name not in cost_by_model:
|
||||||
cost_by_model[model_name] = [0] * len(time_points)
|
cost_by_model[model_name] = [0] * len(time_points)
|
||||||
cost_by_model[model_name][interval_index] += cost
|
cost_by_model[model_name][interval_index] += cost
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue