Remove unused parameter from configure_search_type method

This commit is contained in:
Debanjum Singh Solanky
2023-11-14 19:05:09 -08:00
parent f8e5e118e1
commit 8f200cf53f
4 changed files with 7 additions and 13 deletions

View File

@@ -227,7 +227,7 @@ def md_content_config():
def chat_client(search_config: SearchConfig, default_user2: KhojUser):
# Initialize app state
state.config.search_type = search_config
state.SearchType = configure_search_types(state.config)
state.SearchType = configure_search_types()
LocalMarkdownConfig.objects.create(
input_files=None,
@@ -261,7 +261,7 @@ def chat_client(search_config: SearchConfig, default_user2: KhojUser):
def chat_client_no_background(search_config: SearchConfig, default_user2: KhojUser):
# Initialize app state
state.config.search_type = search_config
state.SearchType = configure_search_types(state.config)
state.SearchType = configure_search_types()
# Initialize Processor from Config
if os.getenv("OPENAI_API_KEY"):
@@ -296,7 +296,7 @@ def client(
):
state.config.content_type = content_config
state.config.search_type = search_config
state.SearchType = configure_search_types(state.config)
state.SearchType = configure_search_types()
state.embeddings_model = EmbeddingsModel()
state.cross_encoder_model = CrossEncoderModel()
@@ -330,7 +330,7 @@ def client(
def client_offline_chat(search_config: SearchConfig, default_user2: KhojUser):
# Initialize app state
state.config.search_type = search_config
state.SearchType = configure_search_types(state.config)
state.SearchType = configure_search_types()
LocalMarkdownConfig.objects.create(
input_files=None,

View File

@@ -203,9 +203,6 @@ def test_get_api_config_types(client, sample_org_data, default_user: KhojUser):
@pytest.mark.django_db(transaction=True)
def test_get_configured_types_with_no_content_config(fastapi_app: FastAPI):
# Arrange
state.SearchType = configure_search_types(config)
original_config = state.config.content_type
state.config.content_type = None
state.anonymous_mode = True
configure_routes(fastapi_app)
@@ -218,9 +215,6 @@ def test_get_configured_types_with_no_content_config(fastapi_app: FastAPI):
assert response.status_code == 200
assert response.json() == ["all"]
# Restore
state.config.content_type = original_config
# ----------------------------------------------------------------------------------------------------
@pytest.mark.django_db(transaction=True)