Giter VIP home page Giter VIP logo

actions-on-google-java's People

Contributors

atulep avatar fleker avatar kishores avatar kokoro-team avatar proppy avatar taycaldwell avatar yoichiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actions-on-google-java's Issues

Consistency of "grpc" dependencies between actions-on-google-java and google-cloud-dialogflow

Hello,

I use actions-on-google-java and google-cloud-dialogflow, for several purposes but mainly in order to manage session entities.

There is a dependency conflict between those two packages that use a different version of grpc libs.

There is a solution that consist to specify the latest grpc version in our pom :

         <!-- grpc -->
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-core</artifactId>
            <version>1.21.0</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>1.21.0</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-stub</artifactId>
            <version>1.21.0</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-auth</artifactId>
            <version>1.21.0</version>
        </dependency>
        <!-- Dialogflow -->
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-dialogflow</artifactId>
            <version>0.104.0-alpha</version>
        </dependency>
        <dependency>
            <groupId>com.google.actions</groupId>
            <artifactId>actions-on-google</artifactId>
            <version>1.5.0</version>
        </dependency>

Could the actions-on-google-java project use the same version than google-cloud-dialogflow in order to avoid to specify grpc in our pom.

report state need a Integer value type

The spectrumRgb report state need a integer value,but the Value build only has a number type and will turn to Double type.
https://developers.google.com/assistant/smarthome/traits/colorsetting#device-states

below is the main error log info:

`
value {
struct_value {
fields {
key: "color"
value {
struct_value {
fields {
key: "spectrumRgb"
value {
number_value: 9109504.0
}
}
}
}
}
}
}

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request contains an invalid argument.
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) ~[spring-webmvc-5.0.7.RELEASE.jar:5.0.7.RELEASE]
Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request contains an invalid argument.
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:233) ~[grpc-stub-1.15.1.jar:1.15.1]
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:214) ~[grpc-stub-1.15.1.jar:1.15.1]
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:139) ~[grpc-stub-1.15.1.jar:1.15.1]
at com.google.home.graph.v1.HomeGraphApiServiceGrpc$HomeGraphApiServiceBlockingStub.reportStateAndNotification(HomeGraphApiServiceGrpc.java:425) ~[actions-on-google-1.8.0.jar:?]
at com.google.actions.api.smarthome.SmartHomeApp.reportState(SmartHomeApp.kt:132) ~[actions-on-google-1.8.0.jar:?]`

Library has a binding on Log4j through SLF4J

The library can cause a multiple binding and potentially overwrite the bindings on an application depending on it if that application doesn't use Log4j.

As per the SLF4J documentation:
Embedded components such as libraries not only do not need to configure the underlying logging framework, they really should not do so. They should invoke SLF4J to log but should let the end-user configure the logging environment. When embedded components try to configure logging on their own, they often override the end-user's wishes. At the end of the day, it is the end-user who has to read the logs and process them. She should be the person to decide how she wants her logging configured.

Dock command throws exception

