mirror of
https://github.com/jie65535/JChatGPT.git
synced 2025-06-02 17:39:10 +08:00
Fix tool execution failure
This commit is contained in:
parent
c74457e739
commit
72d0914a7a
@ -339,7 +339,12 @@ object JChatGPT : KotlinPlugin(
|
|||||||
val args = function.argumentsAsJsonOrNull()
|
val args = function.argumentsAsJsonOrNull()
|
||||||
logger.info("Calling ${function.name}(${args})")
|
logger.info("Calling ${function.name}(${args})")
|
||||||
// 执行函数
|
// 执行函数
|
||||||
val result = agent.execute(args)
|
val result = try {
|
||||||
|
agent.execute(args)
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
logger.error("Failed to call ${function.name}", e)
|
||||||
|
"工具调用失败,请尝试自行回答用户,或如实告知。"
|
||||||
|
}
|
||||||
logger.info("Result=$result")
|
logger.info("Result=$result")
|
||||||
// 过会撤回加载消息
|
// 过会撤回加载消息
|
||||||
if (receipt != null) {
|
if (receipt != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user