File tree Expand file tree Collapse file tree 2 files changed +4
-15
lines changed
infra/scripts/index_scripts Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -58,21 +58,10 @@ def get_secrets_from_kv(secret_name: str) -> str:
5858
5959# Function: Get Embeddings
6060def get_embeddings (text : str , ai_project_endpoint : str ):
61- """Get embeddings using Azure AI Foundry SDK.
62-
63- Args:
64- text: Text to embed
65- ai_project_endpoint: Azure AI Project endpoint from Key Vault
66- (e.g., https://aif-xyz.services.ai.azure.com/api/projects/proj-xyz)
67-
68- Returns:
69- List of embedding values
70- """
7161 embedding_model = "text-embedding-ada-002"
72-
7362 # Construct inference endpoint with /models path
7463 inference_endpoint = f"https://{ urlparse (ai_project_endpoint ).netloc } /models"
75-
64+
7665 embeddings_client = EmbeddingsClient (
7766 endpoint = inference_endpoint ,
7867 credential = credential ,
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def get_secrets_from_kv(secret_name: str) -> str:
4646
4747 Args:
4848 secret_name: Name of the secret
49-
49+
5050 Returns:
5151 The secret value
5252 """
@@ -851,7 +851,7 @@ def get_embedding(
851851):
852852 # Get AI Project endpoint from Key Vault
853853 ai_project_endpoint = get_secrets_from_kv ("AZURE-AI-AGENT-ENDPOINT" )
854-
854+
855855 # Construct inference endpoint: https://aif-xyz.services.ai.azure.com/models
856856 inference_endpoint = f"https://{ urlparse (ai_project_endpoint ).netloc } /models"
857857 embedding_model = "text-embedding-ada-002"
@@ -869,7 +869,7 @@ def get_embedding(
869869 endpoint = inference_endpoint ,
870870 credential = AzureKeyCredential (api_key )
871871 )
872-
872+
873873 response = embeddings_client .embed (model = embedding_model , input = [text ])
874874 return response .data [0 ].embedding
875875
You can’t perform that action at this time.
0 commit comments