Dock request from Google:
{ "inputs": [ { "context": { "locale_country": "US", "locale_language": "en" }, "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "customData": { "DockCommand": "dock", "DockDevice": "actionControl", "LocateCommand": "find_me", "LocateDevice": "actionCommand", "StartStopCommandfalse": "pause", "StartStopCommandtrue": "vacuum", "StartStopDevice": "actionControl" }, "id": "xiaomiVacuum" } ], "execution": [ { "command": "action.devices.commands.Dock" } ] } ] } } ], "requestId": "6209328299679820472" }

Exception:

org.json.JSONException: JSONObject["params"] not found. at org.json.JSONObject.get(JSONObject.java:520) at org.json.JSONObject.getJSONObject(JSONObject.java:732) at com.google.actions.api.smarthome.SmartHomeRequest$Companion.create(SmartHomeRequest.kt:107) at com.google.actions.api.smarthome.SmartHomeApp.createRequest(SmartHomeApp.kt:49) at com.google.actions.api.smarthome.SmartHomeApp.handleRequest(SmartHomeApp.kt:142)

UserStorage doesn't persist between conversations

Currently UserStorage seems to not be working. It has been like this for ~2weeks and used to work in past without major changes in my code. UserStorage seems to keep the data for length of the conversation and after new conversation starts it will show as empty.

I have done the usual people have tried: enabling all actions data including Web & App also Include Chrome history and activity ... Checked user is "VERIFIED"

Also tried to run version 1.6.0 and it had the exact same problem.

It seems like people are having the same problem on nodejs version too:
actions-on-google/actions-on-google-nodejs#358
actions-on-google/actions-on-google-nodejs#359

Dependency issue with GCP jars like cloud logging

This version is not compatible if we are using any GCP functionality within the action. I got following dependency conflict:
Description Resource Path Location Type
Could not resolve version conflict among [StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> com.google.cloud:google-cloud-logging:jar:1.98.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.91.2 -> com.google.api:gax-grpc:jar:1.49.0 -> io.grpc:grpc-netty-shaded:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> com.google.cloud:google-cloud-logging:jar:1.98.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.91.2 -> com.google.api:gax-grpc:jar:1.49.0 -> io.grpc:grpc-alts:jar:1.23.0 -> io.grpc:grpc-grpclb:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> com.google.cloud:google-cloud-logging:jar:1.98.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.91.2 -> com.google.api:gax-grpc:jar:1.49.0 -> io.grpc:grpc-alts:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> com.google.cloud:google-cloud-logging:jar:1.98.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.91.2 -> io.grpc:grpc-core:jar:1.24.0, StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> io.grpc:grpc-all:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> io.grpc:grpc-all:jar:1.23.0 -> io.grpc:grpc-netty:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> io.grpc:grpc-all:jar:1.23.0 -> io.grpc:grpc-okhttp:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> io.grpc:grpc-all:jar:1.23.0 -> io.grpc:grpc-testing:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], com.starfish.utils:intent-parser:jar:1.0-SNAPSHOT -> com.google.cloud:google-cloud-datastore:jar:1.98.0 -> io.grpc:grpc-core:jar:1.24.0, com.google.actions:actions-on-google:jar:1.7.0 -> io.grpc:grpc-protobuf:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.7.0 -> io.grpc:grpc-protobuf:jar:1.15.1 -> io.grpc:grpc-protobuf-lite:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.7.0 -> io.grpc:grpc-stub:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.7.0 -> io.grpc:grpc-auth:jar:1.15.1 -> io.grpc:grpc-core:jar:[1.15.1,1.15.1]]

org.eclipse.aether.collection.UnsolvableVersionConflictException: Could not resolve version conflict among [StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> com.google.cloud:google-cloud-logging:jar:1.98.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.91.2 -> com.google.api:gax-grpc:jar:1.49.0 -> io.grpc:grpc-netty-shaded:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> com.google.cloud:google-cloud-logging:jar:1.98.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.91.2 -> com.google.api:gax-grpc:jar:1.49.0 -> io.grpc:grpc-alts:jar:1.23.0 -> io.grpc:grpc-grpclb:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> com.google.cloud:google-cloud-logging:jar:1.98.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.91.2 -> com.google.api:gax-grpc:jar:1.49.0 -> io.grpc:grpc-alts:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> com.google.cloud:google-cloud-logging:jar:1.98.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.91.2 -> io.grpc:grpc-core:jar:1.24.0, StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> io.grpc:grpc-all:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> io.grpc:grpc-all:jar:1.23.0 -> io.grpc:grpc-netty:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> io.grpc:grpc-all:jar:1.23.0 -> io.grpc:grpc-okhttp:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], StarfishELK:StarfishELK:jar:0.0.1-SNAPSHOT -> io.grpc:grpc-all:jar:1.23.0 -> io.grpc:grpc-testing:jar:1.23.0 -> io.grpc:grpc-core:jar:[1.23.0,1.23.0], com.starfish.utils:intent-parser:jar:1.0-SNAPSHOT -> com.google.cloud:google-cloud-datastore:jar:1.98.0 -> io.grpc:grpc-core:jar:1.24.0, com.google.actions:actions-on-google:jar:1.7.0 -> io.grpc:grpc-protobuf:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.7.0 -> io.grpc:grpc-protobuf:jar:1.15.1 -> io.grpc:grpc-protobuf-lite:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.7.0 -> io.grpc:grpc-stub:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.7.0 -> io.grpc:grpc-auth:jar:1.15.1 -> io.grpc:grpc-core:jar:[1.15.1,1.15.1]]
at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.newFailure(NearestVersionSelector.java:159)
at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.backtrack(NearestVersionSelector.java:120)
at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.selectVersion(NearestVersionSelector.java:93)
at org.eclipse.aether.util.graph.transformer.ConflictResolver.transformGraph(ConflictResolver.java:181)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:266)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:279)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:169)
at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:225)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:198)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:122)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:630)
at org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:63)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:551)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$2(ProjectRegistryManager.java:515)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:513)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:365)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:312)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:155)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:90)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:87)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:201)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:833)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
pom.xml /My-MP-Bean line 1 Maven Dependency Problem

I have resolved it for now by excluding it like this:

<dependency> <groupId>com.google.actions</groupId> <artifactId>actions-on-google</artifactId> <version>1.7.0</version> <exclusions> <exclusion> <groupId>io.grpc</groupId> <artifactId>grpc-netty-shaded</artifactId> </exclusion> <exclusion> <groupId>io.grpc</groupId> <artifactId>grpc-protobuf</artifactId> </exclusion> <exclusion> <groupId>io.grpc</groupId> <artifactId>grpc-auth</artifactId> </exclusion> </exclusions> </dependency>

java.net.UnknownHostException: when trying to process an appspot.com URL from an actions-on-google project

