forked from langchain4j/langchain4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Milvus: configurable field names (langchain4j#1852)
## Issue Closes langchain4j#1842 ## Change Add `FieldDefinition` to hold customized filed name. Replace default field name with customized filed name. ## General checklist - [X] There are no breaking changes - [X] I have added unit and integration tests for my change - [X] I have manually run all the unit and integration tests in the module I have added/changed, and they are all green - [X] I have manually run all the unit and integration tests in the [core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core) and [main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j) modules, and they are all green - [ ] I have added/updated the [documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs) - [ ] I have added an example in the [examples repo](https://github.com/langchain4j/langchain4j-examples) (only for "big" features) - [ ] I have added/updated [Spring Boot starter(s)](https://github.com/langchain4j/langchain4j-spring) (if applicable) ## Checklist for changing existing embedding store integration - [X] I have manually verified that the `{NameOfIntegration}EmbeddingStore` works correctly with the data persisted using the latest released version of LangChain4j
- Loading branch information
Showing
7 changed files
with
188 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
langchain4j-milvus/src/main/java/dev/langchain4j/store/embedding/milvus/FieldDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package dev.langchain4j.store.embedding.milvus; | ||
|
||
|
||
class FieldDefinition { | ||
|
||
String idFieldName; | ||
|
||
String textFieldName; | ||
|
||
String metadataFieldName; | ||
|
||
String vectorFieldName; | ||
|
||
public FieldDefinition(String idFieldName, String textFieldName, String metadataFieldName, String vectorFieldName) { | ||
this.idFieldName = idFieldName; | ||
this.textFieldName = textFieldName; | ||
this.metadataFieldName = metadataFieldName; | ||
this.vectorFieldName = vectorFieldName; | ||
} | ||
|
||
public String getIdFieldName() { | ||
return idFieldName; | ||
} | ||
|
||
public String getTextFieldName() { | ||
return textFieldName; | ||
} | ||
|
||
public String getMetadataFieldName() { | ||
return metadataFieldName; | ||
} | ||
|
||
public String getVectorFieldName() { | ||
return vectorFieldName; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.