这个吗
import os
from azure.ai.inference import ChatCompletionsClient
from azure.ai.inference.models import SystemMessage, UserMessage
from azure.core.credentials import AzureKeyCredential
response = client.complete(
stream=True,
messages=[
SystemMessage(content=“You are a helpful assistant.”),
UserMessage(content=“I am going to Paris, what should I see?”)
],
max_tokens=2048,
model=model_name
)
for update in response:
if update.choices:
print(update.choices[0].delta.content or “”, end=“”)