This issue is with reference to issue 22. I am getting a java.net.UnknownHostException when I try to parse the JSON returned by a REST service in a Google Cloud Project.
My actions-on-google app is in one project (https://sampleapp-3cbe2.appspot.com) on Google cloud and my REST Service is in another Google Cloud project (https://fitzroi-rest-api-0525.appspot.com). Do you know of any solution to this or do you have any recommendations?

ktor

[Suggesion] It would be great if had ktor integration

Dependency conflicts with Firebase Admin SDK

There's a conflict between actions-on-google 1.3.0 and Firebase Admin SDK 6.9.0. When you try to use both packages in a pom.xml you receive errors for conflicts about several packages. It would be great to update dependencies of actions-on-google package.

Could not resolve version conflict among [com.google.actions:actions-on-google:jar:1.3.0 -> io.grpc:grpc-protobuf:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.3.0 -> io.grpc:grpc-protobuf:jar:1.15.1 -> io.grpc:grpc-protobuf-lite:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.3.0 -> io.grpc:grpc-stub:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.3.0 -> io.grpc:grpc-auth:jar:1.15.1 -> io.grpc:grpc-core:jar:[1.15.1,1.15.1], com.google.firebase:firebase-admin:jar:6.9.0 -> com.google.cloud:google-cloud-firestore:jar:1.9.0 -> com.google.api:gax-grpc:jar:1.46.1 -> io.grpc:grpc-alts:jar:1.21.0 -> io.grpc:grpc-grpclb:jar:1.21.0 -> io.grpc:grpc-core:jar:[1.21.0,1.21.0], com.google.firebase:firebase-admin:jar:6.9.0 -> com.google.cloud:google-cloud-firestore:jar:1.9.0 -> com.google.api:gax-grpc:jar:1.46.1 -> io.grpc:grpc-alts:jar:1.21.0 -> io.grpc:grpc-core:jar:[1.21.0,1.21.0], com.google.firebase:firebase-admin:jar:6.9.0 -> com.google.cloud:google-cloud-firestore:jar:1.9.0 -> io.grpc:grpc-netty-shaded:jar:1.21.0 -> io.grpc:grpc-core:jar:[1.21.0,1.21.0], com.google.firebase:firebase-admin:jar:6.9.0 -> com.google.cloud:google-cloud-firestore:jar:1.9.0 -> io.opencensus:opencensus-contrib-grpc-util:jar:0.21.0 -> io.grpc:grpc-core:jar:1.19.0]

org.eclipse.aether.collection.UnsolvableVersionConflictException: Could not resolve version conflict among [com.google.actions:actions-on-google:jar:1.3.0 -> io.grpc:grpc-protobuf:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.3.0 -> io.grpc:grpc-protobuf:jar:1.15.1 -> io.grpc:grpc-protobuf-lite:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.3.0 -> io.grpc:grpc-stub:jar:1.15.1 -> io.grpc:grpc-core:jar:1.15.1, com.google.actions:actions-on-google:jar:1.3.0 -> io.grpc:grpc-auth:jar:1.15.1 -> io.grpc:grpc-core:jar:[1.15.1,1.15.1], com.google.firebase:firebase-admin:jar:6.9.0 -> com.google.cloud:google-cloud-firestore:jar:1.9.0 -> com.google.api:gax-grpc:jar:1.46.1 -> io.grpc:grpc-alts:jar:1.21.0 -> io.grpc:grpc-grpclb:jar:1.21.0 -> io.grpc:grpc-core:jar:[1.21.0,1.21.0], com.google.firebase:firebase-admin:jar:6.9.0 -> com.google.cloud:google-cloud-firestore:jar:1.9.0 -> com.google.api:gax-grpc:jar:1.46.1 -> io.grpc:grpc-alts:jar:1.21.0 -> io.grpc:grpc-core:jar:[1.21.0,1.21.0], com.google.firebase:firebase-admin:jar:6.9.0 -> com.google.cloud:google-cloud-firestore:jar:1.9.0 -> io.grpc:grpc-netty-shaded:jar:1.21.0 -> io.grpc:grpc-core:jar:[1.21.0,1.21.0], com.google.firebase:firebase-admin:jar:6.9.0 -> com.google.cloud:google-cloud-firestore:jar:1.9.0 -> io.opencensus:opencensus-contrib-grpc-util:jar:0.21.0 -> io.grpc:grpc-core:jar:1.19.0]
	at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.newFailure(NearestVersionSelector.java:150)
	at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.backtrack(NearestVersionSelector.java:111)
	at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.selectVersion(NearestVersionSelector.java:84)
	at org.eclipse.aether.util.graph.transformer.ConflictResolver.transformGraph(ConflictResolver.java:187)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:273)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
	at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
	at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:215)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:188)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:119)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:636)
	at org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:63)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:530)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:492)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:1)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:496)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:351)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:298)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:154)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:89)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Debugging the project

I want to know how can I debug the project to understand the flow of code & to resolve the errors. Currently I am unable to understand the flow from where it would start and how can it be used for more projects.

consider dropping JSONObject from the smarthome API surface

Currently the libraries exposes JSONObject as part of the public smarthome API object:
https://github.com/actions-on-google/actions-on-google-java/blob/7f3b1e2fd51e3b044380ea3c72722058ad99240f/src/main/kotlin/com/google/actions/api/smarthome/SmartHomeResponse.kt

This force reverse dependencies to both depens on org.json (as a direct dependency) and gson (transitively).

It would be nice if the library instead only surfaced standard Map<String, Object> types in the public API.

/cc @taycaldwell @Fleker

vendored googleapis proto cause duplicate-dependency-class issues

Running https://github.com/nebula-plugins/gradle-lint-plugin on a project that depens on actions-on-google:1.8.0 will trigger the following warning.

com.google.actions:actions-on-google:1.8.0 in configuration ':implementation' has 18 classes duplicated by com.google.api.grpc:proto-google-common-protos:1.17.0. Duplicate classes: [com/google/api/CustomHttpPatternOrBuilder, com/google/api/AnnotationsProto$1, com/google/api/CustomHttpPattern$1, com/google/api/AnnotationsProto, com/google/api/CustomHttpPattern, com/google/api/Http$Builder, com/google/api/HttpOrBuilder, com/google/api/CustomHttpPattern$Builder, com/google/api/HttpRule, com/google/api/HttpRuleOrBuilder, com/google/api/HttpRule$PatternCase, com/google/api/HttpProto, com/google/api/HttpRule$Builder, com/google/api/HttpRule$2, com/google/api/HttpRule$1, com/google/api/Http, com/google/api/Http$1, com/google/api/HttpProto$1]

This project contains lint violations. A complete listing of the violations follows. 
Because none were serious, the build's overall status was unaffected.

warning   duplicate-dependency-class         com.google.actions:actions-on-google:1.8.0 in configuration ':implementation' has 18 classes duplicated by com.google.api.grpc:proto-google-common-protos:1.17.0 (use --info for detailed class list) (no auto-fix available)

I believe this is due to the project vendoring the generated class from the following proto:
https://github.com/actions-on-google/actions-on-google-java/tree/master/src/main/proto/google/api

While those are also available as part of the com.google.api.grpc:proto-google-common-protos:1.17.0, which actions-on-google:1.8.0 depends transitively thru io.grpc:grpc-protobuf in https://github.com/actions-on-google/actions-on-google-java/blob/master/build-smarthome.gradle#L51.

see:

