From fadd524c7d25a4db0fe5ab8ce4c437d352f67502 Mon Sep 17 00:00:00 2001 From: Javier Toledo Date: Tue, 29 Aug 2023 18:13:36 +0100 Subject: [PATCH] Core abstractions review * Reviewed that documentation matches the code and fixed docs discrepancies * Refactored the `Embedding` object to be a record and include metadata and an ID that will be retrieved afterwards from the vector store * Implemented constructor that accepts explicit credentials in addition to supporting environment variables * The OpenAI embeddings generator now injects the original text, the model name and a timestamp in the embeddings metadata automatically --- .idea/workspace.xml | 83 +++++++---- .../ellmental/core/schema/Embedding.java | 20 +-- .../03_components/01_core_abstractions.md | 35 ++++- .../docs/03_components/02_embeddings_space.md | 20 --- .../ellmental/helloworld/Main.java | 5 +- .../EmbeddingsGenerationModel.java | 3 + .../openai/OpenAIEmbeddingsModel.java | 75 +++++++--- .../openai/OpenAIEmbeddingsModelTest.java | 4 +- .../embeddingsstore/EmbeddingsStore.java | 5 +- .../pinecone/PineconeEmbeddingsStore.java | 136 +++++++++++------- .../pinecone/QueryVectorResponseSchema.java | 3 +- .../pinecone/UpsertVectorSchema.java | 10 +- .../pinecone/PineconeEmbeddingsStoreTest.java | 10 +- 13 files changed, 258 insertions(+), 151 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9744266..0a1674e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,15 +5,19 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +