mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
Add source to the answer for default prompt (#2289)
* Add source to the answer for default prompt * Fix qdrant * Fix tests * Update docstring * Fix check files * Fix qdrant test error
This commit is contained in:
@@ -69,7 +69,7 @@ class TestRetrieveUtils:
|
||||
def test_split_files_to_chunks(self):
|
||||
pdf_file_path = os.path.join(test_dir, "example.pdf")
|
||||
txt_file_path = os.path.join(test_dir, "example.txt")
|
||||
chunks = split_files_to_chunks([pdf_file_path, txt_file_path])
|
||||
chunks, _ = split_files_to_chunks([pdf_file_path, txt_file_path])
|
||||
assert all(
|
||||
isinstance(chunk, str) and "AutoGen is an advanced tool designed to assist developers" in chunk.strip()
|
||||
for chunk in chunks
|
||||
@@ -81,7 +81,7 @@ class TestRetrieveUtils:
|
||||
pdf_file_path = os.path.join(test_dir, "example.pdf")
|
||||
txt_file_path = os.path.join(test_dir, "example.txt")
|
||||
files = get_files_from_dir([pdf_file_path, txt_file_path])
|
||||
assert all(os.path.isfile(file) for file in files)
|
||||
assert all(os.path.isfile(file) if isinstance(file, str) else os.path.isfile(file[0]) for file in files)
|
||||
files = get_files_from_dir(
|
||||
[
|
||||
pdf_file_path,
|
||||
@@ -91,7 +91,7 @@ class TestRetrieveUtils:
|
||||
],
|
||||
recursive=True,
|
||||
)
|
||||
assert all(os.path.isfile(file) for file in files)
|
||||
assert all(os.path.isfile(file) if isinstance(file, str) else os.path.isfile(file[0]) for file in files)
|
||||
files = get_files_from_dir(
|
||||
[
|
||||
pdf_file_path,
|
||||
@@ -102,7 +102,7 @@ class TestRetrieveUtils:
|
||||
recursive=True,
|
||||
types=["pdf", "txt"],
|
||||
)
|
||||
assert all(os.path.isfile(file) for file in files)
|
||||
assert all(os.path.isfile(file) if isinstance(file, str) else os.path.isfile(file[0]) for file in files)
|
||||
assert len(files) == 3
|
||||
|
||||
def test_is_url(self):
|
||||
@@ -243,7 +243,7 @@ class TestRetrieveUtils:
|
||||
pdf_file_path = os.path.join(test_dir, "example.pdf")
|
||||
txt_file_path = os.path.join(test_dir, "example.txt")
|
||||
word_file_path = os.path.join(test_dir, "example.docx")
|
||||
chunks = split_files_to_chunks([pdf_file_path, txt_file_path, word_file_path])
|
||||
chunks, _ = split_files_to_chunks([pdf_file_path, txt_file_path, word_file_path])
|
||||
assert all(
|
||||
isinstance(chunk, str) and "AutoGen is an advanced tool designed to assist developers" in chunk.strip()
|
||||
for chunk in chunks
|
||||
|
||||
Reference in New Issue
Block a user