~ 🍊 join <(unzip -Z1 /usr/local/google/home/proppy/.gradle/caches/modules-2/files-2.1/com.google.api.grpc/proto-google-common-protos/1.17.0/40471bf2045151c17da555889b5550fcfd5224a8/proto-google-common-protos-1.17.0.jar | sort)  <(unzip -Z1 ~/.gradle/caches/modules-2/files-2.1/com.google.actions/actions-on-google/1.8.0/4c3c71a26360b337a0afe4f3e5d27157a04ff132/actions-on-google-1.8.0.jar | sort)
com/
com/google/
com/google/api/
com/google/api/AnnotationsProto$1.class
com/google/api/AnnotationsProto.class
com/google/api/CustomHttpPattern$1.class
com/google/api/CustomHttpPattern$Builder.class
com/google/api/CustomHttpPattern.class
com/google/api/CustomHttpPatternOrBuilder.class
com/google/api/Http$1.class
com/google/api/Http$Builder.class
com/google/api/Http.class
com/google/api/HttpOrBuilder.class
com/google/api/HttpProto$1.class
com/google/api/HttpProto.class
com/google/api/HttpRule$1.class
com/google/api/HttpRule$2.class
com/google/api/HttpRule$Builder.class
com/google/api/HttpRule$PatternCase.class
com/google/api/HttpRule.class
com/google/api/HttpRuleOrBuilder.class
google/
google/api/
google/api/annotations.proto
google/api/http.proto
META-INF/
META-INF/MANIFEST.MF

/cc @taycaldwell @Fleker

Pom is malformed on maven central.

Just tried to compile, gave me this error.

[WARNING] The POM for com.google.actions:actions-on-google:pom:1.0.0 is invalid, transitive dependencies (if any) will not be available: 
 2 problems were encountered while building the effective model for com.google.actions:actions-on-google:1.0.0
[ERROR] 'dependencies.dependency.systemPath' for com.google.actions.v2:google-actions-bindings:jar must specify an absolute path but
is ${project.basedir}/lib/libactions_java_lib.jar @
[ERROR] 'dependencies.dependency.systemPath' for com.dialogflow.bindings:dialogflow-bindings:jar must specify an absolute path but 
is ${project.basedir}/lib/libdialogflow_java_lib.jar @ 

Kotlin friendly DSL support

It's so nice to see kotlin being used as a standard for java libraries. This is really awesome!

So while I think I understand the reason to rely on ResponseBuilder so that java users can have better interop. One of my favorites things on kotlin is the DSL support for typesafe builders.

I honestly became addicted to it :)

One of my favorites implementations is https://github.com/fkorotkov/k8s-kotlin-dsl

Makes kube-client-dsl so much nicer to use in kotlin projects

So I was wondering if you would be open to accept such PR, I've started working on some extension functions to enable something like:

response {
    card {
      title = "foo"
      subtitle = "bar"
      image {
        url ="http://foo.bar.com/"
        width = 320
        height = 320
      }
    }
  }

So Kotlin developers could benefit from the language nice DSL syntax. It's a good chunk of work, and I'd love to contribute, just want to make sure it's something you would be considering to accept before diving in and submitting a PR of this size.

Cheers

How to obtain a user ID and OAuth access token in Dialogflow

While I posted a comment on it here I still think there's an issue here as described in https://stackoverflow.com/questions/54871395/how-to-obtain-a-user-id-and-oauth-access-token-in-dialogflow.

Why should I be doing some coding acrobatics to get to accessToken, for example:

String accessToken = ((DialogflowRequest)request).getAogRequest().getUser().getAccessToken();

while the more straightforward methods advertised via the API don't work (always returning null):

String idToken = request.getUser().getIdToken();
		log.info("request.getUser().getIdToken()={}",idToken);

Ditto for other fields, i.e. userId, sessionId, isSigninGranted, etc.

Or, am I missing something?

Access google contacts for custom actions on google

How can I access google contacts of linked account on Google assistant. And after that how can I share that contact in parameters using dialogflow to the fulfillment.

Scenario : Using my action I want to send an information to the contact of user through SMS. How can we do that???

How to make a request to a REST service from within a Dialogflow intent

I am trying to make a request to a REST API from within my intent, but it always throws an error:

MalformedResponse: Failed to parse Dialogflow response into AppResponse because of empty speech response

I am using spring-framework RestTemplate to send the request as follows.

@ForIntent("process-greeting")
  public ActionResponse greetingProcessor(ActionRequest request) {
...
String givenName = (String) request.getParameter("given-name");
Greeting greeting = restTemplate.getForObject("https://fitzroi-rest-api-0525.appspot.com/rest/{name}", Greeting.class, givenName);
responseBuilder.add(greeting.getContent()); //this is a simple greeting like "Hello, Fitz"
}

Is this the right way to make a call to a REST service from within an Intent?
Also, how do I log custom error messages for debugging?

Support to Smart Home

Any plans to add support to smarthome Actions?
As Dialogflow and ActionsSDK, something like:

class MySmartHomeApp extends SmartHomeApp {

  @Override
  public CompletableFuture onSync(ActionRequest request) {
    // Handler for Smart Home intents implementation that will run when a SYNC request is received.
  }
}

Thank you!

Allow deserializing a request and serializing a response using streams

To avoid having to first create an intermediary JSON string it would be great if an InputStream/OutputStream could be used to parse requests and serialize responses. Seeing as you are using gson already it would likely be a minor change.

I'd be happy to open a PR if this is something you feel worth implementing.

Improve @ForIntent Annotation

Hi,

for the moment we can easily handle Intent by their name:
@ForIntent("Intent Name")

As we often use webhook call for slot filling, it could be interesting to add a second parameter to the annotation that would handle the corresponding slot filling.
For example :
@ForIntent("Intent Name", "Parameter Name")

For the moment as a workaround I do like this :

 // Choose between slot filling
List<Context> outputContexts = request.getWebhookRequest().getQueryResult().getOutputContexts();
Optional<Context> param = outputContexts.stream().filter(context -> context.getName().contains("intent_name_dialog_params")).findFirst();
if (param.isPresent()) {
     if (param.get().getName().contains("parameter_name")) {
          // do this ..
      } else {
          ...
      }
}

