mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-26 03:44:58 +08:00
refactor: 恢复所有审计API调用
This commit is contained in:
@@ -84,3 +84,24 @@ class ToolManager:
|
||||
self.ap.logger.error(f'执行函数 {name} 时发生错误: {e}')
|
||||
traceback.print_exc()
|
||||
return f'error occurred when executing function {name}: {e}'
|
||||
finally:
|
||||
|
||||
plugin = None
|
||||
|
||||
for p in self.ap.plugin_mgr.plugins:
|
||||
if function in p.content_functions:
|
||||
plugin = p
|
||||
break
|
||||
|
||||
if plugin is not None:
|
||||
|
||||
await self.ap.ctr_mgr.usage.post_function_record(
|
||||
plugin={
|
||||
'name': plugin.plugin_name,
|
||||
'remote': plugin.plugin_source,
|
||||
'version': plugin.plugin_version,
|
||||
'author': plugin.plugin_author
|
||||
},
|
||||
function_name=function.name,
|
||||
function_description=function.description,
|
||||
)
|
||||
Reference in New Issue
Block a user