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/ Add support for XML file format #757

Merged
merged 7 commits into from
Oct 6, 2023
Merged

Conversation

OjusWiZard
Copy link
Contributor

@OjusWiZard OjusWiZard commented Oct 2, 2023

Description

  • I've added a new loader and a chunker specifically for XML file format. The loader is OK but the chunker is the same as most of the others (maybe we can refactor this to respect DRY).
  • Wired up both of them in other places to link them with the entry point.
  • Added a test for the loader
  • Also, there was one small styling that black did.

Fixes #714

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Refactor (does not change functionality, e.g. code style improvements, linting)

How Has This Been Tested?

I've added one test for the loader. Also, tested with a custom script as follows:

from os import environ
from embedchain import App

environ["OPENAI_API_KEY"] = "xxx"
app = App()
app.add("xml.xml")
response = app.query("What is the given context?")
print(response)

Please delete options that are not relevant.

  • Unit Test
  • Test Script (please provide)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

Copy link
Collaborator

@deshraj deshraj left a comment

Choose a reason for hiding this comment

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

Neat @OjusWiZard. Thank you for your contribution!

docs/data-sources/xml.mdx Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Files Coverage Δ
embedchain/data_formatter/data_formatter.py 87.27% <100.00%> (+0.48%) ⬆️
embedchain/loaders/xml.py 100.00% <100.00%> (ø)
embedchain/models/data_type.py 100.00% <100.00%> (ø)
embedchain/utils.py 69.14% <50.00%> (-1.19%) ⬇️
embedchain/chunkers/xml.py 66.66% <66.66%> (ø)

📢 Thoughts on this report? Let us know!.

@deshraj deshraj merged commit 540a0a3 into mem0ai:main Oct 6, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for xml file format
3 participants