Regarding the 'NOT_FOUND: Requested Entity was not Found' error log

In my application, the device state change was reported to Google, and the program was working most of the time, but there were a few users whose devices reported their status and would throw [NOT_FOUND: Requested Entity was not found]. According to the error message, as if the device was not found (I'm not sure) ? Since I didn't receive a request from Google to unbind, I reported the device status as usual. And these devices can execute Query and Control instructions correctly.

What was the cause of the error? How do I fix it?

Caused by: io.grpc.StatusRuntimeException: NOT_FOUND: Requested entity was not found.
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:233) ~[grpc-stub-1.15.1.jar:1.15.1]
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:214) ~[grpc-stub-1.15.1.jar:1.15.1]
	at io.grpc.stub.ClientCalls.blockingUnaryCall$original$uyr4MtQf(ClientCalls.java:139) ~[grpc-stub-1.15.1.jar:1.15.1]
	at io.grpc.stub.ClientCalls.blockingUnaryCall$original$uyr4MtQf$accessor$XhDmMxbU(ClientCalls.java) ~[grpc-stub-1.15.1.jar:1.15.1]
	at io.grpc.stub.ClientCalls$auxiliary$TBZXSM5e.call(Unknown Source) ~[grpc-stub-1.15.1.jar:1.15.1]
	at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.StaticMethodsInter.intercept(StaticMethodsInter.java:86) ~[skywalking-agent.jar:6.3.0]
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java) ~[grpc-stub-1.15.1.jar:1.15.1]
	at com.google.home.graph.v1.HomeGraphApiServiceGrpc$HomeGraphApiServiceBlockingStub.reportStateAndNotification(HomeGraphApiServiceGrpc.java:425) ~[actions-on-google-1.8.0.jar:?]

I used the method SmartHomeApp.reportState in actions-on-google-1.5.0.jar to reported the status.

   /**
     * <pre>
     * Reports device state and optionally sends device notifications. Called by
     * an agent when the device state of a third-party changes or the agent wants
     * to send a notification about the device.
     * This method updates a predefined set of States for a device, which all
     * devices have (for example a light will have OnOff, Color, Brightness).
     * A new State may not be created and an INVALID_ARGUMENT code will be thrown
     * if so. It also optionally takes in a list of Notifications that may be
     * created, which are associated to this State change.
     * Third-party user's identity is passed in as agent_user_id.
     * Agent is identified by the JWT signed by the partner's service account.
     * </pre>
     */
    public com.google.home.graph.v1.HomeGraphApiServiceProto.ReportStateAndNotificationResponse reportStateAndNotification(com.google.home.graph.v1.HomeGraphApiServiceProto.ReportStateAndNotificationRequest request) {
      return blockingUnaryCall(
          getChannel(), METHOD_REPORT_STATE_AND_NOTIFICATION, getCallOptions(), request);
    }

Intermittent error while while calling reportState in Java

I get error while trying to call reportState in Java as below. Right now the code is being tested, hence the values are hard coded. Also the code to fetch the credential from a Json file is already done in another static block.

`

// Get service account key from file
Builder states = Struct.newBuilder();
states.putFields("on", com.google.protobuf.Value.newBuilder().setBoolValue(true).build());
states.putFields("brightness", com.google.protobuf.Value.newBuilder().setNumberValue(89).build());
com.google.protobuf.Value deviceStates = com.google.protobuf.Value.newBuilder().setStructValue(states).build();
Struct requestStates = Struct.newBuilder().putFields("deviceIdxxx", deviceStates).build();
ReportStateAndNotificationResponse response = mySmartHomeApp.reportState(ReportStateAndNotificationRequest
		.newBuilder().setRequestId(UUID.randomUUID().toString()).setAgentUserId("userIdxxx")
		.setPayload(StateAndNotificationPayload.newBuilder()
				.setDevices(ReportStateAndNotificationDevice.newBuilder().setStates(requestStates).build())
				.build())
		.build());

`

And the error is as shown below
ERROR 8167 --- [io-8080-exec-13] i.g.i.ManagedChannelOrphanWrapper : ~* Channel ManagedChannelImpl{logId=5, target=homegraph.googleapis.com} was not shutdown properly!!! *~
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.

java.lang.RuntimeException: ManagedChannel allocation site
at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.(ManagedChannelOrphanWrapper.java:103) ~[grpc-core-1.15.1.jar:1.15.1]
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:53) [grpc-core-1.15.1.jar:1.15.1]
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:44) [grpc-core-1.15.1.jar:1.15.1]
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:410) [grpc-core-1.15.1.jar:1.15.1]
at com.google.actions.api.smarthome.SmartHomeApp.reportState(SmartHomeApp.kt:126) [actions-on-google-1.8.0.jar:na]
at com.texa.texaiotlogging.integration.GoogleHomeService.onDeviceStateUpdated(GoogleHomeService.java:143) [classes/:0.0.1-SNAPSHOT]
at com.texa.texaiotlogging.integration.GoogleHomeService.sendChangeReport(GoogleHomeService.java:113) [classes/:0.0.1-SNAPSHOT]
at com.texa.texaiotlogging.integration.GoogleHomeService$$FastClassBySpringCGLIB$$9001fdc7.invoke() [classes/:0.0.1-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) [spring-aop-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) ~[spring-tx-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) [spring-aop-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at com.texa.texaiotlogging.integration.GoogleHomeService$$EnhancerBySpringCGLIB$$7ca41f9f.sendChangeReport() ~[classes/:0.0.1-SNAPSHOT]
at com.texa.texaiotlogging.TestController.sayHello(TestController.java:54) ~[classes/:0.0.1-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_141]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_141]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_141]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_141]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[servlet-api.jar:na]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.16]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.16]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.16]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.16]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.16]
at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:130) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:66) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:105) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:123) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.16]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[catalina.jar:8.5.16]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) ~[catalina.jar:8.5.16]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) ~[catalina.jar:8.5.16]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) ~[catalina.jar:8.5.16]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ~[catalina.jar:8.5.16]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[catalina.jar:8.5.16]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) ~[tomcat-coyote.jar:8.5.16]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-coyote.jar:8.5.16]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) ~[tomcat-coyote.jar:8.5.16]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) ~[tomcat-coyote.jar:8.5.16]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:8.5.16]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_141]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_141]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.16]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_141]

