Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

un-converatble datatype in flows - class 'google.cloud.dialogflowcx_v3beta1.types.page.TransitionRoute' #194

Open
devyanil16 opened this issue Jun 20, 2024 · 1 comment
Assignees

Comments

@devyanil16
Copy link

devyanil16 commented Jun 20, 2024

https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/8a229db34ea613443040a2ca2cb45ff590452169/examples/bot_building_series/bot_building_101.py#L85C5-L85C5
(use case - create agent,
add pages, flow, intents
update present flows with intents and route flows to new page)

hi! the data type of my_tr does not match with dsf.transition_routes

my_tr data type - <class 'google.cloud.dialogflowcx_v3beta1.types.flow.Flow'>
dsf (target) - <class 'google.cloud.dialogflowcx_v3beta1.types.page.TransitionRoute'>
(is it possible to convert these to class <class 'google.protobuf.pyext._message.RepeatedCompositeContainer'>??)

How to append the data types? also if you could give any example for such use case, would be great.

error -
image

steps to reproduce - https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/bot_building_series/bot_building_101.ipynb

@kmaphoenix
Copy link
Member

@devyanil16 thanks for submitting this issue!

I've just stepped through the Bot Building 101 series notebook and did not have any issues.
You can see here that the Transition Route and Flow were updated properly:
image

When you encountered the issue, where you using the .py version or the .ipynb version?
The errors suggests that you might have tried to build the TransitionRoute directly from the base class imports, but I'm not 100% sure from just the error screenshot.

This notebook is quite old actually (3+ years?), and it could definitely use an update.
Since then, we've released some better Builder classes that I would suggest using instead.
These provide a much more simple way to build your proto objects directly, then push them to your Agent when ready.
Take a look at this Builders notebook for examples on how to use them.

@kmaphoenix kmaphoenix self-assigned this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants