Skip to content

Commit e7ec23b

Browse files
Resolve Pylint issue
1 parent c41fbe3 commit e7ec23b

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

infra/scripts/index_scripts/02_process_data.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,10 @@ def get_secrets_from_kv(secret_name: str) -> str:
5858

5959
# Function: Get Embeddings
6060
def 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,

scripts/data_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)