rasa-pro 3.13.0.dev2__py3-none-any.whl → 3.13.0.dev5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- rasa/__main__.py +3 -1
- rasa/cli/inspect.py +8 -4
- rasa/cli/project_templates/default/config.yml +5 -32
- rasa/cli/project_templates/{calm → default}/e2e_tests/cancelations/user_cancels_during_a_correction.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/cancelations/user_changes_mind_on_a_whim.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/corrections/user_corrects_contact_handle.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/corrections/user_corrects_contact_name.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_adds_contact_to_their_list.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_lists_contacts.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_removes_contact.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_removes_contact_from_list.yml +1 -1
- rasa/cli/project_templates/default/endpoints.yml +18 -2
- rasa/cli/run.py +10 -6
- rasa/cli/scaffold.py +3 -4
- rasa/cli/studio/download.py +1 -1
- rasa/cli/studio/upload.py +0 -6
- rasa/cli/utils.py +7 -0
- rasa/core/channels/channel.py +93 -0
- rasa/core/channels/inspector/dist/assets/{arc-c7691751.js → arc-9f75cc3b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-ab99dff7.js → blockDiagram-38ab4fdb-7f34db23.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-08c35a6b.js → c4Diagram-3d4e48cf-948bab2c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-dfa68278.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-9e9c71c9.js → classDiagram-70f12bd4-53b0dd0e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-15e7e2bf.js → classDiagram-v2-f2320105-fdf789e7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-edb7f119.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-9c105cb1.js → createText-2e5e7dd3-87c4ece5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-77e89e48.js → edges-e0da2a9e-5a8b0749.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-7a011646.js → erDiagram-9861fffd-66da90e2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-b6f105ac.js → flowDb-956e92f1-10044f05.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-ce4f18c2.js → flowDiagram-66a62f08-f338f66a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-65e7c670.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-cb5f6da4.js → flowchart-elk-definition-4a651766-b13140aa.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-e4d19e28.js → ganttDiagram-c361ad54-f2b4a55a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-727b1c33.js → gitGraphDiagram-72cf32ee-dedc298d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-6e2ab9a7.js → graph-4ede11ff.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-84ec700f.js → index-3862675e-65549d37.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-098a1a24.js → index-3a23e736.js} +142 -129
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-78dda442.js → infoDiagram-f8f76790-65439671.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-f1cc6dd1.js → journeyDiagram-49397b02-56d03d98.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-d98dcd0c.js → layout-dd48f7f4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-838e3d82.js → line-1569ad2c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-eae72406.js → linear-48bf4935.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-c96fd84b.js → mindmap-definition-fc14e90a-688504c1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-c936d4e2.js → pieDiagram-8a3498a8-78b6d7e6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-b338eb8f.js → quadrantDiagram-120e2f19-048b84b3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-c6b6c0d5.js → requirementDiagram-deff3bca-dd67f107.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-b9372e19.js → sankeyDiagram-04a897e0-8128436e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-479e0a3f.js → sequenceDiagram-704730f1-1a0d1461.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-fd26eebc.js → stateDiagram-587899a1-46d388ed.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-3233e0ae.js → stateDiagram-v2-d93cdb3a-ea42951a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-1fdd392b.js → styles-6aaf32cf-7427ed0c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-6d7bfa1b.js → styles-9a916d00-ff5e5a16.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-f86aab11.js → styles-c10674c1-7b3680cf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-e3e49d7a.js → svgDrawCommon-08f97a94-f860f2ad.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-6fe08b4d.js → timeline-definition-85554ec2-2eebf0c8.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-c2e06fd6.js → xychartDiagram-e933f94c-5d7f4e96.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +1 -1
- rasa/core/channels/inspector/src/App.tsx +3 -2
- rasa/core/channels/inspector/src/components/Chat.tsx +23 -2
- rasa/core/channels/inspector/src/components/DiagramFlow.tsx +2 -5
- rasa/core/channels/inspector/src/helpers/conversation.ts +16 -0
- rasa/core/channels/inspector/src/types.ts +1 -1
- rasa/core/channels/voice_ready/audiocodes.py +41 -15
- rasa/core/channels/voice_ready/jambonz.py +25 -5
- rasa/core/channels/voice_ready/jambonz_protocol.py +4 -0
- rasa/core/channels/voice_ready/twilio_voice.py +48 -1
- rasa/core/channels/voice_stream/tts/azure.py +11 -2
- rasa/core/channels/voice_stream/twilio_media_streams.py +101 -26
- rasa/core/channels/voice_stream/voice_channel.py +28 -2
- rasa/core/concurrent_lock_store.py +24 -10
- rasa/core/information_retrieval/faiss.py +7 -68
- rasa/core/information_retrieval/information_retrieval.py +2 -40
- rasa/core/information_retrieval/milvus.py +2 -7
- rasa/core/information_retrieval/qdrant.py +2 -7
- rasa/core/lock_store.py +151 -60
- rasa/core/nlg/contextual_response_rephraser.py +3 -0
- rasa/core/policies/enterprise_search_policy.py +310 -61
- rasa/core/policies/intentless_policy.py +3 -0
- rasa/dialogue_understanding/coexistence/llm_based_router.py +8 -0
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +2 -2
- rasa/dialogue_understanding/generator/command_parser.py +1 -1
- rasa/dialogue_understanding/generator/flow_retrieval.py +1 -4
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +1 -2
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +13 -0
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_template.jinja2 +1 -1
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +1 -1
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +2 -24
- rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +22 -17
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +27 -12
- rasa/dialogue_understanding_test/du_test_case.py +16 -8
- rasa/dialogue_understanding_test/io.py +8 -13
- rasa/e2e_test/utils/validation.py +3 -3
- rasa/engine/recipes/default_components.py +0 -2
- rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +3 -0
- rasa/plugin.py +0 -3
- rasa/shared/constants.py +1 -0
- rasa/shared/core/domain.py +165 -11
- rasa/shared/core/flows/flow.py +155 -131
- rasa/shared/core/flows/flow_step.py +19 -3
- rasa/shared/core/flows/flow_step_links.py +15 -0
- rasa/shared/core/flows/flow_step_sequence.py +6 -0
- rasa/shared/core/flows/nlu_trigger.py +13 -0
- rasa/shared/core/flows/steps/action.py +7 -4
- rasa/shared/core/flows/steps/call.py +11 -4
- rasa/shared/core/flows/steps/collect.py +27 -6
- rasa/shared/core/flows/steps/internal.py +6 -1
- rasa/shared/core/flows/steps/link.py +7 -4
- rasa/shared/core/flows/steps/no_operation.py +7 -4
- rasa/shared/core/flows/steps/set_slots.py +8 -4
- rasa/shared/core/flows/yaml_flows_io.py +106 -5
- rasa/shared/importers/importer.py +8 -0
- rasa/shared/providers/_utils.py +83 -0
- rasa/shared/providers/llm/_base_litellm_client.py +6 -3
- rasa/shared/providers/llm/azure_openai_llm_client.py +6 -68
- rasa/shared/providers/router/_base_litellm_router_client.py +53 -1
- rasa/shared/utils/common.py +42 -0
- rasa/shared/utils/constants.py +3 -0
- rasa/shared/utils/llm.py +70 -24
- rasa/studio/download/domains.py +49 -0
- rasa/studio/download/download.py +439 -0
- rasa/studio/download/flows.py +359 -0
- rasa/studio/results_logger.py +6 -1
- rasa/studio/upload.py +69 -5
- rasa/tracing/instrumentation/attribute_extractors.py +7 -10
- rasa/tracing/instrumentation/instrumentation.py +12 -12
- rasa/utils/common.py +36 -0
- rasa/utils/endpoints.py +22 -1
- rasa/utils/licensing.py +1 -1
- rasa/validator.py +1 -2
- rasa/version.py +1 -1
- {rasa_pro-3.13.0.dev2.dist-info → rasa_pro-3.13.0.dev5.dist-info}/METADATA +7 -7
- {rasa_pro-3.13.0.dev2.dist-info → rasa_pro-3.13.0.dev5.dist-info}/RECORD +149 -166
- rasa/cli/project_templates/calm/config.yml +0 -10
- rasa/cli/project_templates/calm/credentials.yml +0 -33
- rasa/cli/project_templates/calm/endpoints.yml +0 -58
- rasa/cli/project_templates/default/actions/actions.py +0 -27
- rasa/cli/project_templates/default/data/nlu.yml +0 -91
- rasa/cli/project_templates/default/data/rules.yml +0 -13
- rasa/cli/project_templates/default/data/stories.yml +0 -30
- rasa/cli/project_templates/default/domain.yml +0 -34
- rasa/cli/project_templates/default/tests/test_stories.yml +0 -91
- rasa/core/channels/inspector/dist/assets/channel-11268142.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-ff7f2ce7.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-cba7ae20.js +0 -1
- rasa/document_retrieval/__init__.py +0 -0
- rasa/document_retrieval/constants.py +0 -32
- rasa/document_retrieval/document_post_processor.py +0 -351
- rasa/document_retrieval/document_post_processor_prompt_template.jinja2 +0 -0
- rasa/document_retrieval/document_retriever.py +0 -333
- rasa/document_retrieval/knowledge_base_connectors/__init__.py +0 -0
- rasa/document_retrieval/knowledge_base_connectors/api_connector.py +0 -39
- rasa/document_retrieval/knowledge_base_connectors/knowledge_base_connector.py +0 -34
- rasa/document_retrieval/knowledge_base_connectors/vector_store_connector.py +0 -226
- rasa/document_retrieval/query_rewriter.py +0 -234
- rasa/document_retrieval/query_rewriter_prompt_template.jinja2 +0 -8
- rasa/studio/download.py +0 -489
- /rasa/cli/project_templates/{calm → default}/actions/action_template.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/add_contact.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/db.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/list_contacts.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/remove_contact.py +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/add_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/list_contacts.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/remove_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/db/contacts.json +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/add_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/list_contacts.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/remove_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/shared.yml +0 -0
- /rasa/{cli/project_templates/calm/actions → studio/download}/__init__.py +0 -0
- {rasa_pro-3.13.0.dev2.dist-info → rasa_pro-3.13.0.dev5.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.0.dev2.dist-info → rasa_pro-3.13.0.dev5.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.0.dev2.dist-info → rasa_pro-3.13.0.dev5.dist-info}/entry_points.txt +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import json
|
|
2
|
-
import logging
|
|
3
2
|
import time
|
|
4
3
|
from collections import deque
|
|
5
4
|
from typing import Deque, Optional, Text
|
|
6
5
|
|
|
6
|
+
import structlog
|
|
7
|
+
|
|
7
8
|
from rasa.core.lock import Ticket, TicketLock
|
|
8
9
|
from rasa.core.lock_store import (
|
|
9
10
|
DEFAULT_SOCKET_TIMEOUT_IN_SECONDS,
|
|
@@ -19,7 +20,7 @@ DEFAULT_PORT = 6379
|
|
|
19
20
|
|
|
20
21
|
DEFAULT_HOSTNAME = "localhost"
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
structlogger = structlog.getLogger(__name__)
|
|
23
24
|
|
|
24
25
|
LAST_ISSUED_TICKET_NUMBER_SUFFIX = "last_issued_ticket_number"
|
|
25
26
|
|
|
@@ -105,7 +106,10 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
105
106
|
|
|
106
107
|
self.key_prefix = DEFAULT_CONCURRENT_REDIS_LOCK_STORE_KEY_PREFIX
|
|
107
108
|
if key_prefix:
|
|
108
|
-
|
|
109
|
+
structlogger.debug(
|
|
110
|
+
"concurrent_redis_lock_store._set_key_prefix.non_default_key_prefix",
|
|
111
|
+
event_info=f"Setting non-default redis key prefix: '{key_prefix}'.",
|
|
112
|
+
)
|
|
109
113
|
self._set_key_prefix(key_prefix)
|
|
110
114
|
|
|
111
115
|
super().__init__()
|
|
@@ -116,9 +120,13 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
116
120
|
key_prefix + ":" + DEFAULT_CONCURRENT_REDIS_LOCK_STORE_KEY_PREFIX
|
|
117
121
|
)
|
|
118
122
|
else:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
structlogger.warning(
|
|
124
|
+
"concurrent_redis_lock_store._set_key_prefix.default_instead_of_invalid_key_prefix",
|
|
125
|
+
event_info=(
|
|
126
|
+
f"Omitting provided non-alphanumeric "
|
|
127
|
+
f"redis key prefix: '{key_prefix}'. "
|
|
128
|
+
f"Using default '{self.key_prefix}' instead."
|
|
129
|
+
),
|
|
122
130
|
)
|
|
123
131
|
|
|
124
132
|
def issue_ticket(
|
|
@@ -129,7 +137,10 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
129
137
|
It's configured with `lock_lifetime` and associated with `conversation_id`.
|
|
130
138
|
Creates a new lock if none is found.
|
|
131
139
|
"""
|
|
132
|
-
|
|
140
|
+
structlogger.debug(
|
|
141
|
+
"concurrent_redis_lock_store.issue_ticket",
|
|
142
|
+
event_info=f"Issuing ticket for conversation '{conversation_id}'.",
|
|
143
|
+
)
|
|
133
144
|
try:
|
|
134
145
|
lock = self.get_or_create_lock(conversation_id)
|
|
135
146
|
lock.remove_expired_tickets()
|
|
@@ -164,9 +175,12 @@ class ConcurrentRedisLockStore(LockStore):
|
|
|
164
175
|
redis_keys = self.red.keys(pattern)
|
|
165
176
|
|
|
166
177
|
if not redis_keys:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
178
|
+
structlogger.debug(
|
|
179
|
+
"concurrent_redis_lock_store.delete_lock_key_not_found",
|
|
180
|
+
event_info=(
|
|
181
|
+
f"The lock store does not contain any key-value "
|
|
182
|
+
f"items for conversation '{conversation_id}'."
|
|
183
|
+
),
|
|
170
184
|
)
|
|
171
185
|
return None
|
|
172
186
|
|
|
@@ -31,12 +31,10 @@ class FAISS_Store(InformationRetrieval):
|
|
|
31
31
|
index_path: str,
|
|
32
32
|
docs_folder: Optional[str],
|
|
33
33
|
create_index: Optional[bool] = False,
|
|
34
|
-
use_llm: bool = False,
|
|
35
34
|
):
|
|
36
35
|
"""Initializes the FAISS Store."""
|
|
37
36
|
self.chunk_size = 1000
|
|
38
37
|
self.chunk_overlap = 20
|
|
39
|
-
self.use_llm = use_llm
|
|
40
38
|
|
|
41
39
|
path = Path(index_path) / "documents_faiss"
|
|
42
40
|
if create_index:
|
|
@@ -73,57 +71,6 @@ class FAISS_Store(InformationRetrieval):
|
|
|
73
71
|
|
|
74
72
|
return loader.load()
|
|
75
73
|
|
|
76
|
-
def _format_faqs(self, docs: List["Document"]) -> List["Document"]:
|
|
77
|
-
"""Splits each loaded file into individual FAQs.
|
|
78
|
-
|
|
79
|
-
Args:
|
|
80
|
-
docs: Documents representing whole files containing FAQs.
|
|
81
|
-
|
|
82
|
-
Returns:
|
|
83
|
-
List of Document objects, each containing a separate FAQ.
|
|
84
|
-
|
|
85
|
-
Examples:
|
|
86
|
-
An example of a file containing FAQs:
|
|
87
|
-
|
|
88
|
-
Q: Who is Finley?
|
|
89
|
-
A: Finley is your smart assistant for the FinX App. You can add him to your
|
|
90
|
-
favorite messenger and tell him what you need help with.
|
|
91
|
-
|
|
92
|
-
Q: How does Finley work?
|
|
93
|
-
A: Finley is powered by the latest chatbot technology leveraging a unique
|
|
94
|
-
interplay of large language models and secure logic.
|
|
95
|
-
|
|
96
|
-
More details in documentation: https://rasa.com/docs/reference/config/policies/extractive-search/
|
|
97
|
-
"""
|
|
98
|
-
structured_faqs = []
|
|
99
|
-
from langchain.schema import Document
|
|
100
|
-
|
|
101
|
-
for doc in docs:
|
|
102
|
-
faq_chunks = doc.page_content.strip().split("\n\n")
|
|
103
|
-
|
|
104
|
-
for chunk in faq_chunks:
|
|
105
|
-
lines = chunk.strip().split("\n")
|
|
106
|
-
if len(lines) < 2:
|
|
107
|
-
continue # Skip if something unexpected
|
|
108
|
-
|
|
109
|
-
question_line = lines[0].strip()
|
|
110
|
-
answer_line = lines[1].strip()
|
|
111
|
-
|
|
112
|
-
question = question_line.replace("Q: ", "").strip()
|
|
113
|
-
answer = answer_line.replace("A: ", "").strip()
|
|
114
|
-
|
|
115
|
-
doc_obj = Document(
|
|
116
|
-
page_content=question,
|
|
117
|
-
metadata={
|
|
118
|
-
"title": question.lower().replace(" ", "_")[:-1],
|
|
119
|
-
"type": "faq",
|
|
120
|
-
"answer": answer,
|
|
121
|
-
},
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
structured_faqs.append(doc_obj)
|
|
125
|
-
return structured_faqs
|
|
126
|
-
|
|
127
74
|
def _create_document_index(
|
|
128
75
|
self, docs_folder: Optional[str], embedding: "Embeddings"
|
|
129
76
|
) -> FAISS:
|
|
@@ -140,15 +87,12 @@ class FAISS_Store(InformationRetrieval):
|
|
|
140
87
|
raise ValueError("parameter `docs_folder` needs to be specified")
|
|
141
88
|
|
|
142
89
|
docs = self.load_documents(docs_folder)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
doc_chunks = splitter.split_documents(docs)
|
|
150
|
-
else:
|
|
151
|
-
doc_chunks = self._format_faqs(docs)
|
|
90
|
+
splitter = RecursiveCharacterTextSplitter(
|
|
91
|
+
chunk_size=self.chunk_size,
|
|
92
|
+
chunk_overlap=self.chunk_overlap,
|
|
93
|
+
length_function=len,
|
|
94
|
+
)
|
|
95
|
+
doc_chunks = splitter.split_documents(docs)
|
|
152
96
|
|
|
153
97
|
logger.info(
|
|
154
98
|
"information_retrieval.faiss_store._create_document_index",
|
|
@@ -169,15 +113,10 @@ class FAISS_Store(InformationRetrieval):
|
|
|
169
113
|
pass
|
|
170
114
|
|
|
171
115
|
async def search(
|
|
172
|
-
self,
|
|
173
|
-
query: Text,
|
|
174
|
-
tracker_state: Dict[str, Any],
|
|
175
|
-
threshold: float = 0.0,
|
|
176
|
-
k: int = 1,
|
|
116
|
+
self, query: Text, tracker_state: Dict[str, Any], threshold: float = 0.0
|
|
177
117
|
) -> SearchResultList:
|
|
178
118
|
logger.debug("information_retrieval.faiss_store.search", query=query)
|
|
179
119
|
try:
|
|
180
|
-
# TODO: make use of k
|
|
181
120
|
documents = await self.index.as_retriever().ainvoke(query)
|
|
182
121
|
except Exception as exc:
|
|
183
122
|
raise InformationRetrievalException from exc
|
|
@@ -36,19 +36,6 @@ class SearchResult:
|
|
|
36
36
|
"""Construct a SearchResult object from Langchain Document object."""
|
|
37
37
|
return cls(text=document.page_content, metadata=document.metadata)
|
|
38
38
|
|
|
39
|
-
@classmethod
|
|
40
|
-
def from_dict(cls, data: dict[str, Any]) -> "SearchResult":
|
|
41
|
-
"""Construct a SearchResult object from a JSON object."""
|
|
42
|
-
return cls(text=data["text"], metadata=data["metadata"], score=data["score"])
|
|
43
|
-
|
|
44
|
-
def to_dict(self) -> dict[str, Any]:
|
|
45
|
-
"""Convert the SearchResult object to a dictionary."""
|
|
46
|
-
return {
|
|
47
|
-
"text": self.text,
|
|
48
|
-
"metadata": self.metadata,
|
|
49
|
-
"score": self.score,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
39
|
|
|
53
40
|
@dataclass
|
|
54
41
|
class SearchResultList:
|
|
@@ -57,7 +44,8 @@ class SearchResultList:
|
|
|
57
44
|
|
|
58
45
|
@classmethod
|
|
59
46
|
def from_document_list(cls, documents: List["Document"]) -> "SearchResultList":
|
|
60
|
-
"""
|
|
47
|
+
"""
|
|
48
|
+
Convert a list of Langchain Documents to a SearchResultList object.
|
|
61
49
|
|
|
62
50
|
Args:
|
|
63
51
|
documents: List of Langchain Documents.
|
|
@@ -70,31 +58,6 @@ class SearchResultList:
|
|
|
70
58
|
metadata={"total_results": len(documents)},
|
|
71
59
|
)
|
|
72
60
|
|
|
73
|
-
@classmethod
|
|
74
|
-
def from_dict(cls, data: dict[str, Any]) -> "SearchResultList":
|
|
75
|
-
"""Convert a JSON object to a SearchResultList object.
|
|
76
|
-
|
|
77
|
-
Args:
|
|
78
|
-
data: JSON object.
|
|
79
|
-
|
|
80
|
-
Returns:
|
|
81
|
-
SearchResultList object.
|
|
82
|
-
"""
|
|
83
|
-
if not data:
|
|
84
|
-
return cls(results=[], metadata={})
|
|
85
|
-
|
|
86
|
-
return cls(
|
|
87
|
-
results=[SearchResult.from_dict(result) for result in data["results"]],
|
|
88
|
-
metadata=data["metadata"],
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
def to_dict(self) -> dict[str, Any]:
|
|
92
|
-
"""Convert the SearchResultList object to a dictionary."""
|
|
93
|
-
return {
|
|
94
|
-
"results": [result.to_dict() for result in self.results],
|
|
95
|
-
"metadata": self.metadata,
|
|
96
|
-
}
|
|
97
|
-
|
|
98
61
|
|
|
99
62
|
class InformationRetrievalException(RasaException):
|
|
100
63
|
"""Base class for exceptions raised by InformationRetrieval operations."""
|
|
@@ -126,7 +89,6 @@ class InformationRetrieval:
|
|
|
126
89
|
query: Text,
|
|
127
90
|
tracker_state: dict[str, Any],
|
|
128
91
|
threshold: float = 0.0,
|
|
129
|
-
k: int = 1,
|
|
130
92
|
) -> SearchResultList:
|
|
131
93
|
"""Search for a document in the InformationRetrieval system."""
|
|
132
94
|
raise NotImplementedError(
|
|
@@ -31,25 +31,20 @@ class Milvus_Store(InformationRetrieval):
|
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
async def search(
|
|
34
|
-
self,
|
|
35
|
-
query: Text,
|
|
36
|
-
tracker_state: Dict[str, Any],
|
|
37
|
-
threshold: float = 0.0,
|
|
38
|
-
k: int = 1,
|
|
34
|
+
self, query: Text, tracker_state: Dict[str, Any], threshold: float = 0.0
|
|
39
35
|
) -> SearchResultList:
|
|
40
36
|
"""Search for documents in the Milvus store.
|
|
41
37
|
|
|
42
38
|
Args:
|
|
43
39
|
query: The query to search for.
|
|
44
40
|
threshold: minimum similarity score to consider a document a match.
|
|
45
|
-
k: number of results to return.
|
|
46
41
|
|
|
47
42
|
Returns:
|
|
48
43
|
A list of documents that match the query.
|
|
49
44
|
"""
|
|
50
45
|
logger.debug("information_retrieval.milvus_store.search", query=query)
|
|
51
46
|
try:
|
|
52
|
-
hits = await self.client.asimilarity_search_with_score(query, k=
|
|
47
|
+
hits = await self.client.asimilarity_search_with_score(query, k=4)
|
|
53
48
|
except Exception as exc:
|
|
54
49
|
raise InformationRetrievalException from exc
|
|
55
50
|
|
|
@@ -66,18 +66,13 @@ class Qdrant_Store(InformationRetrieval):
|
|
|
66
66
|
)
|
|
67
67
|
|
|
68
68
|
async def search(
|
|
69
|
-
self,
|
|
70
|
-
query: Text,
|
|
71
|
-
tracker_state: Dict[str, Any],
|
|
72
|
-
threshold: float = 0.0,
|
|
73
|
-
k: int = 1,
|
|
69
|
+
self, query: Text, tracker_state: Dict[str, Any], threshold: float = 0.0
|
|
74
70
|
) -> SearchResultList:
|
|
75
71
|
"""Search for a document in the Qdrant vector store.
|
|
76
72
|
|
|
77
73
|
Args:
|
|
78
74
|
query: The query to search for.
|
|
79
75
|
threshold: minimum similarity score to consider a document a match.
|
|
80
|
-
k: number of results to return.
|
|
81
76
|
|
|
82
77
|
Returns:
|
|
83
78
|
A list of documents that match the query.
|
|
@@ -85,7 +80,7 @@ class Qdrant_Store(InformationRetrieval):
|
|
|
85
80
|
logger.debug("information_retrieval.qdrant_store.search", query=query)
|
|
86
81
|
try:
|
|
87
82
|
hits = await self.client.asimilarity_search(
|
|
88
|
-
query, k=
|
|
83
|
+
query, k=4, score_threshold=threshold
|
|
89
84
|
)
|
|
90
85
|
except ValidationError as e:
|
|
91
86
|
raise PayloadNotFoundException(
|
rasa/core/lock_store.py
CHANGED
|
@@ -2,18 +2,27 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
import json
|
|
5
|
-
import logging
|
|
6
5
|
import os
|
|
7
6
|
from contextlib import asynccontextmanager
|
|
8
|
-
from typing import AsyncGenerator, Dict, Optional, Text, Union
|
|
7
|
+
from typing import Any, AsyncGenerator, Dict, Literal, Optional, Text, Union
|
|
8
|
+
|
|
9
|
+
import structlog
|
|
10
|
+
from pydantic import (
|
|
11
|
+
AnyUrl,
|
|
12
|
+
BaseModel,
|
|
13
|
+
Field,
|
|
14
|
+
NonNegativeInt,
|
|
15
|
+
model_validator,
|
|
16
|
+
)
|
|
9
17
|
|
|
10
18
|
import rasa.shared.utils.common
|
|
11
19
|
from rasa.core.constants import DEFAULT_LOCK_LIFETIME
|
|
12
20
|
from rasa.core.lock import TicketLock
|
|
13
21
|
from rasa.shared.exceptions import ConnectionException, RasaException
|
|
22
|
+
from rasa.shared.utils.io import raise_deprecation_warning
|
|
14
23
|
from rasa.utils.endpoints import EndpointConfig
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
structlogger = structlog.getLogger(__name__)
|
|
17
26
|
|
|
18
27
|
|
|
19
28
|
def _get_lock_lifetime() -> int:
|
|
@@ -76,7 +85,10 @@ class LockStore:
|
|
|
76
85
|
|
|
77
86
|
Creates a new lock if none is found.
|
|
78
87
|
"""
|
|
79
|
-
|
|
88
|
+
structlogger.debug(
|
|
89
|
+
"lock_store.issue_ticket",
|
|
90
|
+
event_info=f"Issuing ticket for conversation '{conversation_id}'.",
|
|
91
|
+
)
|
|
80
92
|
try:
|
|
81
93
|
lock = self.get_or_create_lock(conversation_id)
|
|
82
94
|
ticket = lock.issue_ticket(lock_lifetime)
|
|
@@ -109,7 +121,10 @@ class LockStore:
|
|
|
109
121
|
async def _acquire_lock(
|
|
110
122
|
self, conversation_id: Text, ticket: int, wait_time_in_seconds: float
|
|
111
123
|
) -> TicketLock:
|
|
112
|
-
|
|
124
|
+
structlogger.debug(
|
|
125
|
+
"lock_store._acquiring_lock_for_conversation",
|
|
126
|
+
event_info=f"Acquiring lock for conversation '{conversation_id}'.",
|
|
127
|
+
)
|
|
113
128
|
while True:
|
|
114
129
|
# fetch lock in every iteration because lock might no longer exist
|
|
115
130
|
lock = self.get_lock(conversation_id)
|
|
@@ -120,16 +135,22 @@ class LockStore:
|
|
|
120
135
|
|
|
121
136
|
# acquire lock if it isn't locked
|
|
122
137
|
if not lock.is_locked(ticket):
|
|
123
|
-
|
|
138
|
+
structlogger.debug(
|
|
139
|
+
"lock_store._acquired_lock_for_conversation",
|
|
140
|
+
event_info=f"Acquired lock for conversation '{conversation_id}'.",
|
|
141
|
+
)
|
|
124
142
|
return lock
|
|
125
143
|
|
|
126
144
|
items_before_this = ticket - (lock.now_serving or 0)
|
|
127
145
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
146
|
+
structlogger.debug(
|
|
147
|
+
"lock_store._retrying_lock_acquisition",
|
|
148
|
+
event_info=(
|
|
149
|
+
f"Failed to acquire lock for conversation ID '{conversation_id}' "
|
|
150
|
+
f"because {items_before_this} other item(s) for this "
|
|
151
|
+
f"conversation ID have to be finished processing first. "
|
|
152
|
+
f"Retrying in {wait_time_in_seconds} seconds ..."
|
|
153
|
+
),
|
|
133
154
|
)
|
|
134
155
|
|
|
135
156
|
# sleep and update lock
|
|
@@ -186,9 +207,99 @@ class LockStore:
|
|
|
186
207
|
@staticmethod
|
|
187
208
|
def _log_deletion(conversation_id: Text, deletion_successful: bool) -> None:
|
|
188
209
|
if deletion_successful:
|
|
189
|
-
|
|
210
|
+
structlogger.debug(
|
|
211
|
+
"lock_store._deleted_lock_for_conversation",
|
|
212
|
+
event_info=f"Deleted lock for conversation '{conversation_id}'.",
|
|
213
|
+
)
|
|
190
214
|
else:
|
|
191
|
-
|
|
215
|
+
structlogger.debug(
|
|
216
|
+
"lock_store._failed_to_delete_lock_for_conversation",
|
|
217
|
+
event_info=(
|
|
218
|
+
f"Could not delete lock for conversation '{conversation_id}'."
|
|
219
|
+
),
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
class RedisLockStoreConfig(BaseModel):
|
|
224
|
+
host: Union[AnyUrl, Literal["localhost"]] = Field(
|
|
225
|
+
default="localhost", description="The host of the redis server."
|
|
226
|
+
)
|
|
227
|
+
port: NonNegativeInt = Field(
|
|
228
|
+
default=6379, ge=0, le=65535, description="The port of the redis server."
|
|
229
|
+
)
|
|
230
|
+
db: NonNegativeInt = Field(
|
|
231
|
+
default=0,
|
|
232
|
+
ge=0,
|
|
233
|
+
description="The name of the database within Redis "
|
|
234
|
+
"which should be used by Rasa",
|
|
235
|
+
)
|
|
236
|
+
username: Optional[str] = Field(
|
|
237
|
+
default=None,
|
|
238
|
+
description="The username which should be used for "
|
|
239
|
+
"authentication with the Redis database.",
|
|
240
|
+
)
|
|
241
|
+
password: Optional[str] = Field(
|
|
242
|
+
default=None,
|
|
243
|
+
description="The username which should be used for "
|
|
244
|
+
"authentication with the Redis database.",
|
|
245
|
+
)
|
|
246
|
+
use_ssl: bool = Field(
|
|
247
|
+
default=False,
|
|
248
|
+
serialization_alias="ssl",
|
|
249
|
+
description="True if SSL should be used for the connection to Redis.",
|
|
250
|
+
)
|
|
251
|
+
ssl_certfile: Optional[str] = Field(
|
|
252
|
+
default=None,
|
|
253
|
+
description="Path to the SSL certificate file.",
|
|
254
|
+
)
|
|
255
|
+
ssl_keyfile: Optional[str] = Field(
|
|
256
|
+
default=None, description="Path to the SSL private key file."
|
|
257
|
+
)
|
|
258
|
+
ssl_ca_certs: Optional[str] = Field(
|
|
259
|
+
default=None, description="Path to the SSL CA certificate file."
|
|
260
|
+
)
|
|
261
|
+
key_prefix: Optional[str] = Field(
|
|
262
|
+
default=None,
|
|
263
|
+
description="Prefix to prepend to all keys "
|
|
264
|
+
"used by the lock store. Must be alphanumeric.",
|
|
265
|
+
)
|
|
266
|
+
socket_timeout: float = Field(
|
|
267
|
+
default=DEFAULT_SOCKET_TIMEOUT_IN_SECONDS,
|
|
268
|
+
description="Timeout in seconds after which an exception "
|
|
269
|
+
"will be raised in case Redis doesn't respond "
|
|
270
|
+
"within `socket_timeout` seconds.",
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
@model_validator(mode="before")
|
|
274
|
+
@classmethod
|
|
275
|
+
def validate_url_and_host_properties(cls, data: Any) -> Any:
|
|
276
|
+
if isinstance(data, dict):
|
|
277
|
+
if bool(data.get("url", None)) and bool(data.get("host", None)):
|
|
278
|
+
raise RasaException(
|
|
279
|
+
"You cannot specify both 'url' and 'host' in the Redis lock store "
|
|
280
|
+
"configuration. Please use only one of them."
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
if data.get("url", None):
|
|
284
|
+
raise_deprecation_warning(
|
|
285
|
+
"The 'url' property in the redis lock store "
|
|
286
|
+
"configuration is deprecated. Please use 'host' instead."
|
|
287
|
+
)
|
|
288
|
+
data["host"] = data.pop("url")
|
|
289
|
+
return data
|
|
290
|
+
|
|
291
|
+
@model_validator(mode="after")
|
|
292
|
+
def verify_username_password(self) -> RedisLockStoreConfig:
|
|
293
|
+
if bool(self.username) ^ bool(self.password):
|
|
294
|
+
raise ValueError(
|
|
295
|
+
f"Expected username and password. "
|
|
296
|
+
f"Found: username: {'<has value>' if self.username else '<N/A>'}, "
|
|
297
|
+
f"password: {'<has value>' if self.password else '<N/A>'}"
|
|
298
|
+
)
|
|
299
|
+
return self
|
|
300
|
+
|
|
301
|
+
def to_strict_redis(self) -> Dict[str, Any]:
|
|
302
|
+
return self.model_dump(by_alias=True, exclude={"key_prefix"})
|
|
192
303
|
|
|
193
304
|
|
|
194
305
|
class RedisLockStore(LockStore):
|
|
@@ -196,57 +307,28 @@ class RedisLockStore(LockStore):
|
|
|
196
307
|
|
|
197
308
|
def __init__(
|
|
198
309
|
self,
|
|
199
|
-
|
|
200
|
-
port: int = 6379,
|
|
201
|
-
db: int = 1,
|
|
202
|
-
username: Optional[Text] = None,
|
|
203
|
-
password: Optional[Text] = None,
|
|
204
|
-
use_ssl: bool = False,
|
|
205
|
-
ssl_certfile: Optional[Text] = None,
|
|
206
|
-
ssl_keyfile: Optional[Text] = None,
|
|
207
|
-
ssl_ca_certs: Optional[Text] = None,
|
|
208
|
-
key_prefix: Optional[Text] = None,
|
|
209
|
-
socket_timeout: float = DEFAULT_SOCKET_TIMEOUT_IN_SECONDS,
|
|
310
|
+
config: RedisLockStoreConfig = RedisLockStoreConfig(),
|
|
210
311
|
) -> None:
|
|
211
312
|
"""Create a lock store which uses Redis for persistence.
|
|
212
313
|
|
|
213
314
|
Args:
|
|
214
|
-
|
|
215
|
-
port: The port of the redis server.
|
|
216
|
-
db: The name of the database within Redis which should be used by Rasa
|
|
217
|
-
Open Source.
|
|
218
|
-
username: The username which should be used for authentication with the
|
|
219
|
-
Redis database.
|
|
220
|
-
password: The password which should be used for authentication with the
|
|
221
|
-
Redis database.
|
|
222
|
-
use_ssl: `True` if SSL should be used for the connection to Redis.
|
|
223
|
-
ssl_certfile: Path to the SSL certificate file.
|
|
224
|
-
ssl_keyfile: Path to the SSL private key file.
|
|
225
|
-
ssl_ca_certs: Path to the SSL CA certificate file.
|
|
226
|
-
key_prefix: prefix to prepend to all keys used by the lock store. Must be
|
|
227
|
-
alphanumeric.
|
|
228
|
-
socket_timeout: Timeout in seconds after which an exception will be raised
|
|
229
|
-
in case Redis doesn't respond within `socket_timeout` seconds.
|
|
315
|
+
config: Redis lock store configuration.
|
|
230
316
|
"""
|
|
231
317
|
import redis
|
|
232
318
|
|
|
233
|
-
self.
|
|
234
|
-
|
|
235
|
-
port=int(port),
|
|
236
|
-
db=int(db),
|
|
237
|
-
username=username,
|
|
238
|
-
password=password,
|
|
239
|
-
ssl=use_ssl,
|
|
240
|
-
ssl_certfile=ssl_certfile,
|
|
241
|
-
ssl_keyfile=ssl_keyfile,
|
|
242
|
-
ssl_ca_certs=ssl_ca_certs,
|
|
243
|
-
socket_timeout=socket_timeout,
|
|
244
|
-
)
|
|
319
|
+
self.config = config
|
|
320
|
+
self.red = redis.StrictRedis(**self.config.to_strict_redis())
|
|
245
321
|
|
|
246
322
|
self.key_prefix = DEFAULT_REDIS_LOCK_STORE_KEY_PREFIX
|
|
247
|
-
if key_prefix:
|
|
248
|
-
|
|
249
|
-
|
|
323
|
+
if self.config.key_prefix:
|
|
324
|
+
structlogger.debug(
|
|
325
|
+
"redis_lock_store._set_key_prefix.non_default_key_prefix",
|
|
326
|
+
event_info=(
|
|
327
|
+
f"Setting non-default "
|
|
328
|
+
f"redis key prefix: '{self.config.key_prefix}'.",
|
|
329
|
+
),
|
|
330
|
+
)
|
|
331
|
+
self._set_key_prefix(self.config.key_prefix)
|
|
250
332
|
|
|
251
333
|
super().__init__()
|
|
252
334
|
|
|
@@ -254,9 +336,13 @@ class RedisLockStore(LockStore):
|
|
|
254
336
|
if isinstance(key_prefix, str) and key_prefix.isalnum():
|
|
255
337
|
self.key_prefix = key_prefix + ":" + DEFAULT_REDIS_LOCK_STORE_KEY_PREFIX
|
|
256
338
|
else:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
339
|
+
structlogger.warning(
|
|
340
|
+
"redis_lock_store._set_key_prefix.default_instead_of_invalid_key_prefix",
|
|
341
|
+
event_info=(
|
|
342
|
+
f"Omitting provided non-alphanumeric "
|
|
343
|
+
f"redis key prefix: '{key_prefix}'. "
|
|
344
|
+
f"Using default '{self.key_prefix}' instead."
|
|
345
|
+
),
|
|
260
346
|
)
|
|
261
347
|
|
|
262
348
|
def get_lock(self, conversation_id: Text) -> Optional[TicketLock]:
|
|
@@ -313,7 +399,9 @@ def _create_from_endpoint_config(
|
|
|
313
399
|
|
|
314
400
|
lock_store: LockStore = InMemoryLockStore()
|
|
315
401
|
elif endpoint_config.type == "redis":
|
|
316
|
-
|
|
402
|
+
config = RedisLockStoreConfig.model_validate(endpoint_config.to_dict())
|
|
403
|
+
|
|
404
|
+
lock_store = RedisLockStore(config)
|
|
317
405
|
elif endpoint_config.type == "concurrent_redis":
|
|
318
406
|
from rasa.core.concurrent_lock_store import ConcurrentRedisLockStore
|
|
319
407
|
|
|
@@ -321,7 +409,10 @@ def _create_from_endpoint_config(
|
|
|
321
409
|
else:
|
|
322
410
|
lock_store = _load_from_module_name_in_endpoint_config(endpoint_config)
|
|
323
411
|
|
|
324
|
-
|
|
412
|
+
structlogger.debug(
|
|
413
|
+
"lock_store._create_from_endpoint_config.lock_store_connected",
|
|
414
|
+
event_info=f"Connected to lock store '{lock_store.__class__.__name__}'.",
|
|
415
|
+
)
|
|
325
416
|
|
|
326
417
|
return lock_store
|
|
327
418
|
|
|
@@ -27,6 +27,7 @@ from rasa.shared.nlu.constants import (
|
|
|
27
27
|
PROMPTS,
|
|
28
28
|
)
|
|
29
29
|
from rasa.shared.providers.llm.llm_response import LLMResponse, measure_llm_latency
|
|
30
|
+
from rasa.shared.utils.constants import LOG_COMPONENT_SOURCE_METHOD_INIT
|
|
30
31
|
from rasa.shared.utils.health_check.llm_health_check_mixin import LLMHealthCheckMixin
|
|
31
32
|
from rasa.shared.utils.llm import (
|
|
32
33
|
DEFAULT_OPENAI_GENERATE_MODEL_NAME,
|
|
@@ -105,6 +106,8 @@ class ContextualResponseRephraser(
|
|
|
105
106
|
self.prompt_template = get_prompt_template(
|
|
106
107
|
self.nlg_endpoint.kwargs.get(PROMPT_CONFIG_KEY),
|
|
107
108
|
DEFAULT_RESPONSE_VARIATION_PROMPT_TEMPLATE,
|
|
109
|
+
log_source_component=ContextualResponseRephraser.__name__,
|
|
110
|
+
log_source_method=LOG_COMPONENT_SOURCE_METHOD_INIT,
|
|
108
111
|
)
|
|
109
112
|
self.rephrase_all = self.nlg_endpoint.kwargs.get(
|
|
110
113
|
"rephrase_all", DEFAULT_REPHRASE_ALL
|