-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Oracle document store classes #38
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.
Some suggestions could not be made:
- langchain4j-core/src/test/java/dev/langchain4j/store/embedding/filter/comparison/IsNotEqualToTest.java
- lines 9-10
- lines 31-32
- lines 44-44
- lines 53-53
- lines 61-61
- lines 69-69
void testFile() { | ||
String pref = "{\"file\": \"" + dotenv.get("DEMO_DS_PDF_FILE") + "\"}"; | ||
List<Document> docs = loader.loadDocuments(pref); | ||
assertThat(docs.size()).isEqualTo(1); |
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.
assertThat(docs.size()).isEqualTo(1); | |
assertThat(docs).hasSize(1); |
textSegments.add(TextSegment.from("goodbye world")); | ||
textSegments.add(TextSegment.from("1,2,3")); | ||
Response<List<Embedding>> resp3 = embedder.embedAll(textSegments); | ||
assertThat(resp3.content().size()).isEqualTo(3); |
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.
assertThat(resp3.content().size()).isEqualTo(3); | |
assertThat(resp3.content()).hasSize(3); |
textSegments.add(TextSegment.from("goodbye world")); | ||
textSegments.add(TextSegment.from("1,2,3")); | ||
Response<List<Embedding>> resp3 = embedder.embedAll(textSegments); | ||
assertThat(resp3.content().size()).isEqualTo(3); |
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.
assertThat(resp3.content().size()).isEqualTo(3); | |
assertThat(resp3.content()).hasSize(3); |
|
||
documents.addAll(loadDocuments(owner, table, column, pref)); | ||
} else { | ||
throw new RuntimeException("Invalid preference"); |
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.
I think we should add more information in here, and it's probably more a InvalidParameterException: https://docs.oracle.com/javase/8/docs/api/java/security/InvalidParameterException.html
throw new RuntimeException("Invalid preference"); | ||
} | ||
} catch (IOException | RuntimeException ex) { | ||
String message = ex.getCause() != null ? ex.getCause().getMessage() : ex.getMessage(); |
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.
You don't need to catch the RuntimeException, and I think we should re-throw the exception if we can't recover from the IOException: https://www.baeldung.com/java-exceptions
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 looks good. But please take a look at the comments for exception handling. I think it can be applied in other parts of the code.
Issue
Closes #
Change
Add Oracle document store classes
General checklist
Checklist for adding new maven module
pom.xml
andlangchain4j-bom/pom.xml
Checklist for adding new embedding store integration
{NameOfIntegration}EmbeddingStoreIT
that extends from eitherEmbeddingStoreIT
orEmbeddingStoreWithFilteringIT
{NameOfIntegration}EmbeddingStoreRemovalIT
that extends fromEmbeddingStoreWithRemovalIT
Checklist for changing existing embedding store integration
{NameOfIntegration}EmbeddingStore
works correctly with the data persisted using the latest released version of LangChain4j