AWS re:Post을(를) 사용하면 다음에 동의하게 됩니다. AWS re:Post 이용 약관

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: "*"

질문됨 3달 전112회 조회
1개 답변
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
지원 엔지니어
답변함 3달 전
profile picture
전문가
검토됨 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