Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

debug_config availability in google-assistant-grpc python library #288

Open
dmarvp opened this issue Aug 24, 2018 · 10 comments · May be fixed by #291
Open

debug_config availability in google-assistant-grpc python library #288

dmarvp opened this issue Aug 24, 2018 · 10 comments · May be fixed by #291

Comments

@dmarvp
Copy link

dmarvp commented Aug 24, 2018

I get this error when trying to use the debug_config property on AssistConfig.

  File "/opt/virtual-device/lib/google_assistant.py", line 80, in assist
    for resp in assist_responses_generator:
  File "/usr/lib64/python2.7/site-packages/grpc/_channel.py", line 348, in next
    return self._next()
  File "/usr/lib64/python2.7/site-packages/grpc/_channel.py", line 328, in _next
    raise self
_Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "Exception iterating requests!"
	debug_error_string = "None"
>

Here's the code where I try to set it up

from google.assistant.embedded.v1alpha2.embedded_assistant_pb2 import *
from google.assistant.embedded.v1alpha2.embedded_assistant_pb2_grpc import *

def assist_audio_requests_generator(self, message, language_code, voice_id,
                                        new_conversation):
        yield AssistRequest(
            config=AssistConfig(
                audio_in_config=AudioInConfig(
                    encoding='LINEAR16', sample_rate_hertz=16000),
                screen_out_config=ScreenOutConfig(
                    screen_mode='OFF'),  #or PLAYING
                device_config=DeviceConfig(
                    device_id=self.user.user_id,
                    device_model_id="my_device_model_id"), 
                audio_out_config=AudioOutConfig(
                    encoding='LINEAR16',
                    sample_rate_hertz=16000,
                ),
                dialog_state_in=DialogStateIn(
                    language_code=language_code,
                    is_new_conversation=new_conversation),
                debug_config=DebugConfig(
                    return_debug_info=True
                )
                ))

It works correctly if I remove the debug_config property. Is it not available in version 0.2.0 of the python library? I've tried both with that version as well as 0.2.1.dev1 without success. If so, is there a planned release of the python library coming soon?

@Fleker
Copy link
Contributor

Fleker commented Aug 25, 2018

Yeah, it does seem like this flag is not in the current generated code, probably as it's from an older proto. It's really only useful in conjunction with Actions on Google, so it hasn't been a priority to include in Python.

@dmarvp
Copy link
Author

dmarvp commented Aug 27, 2018

hey @Fleker thanks for the response!

I need this because I would like to get better-structured information coming from the cards, which I know are in that json. Is there a new version of the python library planned?

FYI I would like to access card information like you do here with your AssistResponse class and the cards object:
https://github.com/actions-on-google/actions-on-google-testing-nodejs#possible-responses

I just realized you are a contributor in both repositories, so hopefully, you can help me out.

@Fleker
Copy link
Contributor

Fleker commented Aug 28, 2018

Yeah it's just a matter of updating the Python bindings that are based on the gRPC protobuf. You can do it right now technically using a protobuf code gen, though to add it here it should also be fairly straightforward.

@proppy
Copy link
Contributor

proppy commented Aug 30, 2018

@dmarvp actually we released a pre-version with that fields a few months ago:
https://pypi.python.org/pypi/google-assistant-grpc/0.2.1.dev1

You should be able to install it with:

pip install --pre --upgrade google-assistant-grpc

Looking forward your feedback!

@dmarvp
Copy link
Author

dmarvp commented Sep 5, 2018

hi @proppy I actually did install that version before opening the ticket. I tried again just now to be sure and, for both for python 2.7 and 3.6, I took a look at the "embedded_assistant_pb2.py" file. Sadly, the debug_info field is not in there.

@proppy proppy linked a pull request Sep 5, 2018 that will close this issue
@proppy
Copy link
Contributor

proppy commented Sep 5, 2018

@dmarvp you're right!

This should be fixed with: #291

You can try it with:

pip install 'git+https://github.com/proppy/assistant-sdk-python.git@debug-info#egg=google-assistant-grpc&subdirectory=google-assistant-grpc'

See:

>>> import google.assistant.embedded.v1alpha2.embedded_assistant_pb2
>>> google.assistant.embedded.v1alpha2.embedded_assistant_pb2.AssistConfig().debug_config is None
False

@mahmeds7777
Copy link

I'm getting the same here when attempting to pass debug_config in google assistant-grpc python library. any workarounds or updates for this please?

@dmarvp
Copy link
Author

dmarvp commented Jan 30, 2020

hi @proppy and @Fleker , the fix on #291 had been working for us since Sep 2018, however, the debug_info has stopped returning anything in the last few days. It comes empty now. I was wondering if there have been changes in the assistant services that are causing this? As you know, we work with companies that rely on google assistant for testing their own actions and this is affecting their existing tests.

@proppy
Copy link
Contributor

proppy commented Jan 31, 2020

@dmarvp which version of the API are you using?

@dmarvp
Copy link
Author

dmarvp commented Jan 31, 2020

hi @proppy, I'm using v1alpha2 with the library from your comment on September 5, 2018.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants