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(go/plugins/firebase): add firestore retriever to go firebase plugin #791

Open
wants to merge 7 commits into
base: next
Choose a base branch
from

Conversation

cabljac
Copy link
Contributor

@cabljac cabljac commented Aug 16, 2024

This PR adds a firestore retriever helper to the Go plugin

(Merge #790 first)

Resolves #711

Checklist (if applicable):

  • Tested (manually, unit tested, etc.)
  • Changelog updated
  • Docs updated

@cabljac cabljac mentioned this pull request Aug 16, 2024
3 tasks
@cabljac cabljac changed the base branch from main to next August 30, 2024 08:29
@cabljac cabljac changed the title feat(go): add firestore retriever to go firebase plugin feat(go/plugins/firebase): add firestore retriever to go firebase plugin Aug 30, 2024
go/plugins/firebase/firebase.go Outdated Show resolved Hide resolved
go/plugins/firebase/retriever.go Outdated Show resolved Hide resolved
go/plugins/firebase/retriever.go Outdated Show resolved Hide resolved
go/plugins/firebase/retriever.go Outdated Show resolved Hide resolved
go/plugins/firebase/retriever.go Outdated Show resolved Hide resolved
go/plugins/firebase/retriever.go Outdated Show resolved Hide resolved
go/plugins/firebase/retriever.go Show resolved Hide resolved
go/plugins/firebase/retriever.go Outdated Show resolved Hide resolved
go/plugins/firebase/retriever_test.go Outdated Show resolved Hide resolved
t.Error("retrieved document is nil")
}
}
fmt.Printf("Doc with content \n\n %s \n\n retrieved \n\n", resp.Documents[0].Content[0].Text)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused: where does this test add documents to the collection?

Anyway, assuming you know the documents, you can do a little better here by checking their content, or at least part of their content (like a substring).

Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't see where the documents come from. If they have to be present in the DB already, add a comment explaining that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup! will sort this out, applying these changes when I can in between some js work


coll := cfg.Client.Collection(cfg.Collection)
if coll == nil {
return nil, fmt.Errorf("collection path is invalid")
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt.Errorf("DefineFirestoreRetriever: collection path %q is invalid", cfg.Collection)

Also I wonder if we could call this outside the closure to check the error earlier.

t.Error("retrieved document is nil")
}
}
fmt.Printf("Doc with content \n\n %s \n\n retrieved \n\n", resp.Documents[0].Content[0].Text)
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't see where the documents come from. If they have to be present in the DB already, add a comment explaining that.

@cabljac cabljac force-pushed the @invertase/firestore-retriever-go branch 4 times, most recently from 521a059 to 32c9d3c Compare September 26, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[Go] Add retriever plugin for firestore vector store
3 participants