langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.26k stars 7.2k forks source link

pubmed search tools "PubMed exception: HTTP Error 400: Bad Request" #9361

Open sydxy4ever opened 2 weeks ago

sydxy4ever commented 2 weeks ago

Self Checks

Dify version

0.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

when i used pubmed search tools, returns "PubMed exception: HTTP Error 400: Bad Request"

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 2 weeks ago

@sydxy4ever Hello there! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve this issue.

To resolve the "PubMed exception: HTTP Error 400: Bad Request" in Dify version 0.9.1 on a self-hosted Docker setup, consider the following steps:

  1. Query Length: Ensure the query string does not exceed 300 characters, as it is truncated to this length before processing.

  2. URL Encoding: Verify that the query is correctly URL-encoded using urllib.parse.quote(query).

  3. Email Parameter: Check that the email parameter is set correctly in the PubMedAPIWrapper class, as it is often required by the PubMed API.

  4. Check for Empty Query: Make sure the query is not empty, as the method checks for this and returns a message if the query is missing.

If these checks do not resolve the issue, further investigation into the specific query and HTTP request may be necessary [1].

To continue talking to Dosu, mention @dosu.