An Azure machine learning service for building and deploying models.
Hi Carlos Albarran,
Endpoint syntax does not seem to be correct.
I just tested below code copied from deployment/code with Owner (Sub inherited)/Azure AI user (RG inherited) and it is working for me.
from openai import OpenAI
endpoint = "https://<pleaserefereploymentcode>.openai.azure.com/openai/v1/" deployment_name = "Kimi-K2.5"
api_key = "<your-api-key>"
client = OpenAI(
base_url=endpoint,
api_key=api_key
)
completion = client.chat.completions.create(
model=deployment_name,
messages=[
{
"role": "user",
"content": "What is the capital of France?",
}
],
)
print(completion.choices[0].message)
Output
ChatCompletionMessage(content='The capital of France is **Paris**.', refusal=None, role='assistant', annotations=None, audio=None, function_call=None, tool_calls=None, reasoning_content='The user is asking a very simple factual question: "What is the capital of France?" This is a straightforward question with a clear, unambiguous answer. The capital of France is Paris.\n\n I should provide a direct, concise answer. I don\'t need to overcomplicate this with unnecessary details unless the user asks for more information, but a brief, friendly confirmation is appropriate.\n\n Answer: Paris.')
Attached screenshot for reference
Note:
Found a discrepancy in endpoint syntax creation though. Created a feedback item and checking with PG team internally on it.
Please copy the code suggested in deployment as workaround
endpoint = "https://<project-name>-resource.openai.azure.com/openai/v1/
Please let us know the proposed approach helps address the issue
Thank you.