from dotenv import load_dotenv import os from openai import AzureOpenAI from azure.search.documents import SearchClient from azure.core.credentials import AzureKeyCredential load_dotenv() # Set up the search client with your service details search_client = SearchClient(endpoint=os.getenv("AZURE_AISEARCH_ENDPOINT"), index_name=os.getenv("AZURE_AISEARCH_INDEX"), credential=AzureKeyCredential(os.getenv("AZURE_AISEARCH_API_KEY"))) client = AzureOpenAI( api_key= os.getenv("AOAI_API_KEY"), api_version= os.getenv("AOAI_API_VERSION"), azure_endpoint= os.getenv("AOAI_ENDPOINT"), ) # Informações do endpoint azure_ml_endpoint_url = os.getenv("AZURE_ML_ENDPOINT") azure_ml_api_key = os.getenv("AZURE_ML_API_KEY") # Headers para autenticação e conteúdo headers = { "Content-Type": "application/json", "Authorization": f"{azure_ml_api_key}" }