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

Minor enhancements needed to use this package in additional projects #1004

Open
sedletsky-f5 opened this issue Sep 5, 2024 · 2 comments
Open

Comments

@sedletsky-f5
Copy link

  1. In my current project, there is a strict requirement to have go v1.21 while later versions like v1.22 are not allowed. The only change needed is go 1.22.0 => go 1.21.0 in go.mod file. I tried locally and it works fine.
  2. Also in my project, I need to load Markdown files with extension .mdx (rather than .md) while the content format is the same. To support this extension just need to change condition filepath.Ext(file.Name()) != ".md" to (filepath.Ext(file.Name()) != ".md" && filepath.Ext(file.Name()) != ".mdx") in documentloaders/notion.go

These changes will not impact existing behavior and no regressions are expected. I already prepared these changes locally, so if you are OK with them - please give me permissions to commit/merge and I will send PR for review.

Thanks.

@sedletsky-f5
Copy link
Author

diff --git a/documentloaders/notion.go b/documentloaders/notion.go
index 0dacbe7..c59b696 100644
--- a/documentloaders/notion.go
+++ b/documentloaders/notion.go
@@ -39,7 +39,7 @@ func (n *NotionDirectoryLoader) Load() ([]schema.Document, error) {
 
        documents := make([]schema.Document, 0, len(files))
        for _, file := range files {
-               if file.IsDir() || filepath.Ext(file.Name()) != ".md" {
+               if file.IsDir() || (filepath.Ext(file.Name()) != ".md" && filepath.Ext(file.Name()) != ".mdx") {
                        continue
                }
 
diff --git a/go.mod b/go.mod
index 6401ef7..214b001 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module github.com/tmc/langchaingo
 
-go 1.22.0
+go 1.21.0

@sedletsky-f5
Copy link
Author

sedletsky-f5 commented Sep 30, 2024

@tmc can you please take a look here? it is a very small change that will allow me to use your package (rather than forking it). thanks.

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

No branches or pull requests

1 participant