Open k0286 opened 2 hours ago
Hey there, @k0286! I'm here to help you with bug fixes, answer your questions, and guide you on how to become a contributor to the project. Let's tackle this issue together!
I found a similar issue related to a 400 Bad Request error when adding an API endpoint in Dify. The validation criteria in the external_knowledge_service.py
file could be causing this error. Specifically, the check_endpoint_and_api_key
method ensures that both the endpoint
and api_key
are present and valid. If either is missing or incorrectly formatted, a 400 Bad Request error is returned [1].
To resolve this, ensure that:
endpoint
is correctly specified and is a valid URL.api_key
is provided and correctly formatted.These validations are crucial for the successful addition of an external API endpoint in Dify. If the issue persists, double-check the endpoint URL and API key for any discrepancies.
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.10.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Add an External Knowledge API
function in the DIFY's web UI.http://ragflow:9999/api/v1/dify
✔️ Expected Behavior
The API endpoint should be added to DIFY.
❌ Actual Behavior
The API endpoint will be blocked by the
validators
https://github.com/langgenius/dify/blob/aa11141660077618c7ee7f66c1d53017f4c2d4e5/api/services/external_knowledge_service.py#L71and return 400 Bad Request.