Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bme-mcp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何家明
bme-mcp
Commits
ed3aed2a
Commit
ed3aed2a
authored
Nov 06, 2025
by
何家明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化配置项
parent
c3e601a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
client.py
client/client.py
+15
-12
No files found.
client/client.py
View file @
ed3aed2a
...
...
@@ -35,17 +35,20 @@ async def update_fixed_answer(_id, default_answer):
async
def
record_answer
(
_id
,
_completion_answer
):
"""AI回答完成后,异步更新回答数据"""
await
db_util
.
update
(
AiChatRecordEntity
,
{
"id"
:
_id
},
{
"answer"
:
_completion_answer
,
"answer_time"
:
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
}
)
try
:
await
db_util
.
update
(
AiChatRecordEntity
,
{
"id"
:
_id
},
{
"answer"
:
_completion_answer
,
"answer_time"
:
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
}
)
logger
.
info
(
f
"Record answer success, chat_record_id: {_id}"
)
except
Exception
as
e
:
logger
.
error
(
f
"Record answer failed, chat_record_id: {_id}, error: {str(e)}"
,
exc_info
=
True
)
class
McpClient
:
def
__init__
(
self
):
...
...
@@ -174,7 +177,7 @@ class McpClient:
if
db_question
and
len
(
db_question
)
>
0
and
db_question
[
0
]
.
question_type
==
"fixed"
:
# 固定问题
q
=
db_question
[
0
]
# 更新频率小于等于0,或者默认回答没有数据,那都要重新调用AI
call_ai
=
q
.
answer_update_frequency
<=
0
or
q
.
default_answer
is
None
call_ai
=
q
.
answer_update_frequency
<=
0
or
not
q
.
default_answer
fixed_question_id
=
q
.
id
if
not
call_ai
:
if
q
.
latest_answer_time
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment