gpt4 book ai didi

javascript - 如何从 CONNECT 平台内部编程调用中获取输出?

转载 作者:行者123 更新时间:2023-11-30 19:32:05 24 4
gpt4 key购买 nike

如以下答案所述,在 CONNECT 平台上使用内部 Node 调用时:How to make a node call from another node in a package on CONNECT platform ,如何获取该调用的输出?

最佳答案

platform.call 返回一个 Promise 对象,因此您基本上需要执行如下操作:

platform.call('/whatever', { param: 'stuff' })
.then(response => {
//
// handle the response.
// - `response.output` will denote which output of the node's signature was
// activated,
// - `response.data` will be the data sent to that output,
// - `response.control` will be the control output of the node according to its
// signature.
//
})
.catch(error => {
//
// whatever error handling logic.
//
});

要复习 Node 签名、输出、控制输出等,也许可以看这里: https://medium.com/connect-platform/connect-platform-basic-concepts-543b79c3094e

关于javascript - 如何从 CONNECT 平台内部编程调用中获取输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56329007/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com