class Builder {

        private String endpoint;

        private AzureKeyCredential keyCredential;

        private TokenCredential tokenCredential;

        private boolean createOrUpdateIndex = true;

        private int dimensions;

        private SearchIndex index;

        /**
         * Sets the Azure AI Search endpoint. This is a mandatory parameter.
         *
         * @param endpoint The Azure AI Search endpoint in the format: https://{resource}.search.windows.net
         * @return builder
         */
        public Builder endpoint(String endpoint) {
            this.endpoint = endpoint;
            return this;
        }

        /**
         * Sets the Azure AI Search API key.
         *
         * @param apiKey The Azure AI Search API key.
         * @return builder
         */
        public Builder apiKey(String apiKey) {
            this.keyCredential = new AzureKeyCredential(apiKey);
            return this;
        }

        /**
         * Used to authenticate to Azure OpenAI with Azure Active Directory credentials.
         * @param tokenCredential the credentials to authenticate with Azure Active Directory
         * @return builder
         */
        public Builder tokenCredential(TokenCredential tokenCredential) {
            this.tokenCredential = tokenCredential;
            return this;
        }

        /**
         * Whether to create or update the search index.
         *
         * @param createOrUpdateIndex Whether to create or update the index.
         * @return builder
         */
        public Builder createOrUpdateIndex(boolean createOrUpdateIndex) {
            this.createOrUpdateIndex = createOrUpdateIndex;
            return this;
        }

        /**
         * If using the ready-made index, sets the number of dimensions of the embeddings.
         * This parameter is exclusive of the index parameter.
         *
         * @param dimensions The number of dimensions of the embeddings.
         * @return builder
         */
        public Builder dimensions(int dimensions) {
            this.dimensions = dimensions;
            return this;
        }

        /**
         * If using a custom index, sets the index to be used.
         * This parameter is exclusive of the dimensions parameter.
         *
         * @param index The index to be used.
         * @return builder
         */
        public Builder index(SearchIndex index) {
            this.index = index;
            return this;
        }

        public AzureAiSearchEmbeddingStore build() {<FILL_FUNCTION_BODY>}
    }

            ensureNotNull(endpoint, "endpoint");
            ensureTrue(keyCredential != null || tokenCredential != null, "either apiKey or tokenCredential must be set");
            ensureTrue(dimensions > 0 || index != null, "either dimensions or index must be set");
            if (keyCredential == null) {
                if (index == null) {
                    return new AzureAiSearchEmbeddingStore(endpoint, tokenCredential, createOrUpdateIndex, dimensions);
                } else {
                    return new AzureAiSearchEmbeddingStore(endpoint, tokenCredential, createOrUpdateIndex, index);
                }
            } else {
                if (index == null) {
                    return new AzureAiSearchEmbeddingStore(endpoint, keyCredential, createOrUpdateIndex, dimensions);
                } else {
                    return new AzureAiSearchEmbeddingStore(endpoint, keyCredential, createOrUpdateIndex, index);
                }
            }
        
<methods>public non-sealed void <init>() ,public java.lang.String add(dev.langchain4j.data.embedding.Embedding) ,public void add(java.lang.String, dev.langchain4j.data.embedding.Embedding) ,public java.lang.String add(dev.langchain4j.data.embedding.Embedding, dev.langchain4j.data.segment.TextSegment) ,public List<java.lang.String> addAll(List<dev.langchain4j.data.embedding.Embedding>) ,public List<java.lang.String> addAll(List<dev.langchain4j.data.embedding.Embedding>, List<dev.langchain4j.data.segment.TextSegment>) ,public void createOrUpdateIndex(int) ,public void deleteIndex() ,public List<EmbeddingMatch<dev.langchain4j.data.segment.TextSegment>> findRelevant(dev.langchain4j.data.embedding.Embedding, int, double) <variables>protected static final java.lang.String DEFAULT_FIELD_CONTENT,protected final java.lang.String DEFAULT_FIELD_CONTENT_VECTOR,static final java.lang.String DEFAULT_FIELD_ID,protected static final java.lang.String DEFAULT_FIELD_METADATA,protected static final java.lang.String DEFAULT_FIELD_METADATA_ATTRS,protected static final java.lang.String DEFAULT_FIELD_METADATA_SOURCE,public static final java.lang.String INDEX_NAME,protected static final java.lang.String SEMANTIC_SEARCH_CONFIG_NAME,protected static final java.lang.String VECTOR_ALGORITHM_NAME,protected static final java.lang.String VECTOR_SEARCH_PROFILE_NAME,private boolean createOrUpdateIndex,private static final Logger log,protected SearchClient searchClient,private SearchIndexClient searchIndexClient