Durch die Nutzung von AWS re:Post stimmt du den AWS re:Post Nutzungsbedingungen

Using Langchain4j with OpenSearch Service Collections

0

Wonder if it is possible to use Langchain4j with OpenSearch Service Collections. Based off of the Langchain4j documentation there is a way to use the OpenSearch Embedding store: https://github.com/langchain4j/langchain4j-examples/blob/main/opensearch-example/src/main/java/OpenSearchEmbeddingStoreExample.java.

I am trying to do this, but with the Amazon OpenSearch service Collections. I have a collection and index created. Right now, here is a snippet of my code from lambda

EmbeddingStore<TextSegment> embeddingStore = OpenSearchEmbeddingStore.builder()
                    .serverUrl(<MY_OPENSEARCH_ENDPOINTt>)
                    .build();

I have no problem creating and building the embedding store, but once I try to do embeddingStore.add(), I am getting this error: Request failed: [Forbidden] 403 Forbidden. What permissions do I need to have within my Collection and Lambda in order to allow me to add text to the embeddingStore?

Within my lambda, I have these permissions: - Effect: Allow Action: - aoss:* Resource: "*"

gefragt vor 3 Monaten113 Aufrufe
1 Antwort
2

Hello,

Upon examining the code, I cannot see any provisions for sending a signed request. As you are encountering a 403 error, which typically indicates an authentication issue, rather than the library being incapable of sending a signed request, I would kindly request that you verify your ability to send a signed request using Langchain4j.

Signed Request to OpenSearch Serverless: https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-clients.html

Additionally, I have observed that there is already an open feature request to support OpenSearch Serverless: https://github.com/langchain4j/langchain4j/issues/1324

Furthermore, I have found an online documentation resource that demonstrates how to establish a connection with Python: https://caylent.com/blog/building-a-rag-with-open-search-serverless-and-lang-chain

Thank you!

AWS
SUPPORT-TECHNIKER
beantwortet vor 3 Monaten
profile picture
EXPERTE
überprüft vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen