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

Feat:Compatible with Dify's External Knowledge API #2848

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

Howe829
Copy link
Contributor

@Howe829 Howe829 commented Oct 15, 2024

What problem does this PR solve?

Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR.
Fixes #2731

Type of change

  • New Feature (non-breaking change which adds functionality)

@Howe829 Howe829 force-pushed the feat/retrieval_api branch from 6ffa145 to 60fe7a6 Compare October 15, 2024 08:15
from utils.api_utils import validate_request, build_error_result, apikey_required


@manager.route('/retrieval', methods=['POST'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@manager.route('/retrieval', methods=['POST'])
@manager.route('/dify_retrieval', methods=['POST'])

Copy link
Contributor Author

@Howe829 Howe829 Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image Thanks for your comment but the api request url needs to be "endpoint/retrieval". https://docs.dify.ai/guides/knowledge-base/external-knowledge-api-documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added dify to url prefix and changed the filename, PTAL.

@KevinHuSh KevinHuSh merged commit e1e5711 into infiniflow:main Oct 15, 2024
1 check passed
@nicklhy
Copy link

nicklhy commented Oct 18, 2024

@Howe829 Hi, I just did a few tests of this retrieval api in dify and opened an issue here. It seems the type of metadata was wrongly written in dify's doc as string. Indeed, it should be a dict.

Could you please repair the code here ? I guess simply set metadict = {} is ok ?

langgenius/dify#9448 (comment)

@Howe829
Copy link
Contributor Author

Howe829 commented Nov 1, 2024

@Howe829 Hi, I just did a few tests of this retrieval api in dify and opened an issue here. It seems the type of metadata was wrongly written in dify's doc as string. Indeed, it should be a dict.

Could you please repair the code here ? I guess simply set metadict = {} is ok ?

langgenius/dify#9448 (comment)

Sorry for the bug.I am quite busy recently, so I have no time to deal with it. Thanks for your fix!

@nicklhy
Copy link

nicklhy commented Nov 6, 2024

already solved in #3076

Halfknow pushed a commit to Halfknow/ragflow that referenced this pull request Nov 11, 2024
### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._
Fixes infiniflow#2731 
### Type of change

- [x] New Feature (non-breaking change which adds functionality)
@JinHai-CN JinHai-CN mentioned this pull request Jan 13, 2025
1 task
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

Successfully merging this pull request may close these issues.

[Feature Request]: Please Build a Retrieval API
3 participants