Fix chat_client configurations for OpenAI chat director tests

This commit is contained in:
Debanjum Singh Solanky
2023-11-10 17:29:23 -08:00
parent 9b6c5ddba4
commit c9c0ba67c6
2 changed files with 4 additions and 1 deletions

View File

@@ -235,7 +235,7 @@ def chat_client(search_config: SearchConfig, default_user2: KhojUser):
OpenAIProcessorConversationConfigFactory()
UserConversationProcessorConfigFactory(user=default_user2, setting=chat_model)
state.anonymous_mode = False
state.anonymous_mode = True
app = FastAPI()
@@ -253,7 +253,9 @@ def chat_client_no_background(search_config: SearchConfig, default_user2: KhojUs
# Initialize Processor from Config
if os.getenv("OPENAI_API_KEY"):
chat_model = ChatModelOptionsFactory(chat_model="gpt-3.5-turbo", model_type="openai")
OpenAIProcessorConversationConfigFactory()
UserConversationProcessorConfigFactory(user=default_user2, setting=chat_model)
state.anonymous_mode = True

View File

@@ -307,6 +307,7 @@ def test_ask_for_clarification_if_not_enough_context_in_question(chat_client_no_
"which one is",
"which of namita's sons",
"the birth order",
"provide more context",
]
assert response.status_code == 200
assert any([expected_response in response_message.lower() for expected_response in expected_responses]), (