-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add Spring Boot auto-configuration for Neo4j vector store #191
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @King-Chau
It looks great! I have few minor recommendations about the code style and one important concern about exposing the org.neo4j.*
in the spring-ai API.
Btw, your PR made me review the other vector stores and I've tried to clean the similar issues there.
/** | ||
* @author Jingzhou Ou | ||
*/ | ||
@ConfigurationProperties(CONFIG_PREFIX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change to @ConfigurationProperties(Neo4jVectorStoreProperties.CONFIG_PREFIX)
to ged rid of the static import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will change
* @author Jingzhou Ou | ||
*/ | ||
@ConfigurationProperties(CONFIG_PREFIX) | ||
public class Neo4jDriverProperties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Neo4jDriverProperties.CONFIG_PREFIX
inside the annotation and remove the static import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will change
|
||
package org.springframework.ai.autoconfigure.neo4j; | ||
|
||
import org.neo4j.driver.AuthToken; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bad practice to expose 3rd party API (e.g. org.neo4j) directly in your own API.
Can we hide those behind spring-ai abstractions?
Also I wonder how different is this from the existing neo4j spring boot autoconfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I already removed the org.neo4j.* APIs in Neo4jDriverProperties.
The properties are the same as the existing neo4j spring boot autoconfig.
LGTM, thank you @King-Chau |
Rebased, squashed and merged at: b625ab1 |
Add Spring Boot auto-configuration for Neo4j vector store