Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified search wiki test #262

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions test/functions/test_search_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
import wikipedia

from camel.functions.search_functions import search_wiki


Expand All @@ -32,17 +34,7 @@ def test_search_wiki_not_found():
"entity to be searched.")


def tests_search_wiki_with_ambiguity():
expected_output = (
"New York, often called New York State, is a state in the"
" Northeastern United States. A Mid-Atlantic state, New York"
" borders New England, and has an international border with Canada."
" With almost 19.7 million residents, it is the fourth-most populous "
"state in the United States and seventh-most densely populated as of "
"2022. New York is the 27th-largest U.S. state by area, with a total "
"area of 54,556 square miles (141,300 km2).New York has a varied "
"geography. The southeastern part of the state, known as Downstate, "
"encompasses New York City (the most populous city in the United "
"States), Long Island (the most populous island in the United States)"
", and the lower Hudson Valley.")
def test_search_wiki_with_ambiguity():
expected_output = wikipedia.summary("New York (state)", sentences=5,
auto_suggest=False)
assert search_wiki("New York") == expected_output