Skip to content

Commit

Permalink
updated the test case
Browse files Browse the repository at this point in the history
  • Loading branch information
adeelehsan committed Nov 20, 2024
1 parent 0a485cd commit fa3c082
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions int_tests/test_chat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import time
import unittest
from datetime import timedelta
from pathlib import Path
Expand All @@ -24,7 +23,7 @@ def setUp(self):
self.search_params = SearchCorporaParameters(
corpora=[
KeyedSearchCorpus(
corpus_key=self.key,
corpus_key="int-test-upload-fern",
lexical_interpolation=0,
)
],
Expand All @@ -41,7 +40,7 @@ def setUp(self):
citations=CitationParameters(
style="none",
),
enable_factual_consistency_score=True,
enable_factual_consistency_score=False,
)
self.chat_params = ChatParameters(store=True)

Expand All @@ -53,7 +52,7 @@ def setUp(self):

def test_chat(self):
response = self.client.chat(
query="what is vectara?",
query="Robot Utility Models",
search=self.search_params,
generation=self.generation_params,
chat=self.chat_params
Expand Down
6 changes: 3 additions & 3 deletions src/vectara/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def chat(
self,
*,
query: str,
search: typing.Optional[SearchCorporaParameters] = OMIT,
search: SearchCorporaParameters = OMIT,
request_timeout: typing.Optional[int] = None,
request_timeout_millis: typing.Optional[int] = None,
generation: typing.Optional[GenerationParameters] = OMIT,
Expand Down Expand Up @@ -136,8 +136,8 @@ def chat(
ChatFullResponse
"""

if not chat_id and not search:
raise ValueError("`search` parameter is required when `chat_id` is not provided.")
# if not chat_id and not search:
# raise ValueError("`search` parameter is required when `chat_id` is not provided.")

if chat_id:
session = self.session_manager.get_session(chat_id)
Expand Down

0 comments on commit fa3c082

Please sign in to comment.