-
Notifications
You must be signed in to change notification settings - Fork 63
feat(opensearch serverless): analyzer #537
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
feat(opensearch serverless): analyzer #537
Conversation
example usage: import { bedrock } from "@cdklabs/generative-ai-cdk-constructs";
import {
CharacterFilterType,
TokenFilterType,
TokenizerType,
} from "@cdklabs/generative-ai-cdk-constructs/lib/cdk-lib/opensearchserverless";
const kb = new bedrock.KnowledgeBase(this, "KB", {
embeddingsModel: bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
instruction:
"Use this knowledge base to answer questions. Please quote the reference to explain your answers.",
analyzer: {
characterFilters: [CharacterFilterType.ICU_NORMALIZER],
tokenizer: TokenizerType.KUROMOJI_TOKENIZER,
tokenFilters: [
TokenFilterType.KUROMOJI_BASEFORM,
TokenFilterType.JA_STOP,
],
}
) |
Also, could you please update the code snippet here: https://github.com/awslabs/generative-ai-cdk-constructs/blob/main/src/cdk-lib/opensearch-vectorindex/README.md#vector-index with the new analyzer props |
fixed |
Great thank you for your contribution @statefb ! I approved, once a second reviewer will approve we will merge |
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.
LGTM
close #536
Add analyzers support for the construct: https://opensearch.org/docs/latest/analyzers/
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.