I am using the latest maven library 1.8.0.

DialogflowRequest is internal

Hi,

In the README file it states you can create an ActionRequest from a raw json.
I looked in the samples and found how:

@Throws(IOException::class)
private fun fromFile(file: String): DialogflowRequest {
    val absolutePath = Paths.get("src", "test", "resources",
            file)
    val gson = Gson()
    val reader = Files.newBufferedReader(absolutePath)
    val json = gson.fromJson(reader, JsonObject::class.java)

    return DialogflowRequest.create(json, null)
}

However when I try this import it seems the DialogflowRequest is internal?
What am I missing?
How can you create an ActionRequest from a raw JSON?

Screenshot from 2019-05-15 17-50-13

Thanks

Problem with custom Payload

Hello,

We use your library to interpret the request Dialogflow sends when a particular Intent is invoked.
But we have a problem, in the ActionRequest object there is an array of objects FulfillmentMessages. This array unfortunately always results NULL even if actually from dialogflow is sent.
For example if I print the request that comes intercepted from the doPost the field comes populated but during the conversion to ActionRequest Object it is lost.
Can you help us?

How to programmatically fetch parameter from a parent intent for use in a follow-up intent

What is the best way to retrieve a parameter from a parent context for use in a follow-up intent in actions-on-google?
The DialogFlow documentation shows how to retrieve a parameter manually (https://dialogflow.com/docs/contexts/input-output-contexts), but I would like to access a parameter at a certain depth/lifespan within a series of follow-up intents.
For example, I have tried something like the following, but it doesn't work.

@ForIntent("third-context-followup")
   public ActionResponse myIntent(ActionRequest request) {
String param1 = (String) request.getParameter("second-custom-followup.param");
String param2 = (String) request.getParameter("first-context.second-custom-followup.param");
...
}

sync response report error with customData string

gcp error log,when use actions-on-google build response,the customData parameter only can be set to String or JSONObject,can't set to a map:
{
insertId: "18ele3sg4g4ys72"
logName: ""
receiveTimestamp: "2019-08-02T02:45:43.962689625Z"
resource: {
labels: {
action_id: "SMART_HOME_SYNC"
project_id: "
*"
version_id: ""
}
type: "assistant_action"
}
severity: "ERROR"
textPayload: "SYNC: Request ID 14473429503853394047 update devices failed: INVALID_ARGUMENT. Detail: Error: [Expect a map object but found: "{"on":"corridor_light_status","brightness":"brightness_level","color":"argb_value"}"] while parsing JSON [{"payload":{"agentUserId":"708039437023605410076199124993","devices":[{"attributes":

{"colorModel":"rgb"},"customData":"{"on":"corridor_light_status","brightness":"brightness_level","color":"argb_value"}","deviceInfo":{"hwVersion":"1.0","manufacturer":"Aqara","model":"lumi.gateway.aqhm01","swVersion":"1.0"},"id":"***,"name":{"defaultNames":["Light"],"name":"GateWay Light","nicknames":["Light"]},"traits":["action.devices.traits.OnOff","action.devices.traits.Brightness","action.devices.traits.ColorSetting"],"type":"action.devices.types.LIGHT","willReportState":true}]},"requestId":"14473429503853394047"}]"
timestamp: "2019-08-02T02:45:43.939331180Z"
}

Cannot add custom payload for integrations

Hi,
I tried to use this lib to handle fulfillment requests and respond with custom payload for my Dialogflow integrations. ex: Slack integration
I tried to use the WebhookResponse object and it's setPayload method to achieve this.
However when the ResponseBuilder.build method is called and the ActionResponse is converted into JSON the payload that I previously set is replaced with a google one. 'payload': {'google': { ... }}

Is there a way to construct responses for integrations with this lib?

I tried even the simplest use case when I add only a text with the ResponseBuilder but the message won't show up in Slack.

UserId is not present in AogRequest

Is there a reason why the userId property is never deserialized? I was hoping to use the userId from a payload to index data that may come from different users of the action.

Or maybe I'm missing something from actions on google and we should not use userIds at all

Regards

listSelect Issue

I have an issue with action_on_google (for java) and listSelect

Here it is the following response :

{
  "fulfillmentMessages": [
    {
      "text": {
        "text": [
          "Quel modèle souhaitez vous essayer ?"
        ]
      }
    },
    {
      "card": {
        "buttons": [
          {
            "postback": "3",
            "text": "A1"
          }
        ],
        "imageUri": "https://v5vr71p4qu4bsqoc.khrqkfqsdjw4wrbz.v1.p.beameio.net/bot/testdrive/1/3/photo",
        "subtitle": "Top niveau",
        "title": "Audi A1"
      }
    },
    {
      "card": {
        "buttons": [
          {
            "postback": "1",
            "text": "A7"
          }
        ],
        "imageUri": "https://v5vr71p4qu4bsqoc.khrqkfqsdjw4wrbz.v1.p.beameio.net/bot/testdrive/1/1/photo",
        "subtitle": "Mega niveau",
        "title": "Audi A7"
      }
    },
    {
      "card": {
        "buttons": [
          {
            "postback": "2",
            "text": "E-TRON"
          }
        ],
        "imageUri": "https://v5vr71p4qu4bsqoc.khrqkfqsdjw4wrbz.v1.p.beameio.net/bot/testdrive/1/2/photo",
        "subtitle": "Top Elec",
        "title": "Audi E-TRON"
      }
    }
  ],
  "fulfillmentText": "Quel modèle souhaitez vous essayer ?",
  "outputContexts": [
    {
      "lifespanCount": 99,
      "name": "projects/chainly-automotive-glytsi/agent/sessions/ABwppHHHCQcknDaavS19UW6wZaNy95LRPvSz_7actIdFNo6aE5CIx3fEKXW4KiB4MOaZSWutved52wWCt9SWkfFQZWK6nuOo6w/contexts/_actions_on_google",
      "parameters": {
        "data": "{}"
      }
    }
  ],
  "payload": {
    "google": {
      "expectUserResponse": true,
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "Quel modèle souhaitez vous essayer ?"
            }
          }
        ]
      },
      "isSsml": false,
      "systemIntent": {
        "intent": "actions.intent.OPTION",
        "data": {
          "listSelect": {
            "items": [
              {
                "description": "Top niveau",
                "image": {
                  "accessibilityText": "A1",
                  "url": "https://v5vr71p4qu4bsqoc.khrqkfqsdjw4wrbz.v1.p.beameio.net/bot/testdrive/1/3/photo"
                },
                "optionInfo": {
                  "key": "3",
                  "synonyms": [
                    "A1",
                    "Audi A1"
                  ]
                },
                "title": "Audi A1"
              },
              {
                "description": "Mega niveau",
                "image": {
                  "accessibilityText": "A7",
                  "url": "https://v5vr71p4qu4bsqoc.khrqkfqsdjw4wrbz.v1.p.beameio.net/bot/testdrive/1/1/photo"
                },
                "optionInfo": {
                  "key": "1",
                  "synonyms": [
                    "A7",
                    "Audi A7"
                  ]
                },
                "title": "Audi A7"
              },
              {
                "description": "Top Elec",
                "image": {
                  "accessibilityText": "E-TRON",
                  "url": "https://v5vr71p4qu4bsqoc.khrqkfqsdjw4wrbz.v1.p.beameio.net/bot/testdrive/1/2/photo"
                },
                "optionInfo": {
                  "key": "2",
                  "synonyms": [
                    "E-TRON",
                    "Audi E-TRON"
                  ]
                },
                "title": "Audi E-TRON"
              }
            ],
            "title": "Title list"
          },
          "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec"
        }
      },
      "userStorage": "{\"data\":{}}"
    }
  }
}

