From 9267a3f4b0b0a2449132a8e2550caaae54114c14 Mon Sep 17 00:00:00 2001 From: pseusys Date: Thu, 17 Oct 2024 14:38:06 +0800 Subject: [PATCH 1/5] benchmarking time reduce update --- chatsky/utils/db_benchmark/basic_config.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/chatsky/utils/db_benchmark/basic_config.py b/chatsky/utils/db_benchmark/basic_config.py index 68d9c1006..d556e7ec1 100644 --- a/chatsky/utils/db_benchmark/basic_config.py +++ b/chatsky/utils/db_benchmark/basic_config.py @@ -96,9 +96,9 @@ class BasicBenchmarkConfig(BenchmarkConfig, frozen=True): Number of times the contexts will be benchmarked. Increasing this number decreases standard error of the mean for benchmarked data. """ - from_dialog_len: int = 300 + from_dialog_len: int = 25 """Starting dialog len of a context.""" - to_dialog_len: int = 311 + to_dialog_len: int = 50 """ Final dialog len of a context. :py:meth:`~.BasicBenchmarkConfig.context_updater` will return contexts @@ -177,27 +177,23 @@ def context_updater(self, context: Context) -> Optional[Context]: basic_configurations = { "large-misc": BasicBenchmarkConfig( from_dialog_len=1, - to_dialog_len=50, + to_dialog_len=26, message_dimensions=(3, 5, 6, 5, 3), misc_dimensions=(2, 4, 3, 8, 100), ), "short-messages": BasicBenchmarkConfig( - from_dialog_len=500, - to_dialog_len=550, message_dimensions=(2, 30), misc_dimensions=(0, 0), ), "default": BasicBenchmarkConfig(), - "large-misc--long-dialog": BasicBenchmarkConfig( - from_dialog_len=500, - to_dialog_len=550, + "large-misc-long-dialog": BasicBenchmarkConfig( message_dimensions=(3, 5, 6, 5, 3), misc_dimensions=(2, 4, 3, 8, 100), ), "very-long-dialog-len": BasicBenchmarkConfig( context_num=10, - from_dialog_len=10000, - to_dialog_len=10050, + from_dialog_len=1000, + to_dialog_len=1050, ), "very-long-message-len": BasicBenchmarkConfig( context_num=10, From f075ad101ee08193dabf6e7140f4ee12c0741c84 Mon Sep 17 00:00:00 2001 From: pseusys Date: Thu, 17 Oct 2024 14:41:41 +0800 Subject: [PATCH 2/5] slots docs accidental changes reverted --- docs/source/user_guides/slot_extraction.rst | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/source/user_guides/slot_extraction.rst b/docs/source/user_guides/slot_extraction.rst index 11798074e..61dcff117 100644 --- a/docs/source/user_guides/slot_extraction.rst +++ b/docs/source/user_guides/slot_extraction.rst @@ -100,7 +100,7 @@ A dot-separated string that acts as a path from the root slot to the needed slot In the example above ``name_slot`` would have the name "name" because that is the key used to store it in the ``profile_slot``. -Let's consider nested group slots: +If you have a nested structure (of ``GroupSlots``) separate the names with dots: .. code-block:: python @@ -141,10 +141,7 @@ The `conditions` submodule provides a function for checking if specific slots ha Both `processing` and `response` submodules provide functions for filling templates with extracted slot values. - -- ``FillTemplate`` changes the response function of the current node to ``FilledTemplate`` at the ``PRE_RESPONSE`` level. -- ``FilledTemplate`` is a response function that fills slots after producing inner response - (which can be ``BaseResponse``, ``Message`` or simply a string). +Choose whichever one you like, there's not much difference between them at the moment. .. code-block:: python @@ -156,7 +153,7 @@ extracted slot values. RESPONSE: rsp.FilledTemplate("Your first name: {name}") -An example of script utilizing slot extraction can be found in the +Some real examples of scripts utilizing slot extraction can be found in the `tutorials section <../tutorials/tutorials.slots.1_basic_example.html>`_. Further reading From 8bce73af56346a07a04ab4408a77f2140cd97d59 Mon Sep 17 00:00:00 2001 From: pseusys Date: Fri, 18 Oct 2024 02:02:01 +0800 Subject: [PATCH 3/5] large misc long dialog updated! --- chatsky/utils/db_benchmark/basic_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chatsky/utils/db_benchmark/basic_config.py b/chatsky/utils/db_benchmark/basic_config.py index d556e7ec1..fe245a4e4 100644 --- a/chatsky/utils/db_benchmark/basic_config.py +++ b/chatsky/utils/db_benchmark/basic_config.py @@ -187,6 +187,8 @@ def context_updater(self, context: Context) -> Optional[Context]: ), "default": BasicBenchmarkConfig(), "large-misc-long-dialog": BasicBenchmarkConfig( + from_dialog_len=50, + to_dialog_len=75, message_dimensions=(3, 5, 6, 5, 3), misc_dimensions=(2, 4, 3, 8, 100), ), From ef29faacb8405e7a342ed8363448ca3ae1ac3d27 Mon Sep 17 00:00:00 2001 From: pseusys Date: Fri, 18 Oct 2024 02:04:53 +0800 Subject: [PATCH 4/5] slot extraction docs reverted (again? what?) --- docs/source/user_guides/slot_extraction.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/source/user_guides/slot_extraction.rst b/docs/source/user_guides/slot_extraction.rst index 61dcff117..11798074e 100644 --- a/docs/source/user_guides/slot_extraction.rst +++ b/docs/source/user_guides/slot_extraction.rst @@ -100,7 +100,7 @@ A dot-separated string that acts as a path from the root slot to the needed slot In the example above ``name_slot`` would have the name "name" because that is the key used to store it in the ``profile_slot``. -If you have a nested structure (of ``GroupSlots``) separate the names with dots: +Let's consider nested group slots: .. code-block:: python @@ -141,7 +141,10 @@ The `conditions` submodule provides a function for checking if specific slots ha Both `processing` and `response` submodules provide functions for filling templates with extracted slot values. -Choose whichever one you like, there's not much difference between them at the moment. + +- ``FillTemplate`` changes the response function of the current node to ``FilledTemplate`` at the ``PRE_RESPONSE`` level. +- ``FilledTemplate`` is a response function that fills slots after producing inner response + (which can be ``BaseResponse``, ``Message`` or simply a string). .. code-block:: python @@ -153,7 +156,7 @@ Choose whichever one you like, there's not much difference between them at the m RESPONSE: rsp.FilledTemplate("Your first name: {name}") -Some real examples of scripts utilizing slot extraction can be found in the +An example of script utilizing slot extraction can be found in the `tutorials section <../tutorials/tutorials.slots.1_basic_example.html>`_. Further reading From f91bc0eba98cecab647d2070b6ca43f376a13351 Mon Sep 17 00:00:00 2001 From: Roman Zlobin Date: Fri, 18 Oct 2024 14:12:13 +0300 Subject: [PATCH 5/5] lint --- chatsky/utils/db_benchmark/basic_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatsky/utils/db_benchmark/basic_config.py b/chatsky/utils/db_benchmark/basic_config.py index fe245a4e4..edd0cc620 100644 --- a/chatsky/utils/db_benchmark/basic_config.py +++ b/chatsky/utils/db_benchmark/basic_config.py @@ -187,7 +187,7 @@ def context_updater(self, context: Context) -> Optional[Context]: ), "default": BasicBenchmarkConfig(), "large-misc-long-dialog": BasicBenchmarkConfig( - from_dialog_len=50, + from_dialog_len=50, to_dialog_len=75, message_dimensions=(3, 5, 6, 5, 3), misc_dimensions=(2, 4, 3, 8, 100),