Skip to content
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

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

Merged
merged 11 commits into from
Feb 12, 2025
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": "input_audio",
"input_audio": {
"data": "<base64 encoded audio data>",
"format": "wav"
}
}
]
},
{
"role": "assistant",
"content": null,
"audio": {
"id": "abcdef1234"
}
},
{
"role": "user",
"content": [
{
"type": "input_audio",
"input_audio": {
"data": "<base64 encoded audio data>",
"format": "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",
"format": "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"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"title": "maximum set embeddings",
"operationId": "GetEmbeddings",
"parameters": {
"api-version": "2024-05-01-preview",
"extra-parameters": "error",
"body": {
"input": [
"This is a very good text"
],
"dimensions": 1024,
"encoding_format": "float",
"input_type": "text",
"model": "my-model-name"
}
},
"responses": {
"200": {
"body": {
"id": "cknxthfa",
"data": [
{
"index": 0,
"object": "embedding",
"embedding": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
],
"object": "list",
"model": "my-model-name",
"usage": {
"prompt_tokens": 15,
"total_tokens": 15
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"title": "minimum set embeddings",
"operationId": "GetEmbeddings",
"parameters": {
"api-version": "2024-05-01-preview",
"body": {
"input": [
"This is a very good text"
]
}
},
"responses": {
"200": {
"body": {
"id": "cknxthfa",
"data": [
{
"index": 0,
"object": "embedding",
"embedding": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
],
"object": "list",
"model": "my-model-name",
"usage": {
"prompt_tokens": 15,
"total_tokens": 15
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"title": "maximum set image embeddings",
"operationId": "GetImageEmbeddings",
"parameters": {
"api-version": "2024-05-01-preview",
"extra-parameters": "error",
"body": {
"input": [
{
"image": "puqkvvlvgcjyzughesnkena",
"text": "azrzyjsmnuefqpowpvfmyobeehqsni"
}
],
"dimensions": 1024,
"encoding_format": "float",
"input_type": "text",
"model": "my-model-name"
}
},
"responses": {
"200": {
"body": {
"id": "cknxthfa",
"data": [
{
"index": 0,
"object": "embedding",
"embedding": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
],
"object": "list",
"model": "my-model-name",
"usage": {
"prompt_tokens": 15,
"total_tokens": 15
}
}
}
}
}
Loading