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 method - detect format / data_type #380

Merged
merged 78 commits into from
Aug 16, 2023

Conversation

cachho
Copy link
Contributor

@cachho cachho commented Jul 27, 2023

Description

Automatically detect and use the data_type in add method.

  • a quite sophisticated system to detect the data_type (checks if it's a url, string, local file and then the file extension)
  • added tons of unit tests
  • documentation changes

breaking change because the first argument of add is now the source/content, not the data type.

Changes the order of arguments, because ``

Fixes #168 #76

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Please delete options that are not relevant.

  • Unit Test

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented 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

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed

@cachho
Copy link
Contributor Author

cachho commented Aug 9, 2023

New update uses a DataType model. This increases type safety and makes it possible to list the accepted data_types.

embedchain/embedchain.py Outdated Show resolved Hide resolved
if self.config.id is not None:
metadatas = [{**m, "app_id": self.config.id} for m in metadatas]
# Loop though all metadatas and add extras.
new_metadatas = []
Copy link
Member

Choose a reason for hiding this comment

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

we should append the Successfully saved https://nav.al/agi. New chunks count print statement. We should show the data type deduced here, so that everyone has visibility of the data type and can corrections if needed.

I know about the logging part, but a lot of users might not use logging. Hence the ask

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea

about the logging: warning and above are displayed by default. lower has to be enabled.

@taranjeet taranjeet merged commit 4c8876f into mem0ai:main Aug 16, 2023
3 checks passed
@cachho cachho deleted the feat/DetectFormat branch September 3, 2023 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants