lucky_monkey_44174
02/10/2025, 9:13 PMfrom openai import AzureOpenAI
from azure.identity import EnvironmentCredential
def get_access_token():
credential = EnvironmentCredential()
access_token = credential.get_token("https://cognitiveservices.azure.com/.default")
return access_token.token
client = AzureOpenAI(
api_key=get_access_token(),
api_version="<my api version>",
azure_endpoint="<my endpoint>",
)
I can use the code above to ping it, but not sure how to trancribe it for promptfoo. Also able to have it for DSPy using LiteLLM if that can be of any help.
Thanks!ian
02/15/2025, 12:04 AMdefaultTest directive here: https://www.promptfoo.dev/docs/providers/azure/#model-graded-tests
along with the redteam.provider directive here: https://www.promptfoo.dev/docs/providers/azure/#model-graded-testsian
02/15/2025, 12:04 AM