The fullfilmentMessage works fine with FB and other text based messenger, but the counterpart with google assistant just display the SimpleResponse and does not display the listSelect.
The log does not provides any error.

ResponseItems automated sorting after building a response

There is a requirement of Action on Google that richResponse must have SimpleResponse as first item of an Items array.

But in the app you can provide different way to implement this array and there is no way to sort it manually, because that property is internal:

internal var responseItems: MutableList<RichResponseItem> = ArrayList()

So you have to create your fulfillment logic in the certain way, which is not really great. It would be nice if after building response there was a sorting to set the SimpleResponse as a first response as it is in requirements.

SmartHomeApp.reportState error

Is this error below because the grpc-core version is too low?

io.grpc.internal.ManagedChannelOrphanWrapper line:163 -*~*~*~ Channel ManagedChannelImpl{logId=144961, target=homegraph.googleapis.com} was not shutdown properly!!! ~*~*~*
    Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
	at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:103) [grpc-core-1.15.1.jar:1.15.1]
	at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53) [grpc-core-1.15.1.jar:1.15.1]
	at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44) [grpc-core-1.15.1.jar:1.15.1]
	at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:410) [grpc-core-1.15.1.jar:1.15.1]
	at com.google.actions.api.smarthome.SmartHomeApp.reportState(SmartHomeApp.kt:126) [actions-on-google-1.5.0.jar:?] 

roomHint is not contained in response

kotlin application, actions-on-google version 1.7.0

roomHint is set with devicebuilder
val deviceBuilder = SyncResponse.Payload.Device.Builder() .setId(it.name) .setOtherDeviceIds(Collections.singletonList(otherDeviceIds)) .setName(name) .setType(type) .setDeviceInfo(info) .setRoomHint(roomHint) .setTraits(traits) .setAttributes(attributes) .setCustomData(customData) .setWillReportState(true)

json string is received with
val result = assistantApp.handleRequest(body, headerMap).get()

the roomHint is missing in the json string

Support noInputPrompts

As of version 1.8.0 noInputPrompts is not supported. There is a field in DialogflowGooglePayload declared for it but it is never used. This is important for us to be able to migrate away from our own SDK.

Add Session Entities

Hi,

Historically, sessions entities were managed from the dialogflow API, now they can be created directly in the webhook :
https://groups.google.com/forum/#!msg/dialogflow-enterprise-edition-users/K-wSIgRyT90/-BkkFYLfAgAJ

In order to simplify session entity building could you had the same model as availlable with google-cloud-dialogflow (https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-dialogflow) :

It concerns the SessionEntityType class.

Then once builded it can be added to the webhook response like this :

        SessionEntityType sessionEntityType = SessionEntityType.newBuilder()
                .setEntityOverrideMode(SessionEntityType.EntityOverrideMode.ENTITY_OVERRIDE_MODE_OVERRIDE)
                .setName(sessionId + "/entityTypes/" + entityName)
                .addAllEntities(entities)
                .build();

            responseBuilder.setWebhookResponse$actions_on_google(
                    Optional.ofNullable(responseBuilder.getWebhookResponse$actions_on_google())
                            .orElse(new WebhookResponse())
                            .set("sessionEntityTypes", Lists.newArrayList(sessionEntityType))
            );

