Skip to content

Commit e850cd2

Browse files
committed
fix: prepend https:// to os_domain_ep only if needed
1 parent faabe26 commit e850cd2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lambda/aws-rag-appsync-stepfn-opensearch/embeddings_job/src/helpers/opensearch_helper.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ def process_shard(shard, os_index_name, os_domain_ep, os_http_auth) -> int:
4343
embeddings = BedrockEmbeddings(
4444
client=bedrock_client,
4545
model_id="amazon.titan-embed-text-v1")
46+
opensearch_url = os_domain_ep if os_domain_ep.startswith("https://") else f"https://{os_domain_ep}"
4647
docsearch = OpenSearchVectorSearch(index_name=os_index_name,
4748
embedding_function=embeddings,
48-
opensearch_url=f"https://{os_domain_ep}",
49+
opensearch_url=opensearch_url,
4950
http_auth=os_http_auth,
5051
use_ssl = True,
5152
verify_certs = True,

0 commit comments

Comments
 (0)