Description
- azure.ai.interence:
- latest:
- Windows 11:
- 3.10.11:
Describe the bug
`# Install the following dependencies: azure.identity and azure-ai-inference
import os
from azure.ai.inference import ChatCompletionsClient
from azure.ai.inference.models import SystemMessage, UserMessage
from azure.core.credentials import AzureKeyCredential
endpoint = os.getenv("AZURE_INFERENCE_SDK_ENDPOINT", "https://ai-manbirrdhubwu3151263134242.services.ai.azure.com/models")
model_name = os.getenv("DEPLOYMENT_NAME", "gpt-4o")
key = os.getenv("AZURE_INFERENCE_SDK_KEY", "xxx")
client = ChatCompletionsClient(endpoint=endpoint, credential=AzureKeyCredential(key))
response = client.complete(
messages=[
SystemMessage(content="You are a helpful assistant."),
UserMessage(content="What are 3 things to visit in Seattle?")
],
model = model_name,
max_tokens=1000
)
print(response)`
To Reproduce
Steps to reproduce the behavior:
- just run the code after installing all the imports
Expected behavior
This should work like Azure Open Ai Service. Azure AI Interfence crashes
Screenshots
Additional context
Add any other context about the problem here.
Activity