gpt4 book ai didi

python - 使用用户程序员指南时遇到问题

转载 作者:太空狗 更新时间:2023-10-29 12:30:18 27 4
gpt4 key购买 nike

我正在 this site 上做练习.在我到达上下文订阅之前,我完全按照这个例子没有任何问题:

(curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
],
"attributes": [
"temperature"
],
"reference": "http://localhost:1028/accumulate",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONTIMEINTERVAL",
"condValues": [
"PT10S"
]
}
]
}
EOF

当我输入该代码时,我得到了预期的答案:

{
"subscribeResponse": {
"duration": "P1M",
"subscriptionId": "51c04a21d714fb3b37d7d5a7"
}
}

但是这句话让我感到困惑:

If you look at the accumulator-script.py terminal window, you will see that a message resembling the following one is received each 10 seconds:

我在这里做的是输入这个命令:python accumulator-server.py但是我得到的输出(每 10 秒更新一次)是:127.0.0.1 - - [08/Apr/2015 10:52:56] "POST/accumulate HTTP/1.1"200 -

我是否遗漏了一些东西,因为我没有得到与教程中提到的类似的预期输出?

POST http://localhost:1028/accumulate
Content-Length: 492
User-Agent: orion/0.9.0
Host: localhost:1028
Accept: application/xml, application/json
Content-Type: application/json

{
"subscriptionId" : "51c04a21d714fb3b37d7d5a7",
"originator" : "localhost",
"contextResponses" : [
{
"contextElement" : {
"attributes" : [
{
"name" : "temperature",
"type" : "float",
"value" : "26.5"
}
],
"type" : "Room",
"isPattern" : "false",
"id" : "Room1"
},
"statusCode" : {
"code" : "200",
"reasonPhrase" : "OK"
}
}
]
}

我没有正确运行 python 脚本吗?顺便说一句,我是 python 和 linux 的新手...

最佳答案

根据 the manual ,累加器的运行方式如下:

./accumulator-server.py 1028 /accumulate ::1 on

关于python - 使用用户程序员指南时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29510204/

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