dialogflow-android-client icon indicating copy to clipboard operation
dialogflow-android-client copied to clipboard

I am setting the session id in AIRequest object but its giving some other session id in response

Open SidCosineLabs opened this issue 8 years ago • 10 comments

      `AIRequest request = new AIRequest();

       request.setQuery(message);

       request.setSessionId(MyData.getInstance(MyApplication.getInstance()).getGatewayId() + "_" +
               MyData.getInstance(MyApplication.getInstance()).getUsername());

       return aiService.textRequest(request);`

and when i get AIResponse object it gives me some different session id. How can i set my custom session id for a particular user.

SidCosineLabs avatar Jul 06 '17 11:07 SidCosineLabs

You may try to build Java client library from the "sessionid-workaround" branch:

git clone -b sessionid-workaround https://github.com/api-ai/apiai-java-client.git
cd apiai-java-client/
mvn install

then clean and rebuild your Android project and try again.

folomeev avatar Jul 08 '17 08:07 folomeev

I am already using the libai-1.4.9 after building it using mvn and installed it in my android project as module dependency

I am using two dependency compile project(':libai-1.4.9') and compile 'ai.api:sdk:2.0.6@aar'

Now what to do?

On Sat, Jul 8, 2017 at 2:29 PM, folomeev [email protected] wrote:

You may try to build Java client library from the "sessionid-workaround" branch:

git clone -b sessionid-workaround https://github.com/api-ai/apiai-java-client.gitcd apiai-java-client/ mvn install

then clean and rebuild your Android project and try again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/api-ai/apiai-android-client/issues/48#issuecomment-313844088, or mute the thread https://github.com/notifications/unsubscribe-auth/AbKcR8JAQcHDoRA2qC4Kh4ATaqt0Hztgks5sL0TYgaJpZM4OPetO .

-- Siddhant Panhalkar Senior Android Developer Cosine Labs https://cosinelabs.com/

SidCosineLabs avatar Jul 08 '17 09:07 SidCosineLabs

  1. Checkout libai source from sessionid-workaround branch
  2. It will bring you libai-1.5.10 sources
  3. Build it and install into your local repository using mvn
  4. Change dependency version in the Android project from 1.4.9 to 1.5.10
  5. Clean and rebuild Android project

folomeev avatar Jul 08 '17 09:07 folomeev

Thanks for the help, there are two dependency that i got one is libai-1.5.10 sources.jar and other is libai-1.5.10.jar which one to use

On Sat, Jul 8, 2017 at 3:23 PM, folomeev [email protected] wrote:

  1. Checkout libai source from sessionid-workaround branch
  2. It will bring you libai-1.5.10 sources
  3. Build it and install into your local repository using mvn
  4. Change dependency version in the Android project from 1.4.9 to 1.5.10
  5. Clean and rebuild Android project

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/api-ai/apiai-android-client/issues/48#issuecomment-313846287, or mute the thread https://github.com/notifications/unsubscribe-auth/AbKcRw8FkB9WsEt7NDOw6pouRBrzNIkrks5sL1GWgaJpZM4OPetO .

-- Siddhant Panhalkar Senior Android Developer Cosine Labs https://cosinelabs.com/

SidCosineLabs avatar Jul 08 '17 13:07 SidCosineLabs

I am using libai-1.5.10.jar and i am getting this error java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory while initialising AIService object

On Sat, Jul 8, 2017 at 6:43 PM, Siddhant Panhalkar < [email protected]> wrote:

Thanks for the help, there are two dependency that i got one is libai-1.5.10 sources.jar and other is libai-1.5.10.jar which one to use

On Sat, Jul 8, 2017 at 3:23 PM, folomeev [email protected] wrote:

  1. Checkout libai source from sessionid-workaround branch
  2. It will bring you libai-1.5.10 sources
  3. Build it and install into your local repository using mvn
  4. Change dependency version in the Android project from 1.4.9 to 1.5.10
  5. Clean and rebuild Android project

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/api-ai/apiai-android-client/issues/48#issuecomment-313846287, or mute the thread https://github.com/notifications/unsubscribe-auth/AbKcRw8FkB9WsEt7NDOw6pouRBrzNIkrks5sL1GWgaJpZM4OPetO .

-- Siddhant Panhalkar Senior Android Developer Cosine Labs https://cosinelabs.com/

-- Siddhant Panhalkar Senior Android Developer Cosine Labs https://cosinelabs.com/

SidCosineLabs avatar Jul 08 '17 13:07 SidCosineLabs

Try to add to dependency:

compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.1'

folomeev avatar Jul 08 '17 18:07 folomeev

Hi, I did all these things with the updated library but still i am getting unauthenticated request. Any thing that I can do to fix this. Thanks

On Sat, Jul 8, 2017 at 11:50 PM, folomeev [email protected] wrote:

Try to add to dependency:

compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' compile group: 'com.google.code.gson', name: 'gson', version: '2.8.1'

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/api-ai/apiai-android-client/issues/48#issuecomment-313872856, or mute the thread https://github.com/notifications/unsubscribe-auth/AbKcR9xS2J4RgGSVQI002M_L7NMULE_Pks5sL8h8gaJpZM4OPetO .

-- Siddhant Panhalkar Senior Android Developer Cosine Labs https://cosinelabs.com/

SidCosineLabs avatar Jul 10 '17 09:07 SidCosineLabs

Hi, I am using api.ai speech recogniser so could you please tell me how can I set the session Id in this request, below is my code that I am using. I am using AIService startlistening method. Please let me know how can i do it.

final List<AIContext> contexts = Collections.singletonList(new AIContext (MyData.getInstance(MyApplication.getInstance()).getGatewayId() + "_" + MyData.getInstance(MyApplication.getInstance()).getUsername())); final RequestExtras requestExtras = new RequestExtras(contexts, null); aiService.startListening(requestExtras);

Thanks

On Mon, Jul 10, 2017 at 2:55 PM, Siddhant Panhalkar < [email protected]> wrote:

Hi, I did all these things with the updated library but still i am getting unauthenticated request. Any thing that I can do to fix this. Thanks

On Sat, Jul 8, 2017 at 11:50 PM, folomeev [email protected] wrote:

Try to add to dependency:

compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' compile group: 'com.google.code.gson', name: 'gson', version: '2.8.1'

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/api-ai/apiai-android-client/issues/48#issuecomment-313872856, or mute the thread https://github.com/notifications/unsubscribe-auth/AbKcR9xS2J4RgGSVQI002M_L7NMULE_Pks5sL8h8gaJpZM4OPetO .

-- Siddhant Panhalkar Senior Android Developer Cosine Labs https://cosinelabs.com/

-- Siddhant Panhalkar Senior Android Developer Cosine Labs https://cosinelabs.com/

SidCosineLabs avatar Jul 11 '17 07:07 SidCosineLabs

Please update your reference up to latest release (compile 'ai.api:sdk:2.0.7@aar') and run again the code you gave in first comment.

folomeev avatar Jul 20 '17 16:07 folomeev

@folomeev I tried your solution.Not able to change the session ID. Did anybody find a solution?

saurabharas avatar Aug 25 '17 12:08 saurabharas