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ヶ月前113ビュー
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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