Skip to content

Commit

Permalink
Database action fix. (#1111)
Browse files Browse the repository at this point in the history
Co-authored-by: Nupur Khare <[email protected]>
Co-authored-by: udit-pandey <[email protected]>
  • Loading branch information
3 people authored Jan 5, 2024
1 parent 6a6540f commit 0fbecb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion kairon/actions/definitions/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self, bot: Text, name: Text):
"""
self.bot = bot
self.name = name
self.suffix = "_faq_embd"
self.__response = None
self.__is_success = False

Expand Down Expand Up @@ -68,7 +69,7 @@ async def execute(self, dispatcher: CollectingDispatcher, tracker: Tracker, doma
vector_action_config = self.retrieve_config()
dispatch_bot_response = vector_action_config['response']['dispatch']
failure_response = vector_action_config['failure_response']
collection_name = vector_action_config['collection']
collection_name = f"{self.bot}_{vector_action_config['collection']}{self.suffix}"
db_type = vector_action_config['db_type']
vector_db = VectorEmbeddingsDbFactory.get_instance(db_type)(collection_name)
operation_type = vector_action_config['query_type']
Expand Down
8 changes: 4 additions & 4 deletions tests/integration_test/action_service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,7 @@ def test_vectordb_action_execution_embedding_search_from_value():
user="user"
).save()

http_url = 'http://localhost:6333/collections/test_vectordb_action_execution/points'
http_url = 'http://localhost:6333/collections/5f50fd0a56b698ca10d75d2e_test_vectordb_action_execution_faq_embd/points'
resp_msg = json.dumps(
{
"time": 0,
Expand Down Expand Up @@ -2984,7 +2984,7 @@ def test_vectordb_action_execution_payload_search_from_value():
user="user"
).save()

http_url = 'http://localhost:6333/collections/test_vectordb_action_execution_payload_search_from_value/points/scroll'
http_url = 'http://localhost:6333/collections/5f50md0a56b698ca10d35d2e_test_vectordb_action_execution_payload_search_from_value_faq_embd/points/scroll'
resp_msg = json.dumps(
[{"id": 2, "city": "London", "color": "red"}]
)
Expand Down Expand Up @@ -3123,7 +3123,7 @@ def test_vectordb_action_execution_payload_search_from_slot():
user="user"
).save()

http_url = 'http://localhost:6333/collections/test_vectordb_action_execution_embedding_search_from_slot/points'
http_url = 'http://localhost:6333/collections/5f50fx0a56b698ca10d35d2e_test_vectordb_action_execution_embedding_search_from_slot_faq_embd/points'
resp_msg = json.dumps(
{
"time": 0,
Expand Down Expand Up @@ -3208,7 +3208,7 @@ def test_vectordb_action_execution_no_response_dispatch():
user="user"
).save()

http_url = 'http://localhost:6333/collections/test_vectordb_action_execution_no_response_dispatch/points'
http_url = 'http://localhost:6333/collections/5f50fd0a56v098ca10d75d2e_test_vectordb_action_execution_no_response_dispatch_faq_embd/points'
resp_msg = json.dumps(
{
"time": 0,
Expand Down

0 comments on commit 0fbecb7

Please sign in to comment.