Not able play video from hls direact link into chromecast using google smart home action

I am using google action sample code for camera stream to Chromecast
Here is my code

public class MySmartHomeApp extends SmartHomeApp {

private static final Logger LOGGER = LoggerFactory.getLogger(MySmartHomeApp.class);

@NotNull
@OverRide
public SyncResponse onSync(@NotNull SyncRequest syncRequest, @nullable Map headers) {
SyncResponse.Payload payload = new SyncResponse.Payload();
payload.setAgentUserId("1836.15267389");
payload.setDevices(
new SyncResponse.Payload.Device[] {
new SyncResponse.Payload.Device.Builder()
.setId("5e0f5d1820a57b00113d7a7c")
.setType("action.devices.types.CAMERA")
.addTrait("action.devices.traits.CameraStream")
.setName(
Collections.singletonList("Sirius Corporation 3000"),
"living room camera",
Collections.singletonList("Camera"))
.setWillReportState(false)
.setAttributes(
new JSONObject()
.put("cameraStreamSupportedProtocols", new String[] {"hls"})
//.put("cameraStreamNeedAuthToken", true)
// .put("cameraStreamNeedDrmEncryption", true)
)
.setDeviceInfo("blinds manufacturer", "xyz", "3.2", "11.4")
.build()
});
return new SyncResponse(syncRequest.getRequestId(), payload);
}

@NotNull
@OverRide
public ExecuteResponse onExecute(
@NotNull ExecuteRequest executeRequest, @nullable Map map) {
ExecuteResponse.Payload payload = new ExecuteResponse.Payload();
payload.setCommands(
new ExecuteResponse.Payload.Commands[] {
new ExecuteResponse.Payload.Commands(
new String[] {"5e0f5d1820a57b00113d7a7c"},
"SUCCESS",
new HashMap<String, Object>() {
{
put("cameraStreamAccessUrl", "https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8");
//put("cameraStreamReceiverAppId", "1g2f89213hg");
//put("cameraStreamAuthToken", "12657342190192783");
}
},
null,
null)
});
return new ExecuteResponse(executeRequest.getRequestId(), payload);
}

@NotNull
@OverRide
public void onDisconnect(DisconnectRequest disconnectRequest, Map headers) {
String token = (String) headers.get("authorization");

}
}

using this code I am able to sync my camera device to google home app and I am able to send a command to the camera to stream data from HLS URL to my Chromecast device
show living room camera to my bedroom tv(Chromecast)

In my application log, I am able to see that execute command starting the stream.
issue: I am not able to see the stream on TV it's displaying "smart home camera" not able to view the stream.
am I missing something in my code to make HLS direct link to compatible with Chromecast? or what is the issue ?

I will be glad if I get some solution to make it work

Application Log
145 [main] INFO XXXX.Server - server started...
88228 [Thread-2] INFO XXXX.Serverr$XXXXHandler - Serving the request with request methodPOST
88229 [Thread-2] INFO XXXX.ServerXXXXHandler - POST request process starts here...
88315 [Thread-2] INFO XXXX.Server$XXXXHandler - Body Input:{"inputs":[{"context":{"locale_country":"US","locale_language":"en"},"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"id":"5e0f5d1820a57b00113d7a7c"}],"execution":[{"command":"action.devices.commands.GetCameraStream","params":{"StreamToChromecast":true,"SupportedStreamProtocols":["progressive_mp4","hls","dash","smooth_stream"]}}]}]}}],"requestId":"16858408752476564434"}
89230 [Thread-2] INFO XXXX.Server$XXXXHandler - {"payload":{"commands":[{"ids":["5e0f5d1820a57b00113d7a7c"],"status":"SUCCESS","states":{"cameraStreamAccessUrl":"https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"}}]},"requestId":"16858408752476564434"}

UserStorage is not filled in the internal constructor of AogRequest

For example in MockRequestBuilder a build() method sets user field of appRequest and creates aogRequest out of it:

...
if (userStorage != null) {
    user.userStorage = gson.toJson(userStorage)
}
appRequest.user = user
...
val aogRequest = AogRequest(appRequest)
...

But inside internal constructor of AogRequest userStorage field is not set at all, only user.userStorage does:

internal class AogRequest internal constructor(
        override val appRequest: AppRequest) : ActionRequest {
    ...
    override var userStorage: MutableMap<String, Any> = HashMap()
    ...
    override val user: User? get() = appRequest.user
    ...
}

So, if we try in a test to set this userStorage, the field will be empty:

@Test
fun userStorageTest() {
    val actionRequest = MockRequestBuilder()
        .setUserStorage(mapOf(Pair("userId", "someId")))
        .build()
    println("userStorage = ${actionRequest.userStorage}")
    println("user.userStorage = ${actionRequest.user?.userStorage}")
}

the output will be:

userStorage = {}
user.userStorage = {"userId":"someId"}

Boilerplate readme link is broken

Within the readme, there are references to:

https://github.com/actions-on-google/boilerplate-java

which 404, and should likely be:

https://github.com/actions-on-google/dialogflow-webhook-boilerplate-java

I can PR if desirable.

Unable to modify conversationData, userStorage values in Kotlin

conversationData and userStorage are immutable values and cannot be changed using kotlin.
For now there is no option to modify this! One of possible solution is to override getResponseBuilder in DialogflowApp and construct own ResponseBuilder with custom data BUT ResponseBuilder is internal class.
Someone already noticed that in other task few months ago and you didn't fixed it yet.
Please fix this!

How to enrich messages with content?

I have a Dropwizard application configured. The endpoint is configured as follows:

image

My app:
image

I want to create personalized experience for the authenticated user but I cannot pass the user to the @ForIntent method for obvious reasons.

In order to solve this I'm required to create an instance per request/user however that feels like bad practice.

How do I use this library with my use case?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.