gpt4 book ai didi

ios - 在 DialogFlow 中重置上下文

转载 作者:行者123 更新时间:2023-11-28 19:28:47 26 4
gpt4 key购买 nike

我希望能够在我的 DialogFlow 对话中重置上下文。这就是我正在尝试的:

func sendApiRequest(outgoing: String, isInitial: Bool) {
let request = ApiAI.shared().textRequest()
request?.query = [outgoing]

if isInitial {
let requestContext = AIRequestContext.init(name: "startup", andLifespan: 0, andParameters: nil)
request?.requestContexts = [requestContext]
}
// (send and get response)

.. 但这无法重置上下文。有办法吗?

最佳答案

使用 Node.js 这对我们有用

//remove context by setting life span to 0
app.setContext(Input_Context_Remove, 0);

//set the output context to the next intent's input context with life span
app.setContext(Input_Context_Add, 3);

关于ios - 在 DialogFlow 中重置上下文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48569921/

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