osc/research/ms-acs/service/analysis_client.py
2025-05-28 19:16:17 +08:00

9 lines
413 B
Python

from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics import TextAnalyticsClient
from settings import TEXT_ANALYSIS_API_KEY, TEXT_ANALYSIS_ENDPOINT
def get_analysis_client(endpoint=TEXT_ANALYSIS_ENDPOINT, credential=AzureKeyCredential(TEXT_ANALYSIS_API_KEY)):
text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=credential)
return text_analytics_client