Skip to content

Commit

Permalink
AUTO docusaurus 20230829
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub CI committed Aug 29, 2023
1 parent decbd08 commit 956528c
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 58 deletions.
1 change: 1 addition & 0 deletions changelog/12768.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated certifi, cryptography, and scipy packages to address security vulnerabilities.
10 changes: 8 additions & 2 deletions docs/docs/reference/rasa/core/lock_store.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ def __init__(
db: int = 1,
password: Optional[Text] = None,
use_ssl: bool = False,
ssl_certfile: Optional[Text] = None,
ssl_keyfile: Optional[Text] = None,
ssl_ca_certs: Optional[Text] = None,
key_prefix: Optional[Text] = None,
socket_timeout: float = DEFAULT_SOCKET_TIMEOUT_IN_SECONDS) -> None
```
Expand All @@ -167,10 +170,13 @@ Create a lock store which uses Redis for persistence.
- `password` - The password which should be used for authentication with the
Redis database.
- `use_ssl` - `True` if SSL should be used for the connection to Redis.
- `ssl_certfile` - Path to the SSL certificate file.
- `ssl_keyfile` - Path to the SSL private key file.
- `ssl_ca_certs` - Path to the SSL CA certificate file.
- `key_prefix` - prefix to prepend to all keys used by the lock store. Must be
alphanumeric.
- `socket_timeout` - Timeout in seconds after which an exception will be raised
in case Redis doesn't respond within `socket_timeout` seconds.
- `port`0 - Timeout in seconds after which an exception will be raised
in case Redis doesn't respond within `port`0 seconds.

#### get\_lock

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sources/rasa_interactive___help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ options:
--conversation-id CONVERSATION_ID
Specify the id of the conversation the messages are
in. Defaults to a UUID that will be randomly
generated. (default: 8c645882ac2a4c34948282a7209f5c1b)
generated. (default: 19fc39f7978f427f9704ef27a1e2af10)
--endpoints ENDPOINTS
Configuration file for the model server and the
connectors as a yml file. (default: endpoints.yml)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sources/rasa_shell___help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ options:
-h, --help show this help message and exit
--conversation-id CONVERSATION_ID
Set the conversation ID. (default:
1d482ae9279d4a3584db8c458ffea8fc)
572acc8043b64b21a208c4d305b4b55c)
-m MODEL, --model MODEL
Path to a trained Rasa model. If a directory is
specified, it will use the latest model in this
Expand Down
70 changes: 37 additions & 33 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ structlog-sentry = "^2.0.2"
# in order to fix https://rasahq.atlassian.net/browse/ATO-1419
dnspython = "2.3.0"
wheel = ">=0.38.1"
certifi = ">=2023.7.22"
cryptography = ">=41.0.2"
[[tool.poetry.dependencies.tensorflow-io-gcs-filesystem]]
version = "==0.31"
markers = "sys_platform == 'win32'"
Expand Down Expand Up @@ -193,7 +195,7 @@ version = ">=1.4.1,<1.7.3"
python = "~=3.7.0"

[[tool.poetry.dependencies.scipy]]
version = ">=1.4.1,<1.9.0"
version = ">=1.10.0"
python = ">=3.8,<3.11"

[[tool.poetry.dependencies.scikit-learn]]
Expand Down
2 changes: 0 additions & 2 deletions rasa/core/actions/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,6 @@ async def run(
metadata: Optional[Dict[Text, Any]] = None,
) -> List[Event]:
"""Runs action. Please see parent class for the full docstring."""

fallback = {"text": ""}
message = metadata.get("message", fallback) if metadata else fallback
return [create_bot_utterance(message)]
Expand Down Expand Up @@ -1353,7 +1352,6 @@ def extract_slot_value_from_predefined_mapping(
tracker: "DialogueStateTracker",
) -> List[Any]:
"""Extracts slot value if slot has an applicable predefined mapping."""

if tracker.has_bot_message_after_latest_user_message():
# TODO: this needs further validation - not sure if this breaks something!!!

Expand Down
11 changes: 9 additions & 2 deletions rasa/core/lock_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,13 @@ def finish_serving(self, conversation_id: Text, ticket_number: int) -> None:
Removes ticket from lock and saves lock.
"""

lock = self.get_lock(conversation_id)
if lock:
lock.remove_ticket_for(ticket_number)
self.save_lock(lock)

def cleanup(self, conversation_id: Text, ticket_number: int) -> None:
"""Remove lock for `conversation_id` if no one is waiting."""

self.finish_serving(conversation_id, ticket_number)
if not self.is_someone_waiting(conversation_id):
self.delete_lock(conversation_id)
Expand All @@ -204,6 +202,9 @@ def __init__(
db: int = 1,
password: Optional[Text] = None,
use_ssl: bool = False,
ssl_certfile: Optional[Text] = None,
ssl_keyfile: Optional[Text] = None,
ssl_ca_certs: Optional[Text] = None,
key_prefix: Optional[Text] = None,
socket_timeout: float = DEFAULT_SOCKET_TIMEOUT_IN_SECONDS,
) -> None:
Expand All @@ -217,6 +218,9 @@ def __init__(
password: The password which should be used for authentication with the
Redis database.
use_ssl: `True` if SSL should be used for the connection to Redis.
ssl_certfile: Path to the SSL certificate file.
ssl_keyfile: Path to the SSL private key file.
ssl_ca_certs: Path to the SSL CA certificate file.
key_prefix: prefix to prepend to all keys used by the lock store. Must be
alphanumeric.
socket_timeout: Timeout in seconds after which an exception will be raised
Expand All @@ -230,6 +234,9 @@ def __init__(
db=int(db),
password=password,
ssl=use_ssl,
ssl_certfile=ssl_certfile,
ssl_keyfile=ssl_keyfile,
ssl_ca_certs=ssl_ca_certs,
socket_timeout=socket_timeout,
)

Expand Down
27 changes: 11 additions & 16 deletions rasa/shared/core/training_data/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def __init__(self, nlu_training_data: "TrainingData") -> None:
def _create_reverse_mapping(
data: "TrainingData",
) -> Dict[Dict[Text, Any], List["Message"]]:
"""Create a mapping from intent to messages
This allows a faster intent lookup."""
"""Create a mapping from intent to messages.
This allows a faster intent lookup.
"""
d = defaultdict(list)
for example in data.training_examples:
if example.get(INTENT, {}) is not None:
Expand Down Expand Up @@ -95,8 +95,8 @@ def _fingerprint_node(
remember max history number of nodes we have visited. Hence, if we randomly
walk on our directed graph, always only remembering the last `max_history`
nodes we have visited, we can never remember if we have visited node A or
node B if both have the same fingerprint."""

node B if both have the same fingerprint.
"""
# the candidate list contains all node paths that haven't been
# extended till `max_history` length yet.
candidates: Deque = deque()
Expand Down Expand Up @@ -140,8 +140,8 @@ def _outgoing_edges_are_similar(
it doesn't matter if you are in a or b.
As your path will be the same because the outgoing edges will lead you to
the same nodes anyways."""

the same nodes anyways.
"""
ignored = {node_b, node_a}
a_edges = {
(target, k)
Expand Down Expand Up @@ -177,8 +177,8 @@ def _add_edge(
**kwargs: Any,
) -> None:
"""Adds an edge to the graph if the edge is not already present. Uses the
label as the key."""

label as the key.
"""
if key is None:
key = EDGE_NONE_LABEL

Expand All @@ -197,8 +197,8 @@ def _transfer_style(
) -> Dict[Text, Any]:
"""Copy over class names from source to target for all special classes.
Used if a node is highlighted and merged with another node."""

Used if a node is highlighted and merged with another node.
"""
clazzes = source.get("class", "")

special_classes = {"dashed", "active"}
Expand All @@ -216,7 +216,6 @@ def _transfer_style(

def _merge_equivalent_nodes(graph: "networkx.MultiDiGraph", max_history: int) -> None:
"""Searches for equivalent nodes in the graph and merges them."""

changed = True
# every node merge changes the graph and can trigger previously
# impossible node merges - we need to repeat until
Expand Down Expand Up @@ -364,7 +363,6 @@ def _length_of_common_action_prefix(this: List[Event], other: List[Event]) -> in

def _add_default_nodes(graph: "networkx.MultiDiGraph", fontsize: int = 12) -> None:
"""Add the standard nodes we need."""

graph.add_node(
START_NODE_ID,
label="START",
Expand All @@ -386,7 +384,6 @@ def _add_default_nodes(graph: "networkx.MultiDiGraph", fontsize: int = 12) -> No

def _create_graph(fontsize: int = 12) -> "networkx.MultiDiGraph":
"""Create a graph and adds the default nodes."""

import networkx as nx

graph = nx.MultiDiGraph()
Expand All @@ -402,7 +399,6 @@ def _add_message_edge(
is_current: bool,
) -> None:
"""Create an edge based on the user message."""

if message:
message_key = message.get("intent", {}).get("name", None)
message_label = message.get("text", None)
Expand Down Expand Up @@ -530,7 +526,6 @@ def _remove_auxiliary_nodes(
graph: "networkx.MultiDiGraph", special_node_idx: int
) -> None:
"""Remove any temporary or unused nodes."""

graph.remove_node(TMP_NODE_ID)

if not graph.predecessors(END_NODE_ID):
Expand Down

0 comments on commit 956528c

Please sign in to comment.