gpt4 book ai didi

python - Dialogflow 天气 webhook 连接错误

转载 作者:太空宇宙 更新时间:2023-11-03 21:38:34 25 4
gpt4 key购买 nike

fullfillment page至于我个人的兴趣,我想使用天气 api 制作一个天气聊天机器人。为此,我使用对话流,但是当我按照 Dialogflow github 进行 webhook 连接时但出现错误。 intent , a single intent根据我的 api 响应生成此 json

{
"responseId": "e37136ba-270b-435d-bfd6-61d83e286d96",
"queryResult": {
"queryText": "weather in delhi",
"action": "weather",
"parameters": {
"address": {
"city": "Delhi"
},
"unit": "",
"date-time": "",
"date-period": ""
},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"outputContexts": [
{
"name": "projects/plunesweather-a4aa6/agent/sessions/4c9e41c9-a732-b2fd-f311-cdb0b03d8c3b/contexts/weather",
"lifespanCount": 2,
"parameters": {
"date-period": "",
"address": {
"city.object": {},
"city.original": "delhi",
"city": "Delhi"
},
"date-period.original": "",
"unit": "",
"unit.original": "",
"address.original": "delhi",
"date-time.original": ""
}
}
],
"intent": {
"name": "projects/plunesweather-a4aa6/agent/intents/f1b75ecb-a35f-4a26-88fb-5a8049b92b02",
"displayName": "weather"
},
"intentDetectionConfidence": 1,
"diagnosticInfo": {
"webhook_latency_ms": 538
},
"languageCode": "en"
},
"webhookStatus": {
"code": 13,
"message": "Webhook call failed. Error: 500 INTERNAL SERVER ERROR"
}
}

完成请求生成此 json

{
"responseId": "e37136ba-270b-435d-bfd6-61d83e286d96",
"queryResult": {
"queryText": "weather in delhi",
"action": "weather",
"parameters": {
"address": {
"city": "Delhi"
},
"unit": "",
"date-time": "",
"date-period": ""
},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"outputContexts": [
{
"name": "projects/plunesweather-a4aa6/agent/sessions/4c9e41c9-a732-b2fd-f311-cdb0b03d8c3b/contexts/weather",
"lifespanCount": 2,
"parameters": {
"date-period": "",
"address": {
"city.object": {},
"city.original": "delhi",
"city": "Delhi"
},
"date-period.original": "",
"unit": "",
"unit.original": "",
"address.original": "delhi",
"date-time.original": ""
}
}
],
"intent": {
"name": "projects/plunesweather-a4aa6/agent/intents/f1b75ecb-a35f-4a26-88fb-5a8049b92b02",
"displayName": "weather"
},
"intentDetectionConfidence": 1,
"diagnosticInfo": {
"webhook_latency_ms": 538
},
"languageCode": "en"
},
"webhookStatus": {
"code": 13,
"message": "Webhook call failed. Error: 500 INTERNAL SERVER ERROR"
}
}

履行响应 image最后几个应用程序日志显示错误。由于我是新手,我不知道如何消除这些错误。提前致谢。 command line app logs

编辑:当我通过 stackdriver 错误报告时,我发现 this寻找这个问题我发现this

最佳答案

示例中存在错误,您需要更改 forecast.py 中的这一行:

-        furthest_date_requested = dt.combine(date_start,
- timedelta(days=forecast_length))
+ furthest_date_requested = date_start + timedelta(days=forecast_length)

This has been updated in the source repository,所以你也可以直接拉取该存储库。

关于python - Dialogflow 天气 webhook 连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53077389/

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