Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next' into wip/confidence
Browse files Browse the repository at this point in the history
  • Loading branch information
gcampax committed Feb 12, 2021
2 parents c12bc33 + 2d0f5ee commit 2f70c68
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
1 change: 0 additions & 1 deletion languages/thingtalk/state_manip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ export function tagContextForAgent(ctx : ContextInfo) : number[] {
return [contextTable.ctx_end];

case 'greet':
assert(ctx.state.history.length === 0, `expected empty history for greet`);
return [contextTable.ctx_greet];

case 'reinit':
Expand Down
39 changes: 39 additions & 0 deletions test/agent/expected-log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1322,3 +1322,42 @@ A: You need to enable Home Assistant before you can use that command.
#! comment: test comment for dialogue turns
#! additional
#! lines
====
# test
U: \t $stop;
UT: $stop;
====
# test
U: \t $dialogue @org.thingpedia.dialogue.transaction.execute;
U: @org.thingpedia.weather.current(location=new Location(37.442156, -122.1634471, "Palo Alto, California"));
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.weather.current(location=new Location(37.442156, -122.1634471, "Palo Alto, California"));
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: @org.thingpedia.weather.current(location=new Location(37.442156, -122.1634471, "Palo Alto, California"))
C: #[results=[
C: { location=new Location(37.442156, -122.1634471, "Palo Alto, California"), temperature=15.6C, wind_speed=3.4mps, humidity=91.3, cloudiness=4.7, fog=0, status=enum sunny, icon="http://api.met.no/weatherapi/weathericon/1.1/?symbol=1;content_type=image/png"^^tt:picture }
C: ]];
A: The current weather in Palo Alto, California is sunny. The temperature is 60.1 F and the humidity is 91.3 %.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_display_result;
U: \t $dialogue @org.thingpedia.dialogue.transaction.greet;
UT: $dialogue @org.thingpedia.dialogue.transaction.greet;
C: $dialogue @org.thingpedia.dialogue.transaction.greet;
C: @org.thingpedia.weather.current(location=new Location(37.442156, -122.1634471, "Palo Alto, California"))
C: #[results=[
C: { location=new Location(37.442156, -122.1634471, "Palo Alto, California"), temperature=15.6C, wind_speed=3.4mps, humidity=91.3, cloudiness=4.7, fog=0, status=enum sunny, icon="http://api.met.no/weatherapi/weathericon/1.1/?symbol=1;content_type=image/png"^^tt:picture }
C: ]];
A: Hi, how can I help you?
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_greet;
U: \t $dialogue @org.thingpedia.dialogue.transaction.cancel;
UT: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: $dialogue @org.thingpedia.dialogue.transaction.cancel;
C: @org.thingpedia.weather.current(location=new Location(37.442156, -122.1634471, "Palo Alto, California"))
C: #[results=[
C: { location=new Location(37.442156, -122.1634471, "Palo Alto, California"), temperature=15.6C, wind_speed=3.4mps, humidity=91.3, cloudiness=4.7, fog=0, status=enum sunny, icon="http://api.met.no/weatherapi/weathericon/1.1/?symbol=1;content_type=image/png"^^tt:picture }
C: ]];
A: Alright, bye!
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_end;
#! vote: down
#! comment: test comment for dialogue turns
#! additional
#! lines
22 changes: 22 additions & 0 deletions test/agent/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -708,3 +708,25 @@ A: You need to enable Home Assistant before you can use that command.
A: link: Configure Home Assistant /devices/create
A: >> context = null // {}
A: >> expecting = null

====
# 47-greet-in-the-middle
# getting the weather
U: \t $dialogue @org.thingpedia.dialogue.transaction.execute;
U: now => @org.thingpedia.weather.current(location=new Location(37.442156, -122.1634471, "Palo Alto, California")) => notify;

A: The current weather in Palo Alto, California is sunny. The temperature is 60.1 F and the humidity is 91.3 %.
A: >> context = $dialogue @org.thingpedia.dialogue.transaction . sys_display_result ; @org.thingpedia.weather . current ( location = LOCATION_0 ) #[ results = [ { location = LOCATION_0 , temperature = MEASURE_C_0 , wind_speed = MEASURE_mps_0 , humidity = NUMBER_0 , cloudiness = NUMBER_1 , fog = 0 , status = enum sunny , icon = PICTURE_0 } ] ] ; // {"LOCATION_0":{"latitude":37.442156,"longitude":-122.1634471,"display":"Palo Alto, California"},"MEASURE_C_0":{"unit":"C","value":15.6},"MEASURE_mps_0":{"unit":"mps","value":3.4},"NUMBER_0":91.3,"NUMBER_1":4.7,"PICTURE_0":"http://api.met.no/weatherapi/weathericon/1.1/?symbol=1;content_type=image/png"}
A: >> expecting = null

U: \t $dialogue @org.thingpedia.dialogue.transaction.greet;

A: Hi, how can I help you?
A: >> context = $dialogue @org.thingpedia.dialogue.transaction . sys_greet ; @org.thingpedia.weather . current ( location = LOCATION_0 ) #[ results = [ { location = LOCATION_0 , temperature = MEASURE_C_0 , wind_speed = MEASURE_mps_0 , humidity = NUMBER_0 , cloudiness = NUMBER_1 , fog = 0 , status = enum sunny , icon = PICTURE_0 } ] ] ; // {"LOCATION_0":{"latitude":37.442156,"longitude":-122.1634471,"display":"Palo Alto, California"},"MEASURE_C_0":{"unit":"C","value":15.6},"MEASURE_mps_0":{"unit":"mps","value":3.4},"NUMBER_0":91.3,"NUMBER_1":4.7,"PICTURE_0":"http://api.met.no/weatherapi/weathericon/1.1/?symbol=1;content_type=image/png"}
A: >> expecting = command

U: \t $dialogue @org.thingpedia.dialogue.transaction.cancel;

A: Alright, bye!
A: >> context = null // {}
A: >> expecting = null

0 comments on commit 2f70c68

Please sign in to comment.