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

Project's default search endpoint not working (https://wikichat.genie.stanford.edu/search) #39

Open
AIconicInsight opened this issue Dec 3, 2024 · 1 comment

Comments

@AIconicInsight
Copy link

AIconicInsight commented Dec 3, 2024

I tested the project in the command line version but the retrieval does not work:
The default search endpoint (https://wikichat.genie.stanford.edu/search) does not allow the used post method, see below. The code uses the POST method, however it seems only the GET method is allowed for this URL.

Also, the endpoint documentation https://wikichat.genie.stanford.edu/search/redoc reroutes to https://wikichat.genie.stanford.edu/, so it cannot be viewed.

Code taken from https://github.com/stanford-oval/WikiChat/blob/main/pipelines/retriever.py#L355-L365 (modified)

Test endpoint as it is used in the default pipeline:

import requests

query_text = "Is tomato a fruit or vegetable?"
retriever_endpoint = "https://wikichat.genie.stanford.edu/search"

evi_num = 20
block_type_limits = {}

response = requests.post(
    retriever_endpoint,
    json={
        "query": [query_text],
        "num_blocks": (
            evi_num + 20 if len(block_type_limits) > 0 else evi_num
        ),  # Retrieve more if we need to limit block types
    },
)
print(f"Status code: {response.status_code}")
print(response.json())

Output:

Status code: 405
{'detail': 'Method Not Allowed'}

Check for allowed methods:

response = requests.options("https://wikichat.genie.stanford.edu/search")
print(response.headers.get("Allow"))

Output:

GET
@s-jse
Copy link
Member

s-jse commented Dec 3, 2024

Thank you for reporting this. We have recently changed the search backend API to add new features and corpora. The documentation for that is available at https://search.genie.stanford.edu/redoc. One thing that changed is the URL should be https://search.genie.stanford.edu/wikipedia, but API fields have changed a bit as well.

We will make the necessary changes to this repository soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants