Skip to content

Azure AI Model Inference API - Embeddings and Chat Completions (#32145) #32165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 34 additions & 28 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"partiallycompleted",
"servicenetworking",
"subchannel",
"ubinary",
"umls"
],
"allowCompoundWords": true,
Expand Down Expand Up @@ -170,12 +171,18 @@
]
},
{
"filename": "**/specification/billing/**/*.json",
"words": [
"mosp",
"resellee",
"cnpj"
]
"filename": "**/specification/billing/**/*.json",
"words": [
"mosp",
"resellee",
"cnpj"
]
},
{
"filename": "**/specification/ai/data-plane/ModelInference/**/*",
"words": [
"ubinary"
]
},
{
"filename": "**/specification/compute/resource-manager/Microsoft.ContainerService/preview/2015-11-01-preview/containerService.json",
Expand Down Expand Up @@ -340,32 +347,32 @@
"freemium"
]
},
{
{
"filename": "**/specification/sql/resource-manager/Microsoft.Sql/preview/**/ManagedInstances.json",
"words": [
"freemium"
]
},
{
{
"filename": "**/specification/sql/resource-manager/Microsoft.Sql/preview/**/ServerTrustCertificates.json",
"words": [
"freemium"
]
},
{
{
"filename": "**/specification/sql/resource-manager/Microsoft.Sql/preview/**/ManagedInstanceDtcs.json",
"words": [
"msdtcdns",
"msdtc's"
]
},
{
{
"filename": "**/specification/sql/resource-manager/Microsoft.Sql/preview/**/TimeZones.json",
"words": [
"freemium"
]
},
{
{
"filename": "**/specification/sql/resource-manager/Microsoft.Sql/preview/**/ElasticPools.json",
"words": [
"PRMS"
Expand Down Expand Up @@ -1695,19 +1702,19 @@
"filename": "**/specification/ai/data-plane/HealthInsights/stable/**/openapi.json",
"words": [
"Acrad",
"acrad",
"BIRADS",
"mednax",
"frax",
"extracolonic",
"ascvd",
"tyrer",
"cusick",
"agatston",
"ceus",
"HNPCC",
"kellgren",
"tonnis"
"acrad",
"BIRADS",
"mednax",
"frax",
"extracolonic",
"ascvd",
"tyrer",
"cusick",
"agatston",
"ceus",
"HNPCC",
"kellgren",
"tonnis"
]
},
{
Expand Down Expand Up @@ -1783,7 +1790,7 @@
"words": [
"symboliclink",
"hardlink"
]
]
},
{
"filename": "**/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-09-01/costmanagement.pricesheets.json",
Expand All @@ -1795,10 +1802,10 @@
"filename": "**/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2023-11-01/costmanagement.pricesheets.json",
"words": [
"Unitof"
]
]
},
{
"filename": "**/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCIVM/**/*.json",
"filename": "**/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCIVM/**/*.json",
"words": [
"SEVSNP"
]
Expand Down Expand Up @@ -1848,5 +1855,4 @@
"ignoreWords": [
"trafficcontrollerspec"
]

}
5 changes: 5 additions & 0 deletions specification/ai/ModelInference/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: ModelInference
clear-output-folder: false
guessResourceKey: true
isAzureSpec: true
namespace: azure.ai.inference
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"title": "Audio modality chat completion",
"operationId": "GetChatCompletions",
"parameters": {
"api-version": "2024-05-01-preview",
"extra-parameters": "error",
"body": {
"modalities": [
"text",
"audio"
],
"messages": [
{
"role": "system",
"content": "You are a helpful assistant"
},
{
"role": "user",
"content": [
{
"type": "audio_input",
"audio_input": {
"data": "<base64 encoded audio data>",
"mime_type": "audio/wav"
}
}
]
},
{
"role": "assistant",
"content": null,
"audio": {
"id": "abcdef1234"
}
},
{
"role": "user",
"content": [
{
"type": "audio_input",
"audio_input": {
"data": "<base64 encoded audio data>",
"mime_type": "audio/wav"
}
}
]
}
],
"frequency_penalty": 0,
"presence_penalty": 0,
"temperature": 0,
"top_p": 0,
"seed": 21,
"model": "my-model-name"
}
},
"responses": {
"200": {
"body": {
"id": "kgousajxgzyhugvqekuswuqbk",
"object": "chat.completion",
"created": 1696522361,
"model": "my-model-name",
"usage": {
"completion_tokens": 19,
"prompt_tokens": 28,
"total_tokens": 16,
"completion_tokens_details": {
"audio_tokens": 5,
"total_tokens": 5
},
"prompt_tokens_details": {
"audio_tokens": 10,
"cached_tokens": 0
}
},
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": null,
"tool_calls": null,
"audio": {
"id": "abcdef1234",
"mime_type": "audio/wav",
"data": "<base64 encoded audio data>",
"expires_at": 1896522361,
"transcript": "This is a sample transcript"
}
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"title": "maximum set chat completion",
"operationId": "GetChatCompletions",
"parameters": {
"api-version": "2024-05-01-preview",
"extra-parameters": "error",
"body": {
"modalities": [
"text"
],
"messages": [
{
"role": "system",
"content": "You are a helpful assistant"
},
{
"role": "user",
"content": "Explain Riemann's conjecture"
},
{
"role": "assistant",
"content": "The Riemann Conjecture is a deep mathematical conjecture around prime numbers and how they can be predicted. It was first published in Riemann's groundbreaking 1859 paper. The conjecture states that the Riemann zeta function has its zeros only at the negative even integers and complex numbers with real part 1/21. Many consider it to be the most important unsolved problem in pure mathematics. The Riemann hypothesis is a way to predict the probability that numbers in a certain range are prime that was also devised by German mathematician Bernhard Riemann in 18594."
},
{
"role": "user",
"content": "Ist it proved?"
}
],
"frequency_penalty": 0,
"stream": true,
"presence_penalty": 0,
"temperature": 0,
"top_p": 0,
"max_tokens": 255,
"response_format": {
"type": "text"
},
"stop": [
"<|endoftext|>"
],
"tools": [
{
"type": "function",
"function": {
"name": "my-function-name",
"description": "A function useful to know if a theroem is proved or not"
}
}
],
"seed": 21,
"model": "my-model-name"
}
},
"responses": {
"200": {
"body": {
"id": "kgousajxgzyhugvqekuswuqbk",
"object": "chat.completion",
"created": 18,
"model": "my-model-name",
"usage": {
"completion_tokens": 19,
"prompt_tokens": 28,
"total_tokens": 16
},
"choices": [
{
"index": 7,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "yrobmilsrugmbwukmzo",
"type": "function",
"function": {
"name": "my-function-name",
"arguments": "{ \"arg1\": \"value1\", \"arg2\": \"value2\" }"
}
}
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"title": "minimum set chat completion",
"operationId": "GetChatCompletions",
"parameters": {
"api-version": "2024-05-01-preview",
"body": {
"messages": [
{
"role": "user",
"content": "Explain Riemann's conjecture"
}
]
}
},
"responses": {
"200": {
"body": {
"id": "kgousajxgzyhugvqekuswuqbk",
"object": "chat.completion",
"created": 1234567890,
"model": "my-model-name",
"usage": {
"prompt_tokens": 205,
"completion_tokens": 5,
"total_tokens": 210
},
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "The Riemann Conjecture is a deep mathematical conjecture around prime numbers and how they can be predicted. It was first published in Riemann's groundbreaking 1859 paper. The conjecture states that the Riemann zeta function has its zeros only at the negative even integers and complex numbers with real part 1/21. Many consider it to be the most important unsolved problem in pure mathematics. The Riemann hypothesis is a way to predict the probability that numbers in a certain range are prime that was also devised by German mathematician Bernhard Riemann in 18594"
}
}
]
}
}
}
}
Loading
Loading