Dfcx-scrapi

Latest version: v1.13.1

Safety actively analyzes 715032 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 7

1.6.0

New Features
Github Actions - PyLint
Way overdue, but we finally have [automated linting](https://github.com/GoogleCloudPlatform/dfcx-scrapi/actions/workflows/linter.yml) for feature branches and PRs to `main`!
This should help expedite the review process and generally provide some good code hygiene across all PRs.

Builders
Added [7 new Builder Classes](https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/107)!

These will help round out the Builder classes and provide all of the functional building blocks for Flows, Pages, Transition Routes, and Fulfillments.

Happy Building! πŸ˜„ πŸ—οΈ

Enhancements
- [Pages.get_pages_map](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/core/pages.py#L80) now generates the Page Display Names and IDs for the reserved "special" pages in Dialogflow CX (i.e. `END_SESSION`, `START_PAGE`, and `END_FLOW`)
- Added [Pages.delete_page](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/core/pages.py#L228)
- Added [Flows.create_flow](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/core/flows.py#L229)
- Updates to [CopyUtil](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/copy_util.py) to support Route Groups

Notebooks
- [copy_paste_pages.ipynb](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/copy_paste_series/copy_paste_pages.ipynb) updated to include recent changes to `CopyUtil`

Bug Fixes
- Fixed a bug in `ScrapiBase.parse_resource_path` that was causing Page IDs to not be parsed correctly
- Fixed missing `__init__.py` file in `agent_assist` folder
- Fixed issue causing some resource create methods to not honor the incoming kwargs or proto object provided
- This affected the `create_x` methods in `agents`, `entity_types` and `intents`
- Fixed an issue in [CopyUtil](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/copy_util.py) where some copy functions would fail due to missing Flow resources in Flows map.
- Fixed a bug in `conversation.py` where a new match type for `KNOWLEDGE_CONNECTOR` was not being handled

Misc
- Lots of refactor and linting across all files
- Updates to copyright dates
- Fixed typo in `nlu_util` ValueError message

---

What's Changed
* update regex for page validation by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/92
* Small Enhancement to Pages Map by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/90
* Adding init file in the agent assist folder by hkhaitan1 in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/89
* Patch/create flow by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/96
* Feature/workflows by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/100
* Patch/workflows update by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/101
* Patch/core create refactor by MRyderOC in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/88
* Feature/copy util update by SeanScripts in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/97
* Adding a new match type for knowledge connector by mejindal in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/102
* Feature/builders by MRyderOC in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/107
* remove typo by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/109

New Contributors
* mejindal made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/102

**Full Changelog**: https://github.com/GoogleCloudPlatform/dfcx-scrapi/compare/1.5.1...1.6.0

1.5.1

Bug Fixes
* Fixed import typo in NLU Analysis notebook 😁

**Full Changelog**: https://github.com/GoogleCloudPlatform/dfcx-scrapi/compare/1.5.0...1.5.1

1.5.0

New Features
Builder Classes
In this release, we're introducing a new concept called `Builders`. πŸ‘·πŸΌβ€β™‚οΈπŸ— πŸ› 

**Motivation:**
All Dialogflow CX resources are built as [Protocol Buffers](https://developers.google.com/protocol-buffers) or "protos" for short. When you call `get_agent` or `get_intent`, you're receiving that resource as an `Agent Proto` or `Intent Proto` that you can then manipulate, edit, and push back to Dialogflow CX.
Protos can contain other protos. Protos can be difficult to work with at times!
We built this class to simplify working with Protos!

Each Builder class offers a set of CRUD functions that can be performed **_100% offline_**, without any calls to the Dialogflow CX APIs.
This allows you to programmatically build 100's or 1000's of resources offline, iterate, experiment, and perfect until you're ready to actually push them to your Dialogflow CX Agent via the SCRAPI `core` classes.

We've even included a [Builders 101 Colab Notebook](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/bot_building_series/builders_101.ipynb) to kickstart your Builders journey!

Happy Building! πŸ˜„ πŸ—οΈ

---

NLU Utils - Semantic Similarity and Clustering
We've introduced a new [NaturalLanguageUnderstandingUtil](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/nlu_util.py) Class that is packed full of some amazing NLU Analysis tools to supercharge your bot tuning workflows. Powered by [Tensorflow](https://www.tensorflow.org/), [1][USEv4](https://tfhub.dev/google/universal-sentence-encoder/4), and [2][ScaNN](https://github.com/google-research/google-research/tree/master/scann), the class includes analysis methods to perform the following tasks:

* Identifying Conflicting Training Phrases Across Intents
* Finding the Most Similar Training Phrases for a Provided Set of Utterances
* Clustering Utterances that Don't Match Training Phrases

We've provided an [NLU Analysis](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/nlu_analysis_series/nlu_semantic_similarity_demo.ipynb) notebook that allows you to dive right in and start using these features with your Dialogflow CX Agents.

[1] [USEv4]() provides us with high quality embeddings that we can utilize for performing Semantic Similarity and Classification tasks.

![image](https://user-images.githubusercontent.com/13949241/193182407-abfde7a4-45e5-4bce-ac31-1b84daeb39e6.png)

![image](https://user-images.githubusercontent.com/13949241/193182570-55b89ea7-9669-4957-8af2-820b54ec6ddc.png)

[2] The [Scalable Nearest Neighbors (ScaNN)](https://github.com/google-research/google-research/tree/master/scann) method from Google Research team provides us with SOTA performance clustering.

![image](https://user-images.githubusercontent.com/13949241/193182945-e08b4e2e-8122-4d61-90bc-f0a782ca3b85.png)

---

Agent Assist
We're _super excited_ to announce the release of our `Agent Assist` class! This is our first non-DFCX class to make it into the library as well. After careful consideration, we realized that there are many `CCAI Ecosystem` APIs that a typical bot developer might need to access that are immediately adjacent to Dialogflow CX. The Agent Assist APIs are used heavily in conjunction with DFCX APIs, so it was a logical choice for us to include them.

With the new Agent Assist class, you can perform several functions like:
* CRUD operations for Conversation Profiles
* Extremely useful if you're using [AnalyzeContent](https://cloud.google.com/dialogflow/es/docs/reference/rest/v2beta1/projects.conversations.participants/analyzeContent)
* CRUD operations on Participants
* Creating and Completing Conversations

We'll continue to build out this class to include other AA features like Smart Reply, FAQ Suggestion, and Article Suggestion over time.
You can find the top level folder `agent_assist` adjacent to the `dfcx_scrapi` folder.

---

Session Entity Types
If you're familiar with [System Entity Types](https://cloud.google.com/dialogflow/cx/docs/concept/entity-system) and [Custom Entity Types](https://cloud.google.com/dialogflow/cx/docs/concept/entity-custom) but haven't used [Session Entity Types](https://cloud.google.com/dialogflow/cx/docs/concept/entity-session) yet, then you're in for a treat! 🍬
Session Entity Types are a powerful way to enhance your bot's NLU capabilities at a very granular level - Session by Session. Unlike System and Custom Entity Types which can only be modified during _Design Time_, Session Entity Types can be modified dynamically _during Runtime_.

Once you've instantiated a user Session, you can call the Session Entity Types API to create _Session specific entity types_ that have a TTL for the length of the active Session.

This allows you to handle use cases like:
* Loading user-specific data into a session for NLU recognition
* Performing Entity Expansion on existing Entity Types based on user feedback _during the conversation_
* Overwriting existing Entity Types for a single user session

---

Enhancements
Intents to DataFrame Transposed
We've introduced a new `Intents` method that allows you to export your Intents / Training Phrases transposed from what the normal export achieves. Typically the data is exported row by row like this:

| intent | training_phrase|
|---|---|
|head_intent.billing| I need to pay my bill|
|head_intent.billing| How do I make a new payment for the statement I received?|
|head_intent.billing| What's the minimum I can pay right now for my phone bill?|

In the transposed setup, we provide the data with the `Intent Name` as the column header, and all of the training phrases below it:

| head_intent.billing| confirmation.yes |
|---|---|
|I need to pay my bill| yes|
|How do I make a new payment for the statement I received?| yeah|
|What's the minimum I can pay right now for my phone bill?| for sure|

The motivation behind this feature is to provide the exported data for your team's linguists, data labelers, and QA team to review from a different perspective. This transposed format can help with use cases like:
* Identifying "weak" Intents that need more training phrases
* Identifying "strong" Intents that perhaps have too _many_ training phrases
* Overall Intent and Training Phrase Balancing and Distribution
---

Notebooks
We've provided 5 new example notebooks in this release.

1. [SCRAPI Prebuilt Development Notebook](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/scrapi_prebuilt.ipynb), This is a a great starter notebook if you're unsure where to begin with SCRAPI. It provides some foundational imports and ends with a blank canvas to allow you to explore, script, and build based on your needs.
2. [Builder 101 - Using Builder Classes to Build Bots Programmatically](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/bot_building_series/builders_101.ipynb), A primer on the new Builder classes that will get you up to speed in no time!
3. [Exporting Custom Entities to Google Sheets](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/google_sheets_series/custom_entities_to_sheets.ipynb), a quick how-to guide on getting Custom Entity Types and Synonyms out of your bot, and into Google Sheets to share, analyze, and iterate with your team.
4. [NLU Analysis - Semantic Similarity and Clustering](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/nlu_analysis_series/nlu_semantic_similarity_demo.ipynb), using machine learning to improve machine learning! This notebook provides 3 great ML-based approaches to tuning your Intents and Training Phrases.
5. [Intent Analysis Using Levenshtein Ratios](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/nlu_analysis_series/intent_levenshtein_demo.ipynb), another great analysis notebook that leverages Levenshtein Distance to identify conflicts between intents.

---

Bug Fixes
- Fixed a bug in the `Experiments` class that incorrectly set the `client_options` variable
- Fixed a bug in `entity_type_proto_to_dataframe` that was incorrectly concatenating a Pandas DataFrame with a Dictionary, instead of 2 Pandas DataFrames
- Fixed a bug in the `Levenshtein` class that referenced non-existent keys in an upstream DataFrame

---

Misc
- Lots of style updates across the library for consistency
- Doc string updates across the library to provide better explanation of methods and functions

---

What's Changed
* Feature/intent to df transposed by MRyderOC in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/73
* Correctly set region using environment_path by cbradgoog in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/77
* entity to dataframe fix by DtStry in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/76
* Adding methods for extracting test coverage by hkhaitan1 in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/75
* Feature/intent builder by MRyderOC in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/74
* Feature/session entity types by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/84
* Feature/agent and entity builder by MRyderOC in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/80
* 81 fr static analysis class and notebooks by cgibson6279 in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/83
* Feature/notebook examples by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/86
* Feature/style cleanup by SeanScripts in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/82

New Contributors
* cbradgoog made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/77
* DtStry made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/76
* hkhaitan1 made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/75

**Full Changelog**: https://github.com/GoogleCloudPlatform/dfcx-scrapi/compare/1.4.0...1.5.0

1.4.0

New Features
Import / Export Flow in Bytes
A new method was added in [flows.py](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/core/flows.py#L274) allowing the user to capture the Flow object as an inline byte stream. This feature enables some CI/CD tooling that is being developed and will be released soon! Great addition βž• from Omerside !

Enhancements
NLU Regression Testing
We've updated the functionality of `run_intent_detection` method in the [conversation.py](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/core/conversation.py#L539) class to provide more verbose information in the resulting DataFrame. Previously, the "Match Type" information had to be derived from the results. We can now access each of these signals directly, including `PARAMETER_FILLING` which allows for more granular NLU Regression testing. Big thanks πŸŽ‰ to Greenford for getting this put together! Full [details here](https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/59).

Intents to DataFrame Refactor
We've performed a refactor of [bulk_intent_to_df](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/core/intents.py#L581) to provide more consistency with the output results. Previously, there were 2 "modes" which provided different output types:
* `basic`, which output a DataFrame
* `advanced`, which output a Dictionary containing 2 DataFrames

For output type consistency, we've consolidated all of the information from the `advanced` mode into a single DataFrame. All of the information that existed previously is available in the new, single DataFrame. Kudos πŸ‘ to MRyderOC for cleaning this up!

Pandas Append Deprecation
We've made various modifications to the [deprecated pd.append](https://pandas.pydata.org/pandas-docs/dev/whatsnew/v1.4.0.html#deprecated-dataframe-append-and-series-append) methods across the library to use the recommended syntax of `pd.concat`. This also provides us with some computation speed increases in some areas, which is nice! Thanks for this cleanup 🧹 sidpagariya !


Bug Fixes
- Fixed a typo in [transition_route_groups.py](https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/58/files)
- Fixed an issue in [dataframe_functions.py](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/dataframe_functions.py#L272) on the `_update_intent_from_dataframe` method where `parameter_id` was not appropriately populated when annotations were not provided. Thanks for the catch / fix Lambert!

___
What's Changed
* Comments. by Omerside in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/62
* added import/export flow using raw bytes by Omerside in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/60
* Fix update_transition_route_group by SeanScripts in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/58
* Update pandas append function for dataframes to pandas concat to suppress Pandas deprecation warning by sidpagariya in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/63
* Feature/detect param by Greenford in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/59
* Advanced mode did not manage properly unannotated training phrases by lambertaurelle in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/45
* Refactor/intents to df by MRyderOC in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/67
* Lint Fixes for Recent File Changes by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/68

New Contributors
* SeanScripts made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/58
* sidpagariya made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/63
* lambertaurelle made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/45

**Full Changelog**: https://github.com/GoogleCloudPlatform/dfcx-scrapi/compare/1.3.0...1.4.0

1.3.0

New Features
Pull All Fulfillments
A new method has been implemented called [SearchUtil.get_agent_fulfillment_message_df](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/search_util.py#L717) which allows you to extract all Fulfillment Messages from an agent and pull them into a DataFrame for easy reference.

There is also a secondary method that allows you to pull fulfillment messages with their original unpacked structure at [SearchUtil.get_raw_agent_fulfillment_df](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/search_util.py#L794)

Entity Types to DataFrame
You can now [extract all Entity Types](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/core/entity_types.py#L124) and metadata contents into a DataFrame!

The new method has 2 modes, just like it's Intent counterpart:
- `basic` mode will provide a simple DataFrame of Entity Type and their corresponding synonyms
- `advanced` mode will provide 2 DataFrames:
- `entity_types` which includes everything from the `basic` mode, plus additional metadata flags
- `excluded_phrases` which includes the mapping of all excluded phrases, if applicable

Principal Auth for Google Sheets
Methods in `DataframeFunctions` that interact with Google Sheets now accept GCP Principal account auth!
When [instantiating the class](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/dataframe_functions.py#L58), pass the flag for `principal=True` to launch the OAuth process.

The OAuth process requires your GCP project to have certain APIs enabled as well as a downloaded OAuth client credential.
You can find more on setting up this process for your GCP Project [here](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/dataframe_functions.py#L58)

Enhancements
- `Conversation.reply` now correctly unpacks all Proto structures (embedded Structs / Arrays) into more pythonic structures (Dicts / Lists)
- You can now [get a Flow by display name](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/core/flows.py#L140) in the Flows class
- [UtteranceGeneratorUtils.create_test_dataset](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/src/dfcx_scrapi/tools/utterance_generator_util.py#L286) now generates a DataFrame that is formatted and in alignment for use with other methods across the library.

Bug Fixes
- `Operations.get_lro` now uses the correct region/location based on the input LRO ID
- Fixed an issue in `Conversation.reply` where inputs were being truncated at 250 instead of the default 256 char limit
___
What's Changed
* Conversation Class Enhancements and Bug Fixes by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/52
* Cleanup/search util by Greenford in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/43
* A way to pull and organize fulfillments in an agent for analyzing gra… by Hgithubacct in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/22
* added get_by_display_name, cleaned up other stuff by Omerside in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/42
* create_test_dataset fixed by cgibson6279 in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/51
* Feature/entity types to data frame by MRyderOC in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/48
* add inherited auth for GSheets by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/53
* fixed regionalization for get_lro by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/54
* lint fixes; pre-1.3.0 release by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/55

New Contributors
* cgibson6279 made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/51
* MRyderOC made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/48

**Full Changelog**: https://github.com/GoogleCloudPlatform/dfcx-scrapi/compare/1.2.2...1.3.0

1.2.2

What's Changed
* Added get_webhook, update_webhook, small cleanup to Webhooks class by Omerside in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/38
* Select Environment when Exporting Agent by Omerside in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/37
* minor doc update; moving method for vis by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/40
* Patch/agents minor updates by kmaphoenix in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/41
* Fixed bug in route_groups_to_dataframe that would cause method to fail if `intent` was missing from route by Greenford in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/39

New Contributors
* Greenford made their first contribution in https://github.com/GoogleCloudPlatform/dfcx-scrapi/pull/39

**Full Changelog**: https://github.com/GoogleCloudPlatform/dfcx-scrapi/compare/1.2.1...1.2.2

Page 5 of 7

Β© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.