-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
504 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...tion/ai/ModelInference/examples/2024-05-01-preview/GetImageEmbeddings_MaximumSet_Gen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...tion/ai/ModelInference/examples/2024-05-01-preview/GetImageEmbeddings_MinimumSet_Gen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"title": "minimum set image embeddings", | ||
"operationId": "GetImageEmbeddings", | ||
"parameters": { | ||
"api-version": "2024-05-01-preview", | ||
"body": { | ||
"input": [ | ||
{ | ||
"image": "gvmojtfooxixxzayrditjlyymg" | ||
} | ||
] | ||
} | ||
}, | ||
"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 | ||
} | ||
} | ||
} | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
specification/ai/ModelInference/models/image_embeddings.tsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import "@typespec/rest"; | ||
import "@typespec/http"; | ||
|
||
import "./embeddings.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using TypeSpec.Http; | ||
|
||
namespace ModelInference; | ||
|
||
@doc(""" | ||
The configuration information for an image embeddings request. | ||
""") | ||
model ImageEmbeddingsOptions { | ||
@doc(""" | ||
Input image to embed. To embed multiple inputs in a single request, pass an array. | ||
The input must not exceed the max input tokens for the model. | ||
""") | ||
input: ImageEmbeddingInput[]; | ||
|
||
@doc(""" | ||
Optional. The number of dimensions the resulting output embeddings should have. | ||
Passing null causes the model to use its default value. | ||
Returns a 422 error if the model doesn't support the value or parameter. | ||
""") | ||
dimensions?: int32; | ||
|
||
@doc(""" | ||
Optional. The number of dimensions the resulting output embeddings should have. | ||
Passing null causes the model to use its default value. | ||
Returns a 422 error if the model doesn't support the value or parameter. | ||
""") | ||
encoding_format?: EmbeddingEncodingFormat; | ||
|
||
@doc(""" | ||
Optional. The type of the input. | ||
Returns a 422 error if the model doesn't support the value or parameter. | ||
""") | ||
input_type?: EmbeddingInputType; | ||
|
||
@doc(""" | ||
ID of the specific AI model to use, if more than one model is available on the endpoint. | ||
""") | ||
`model`?: string; | ||
|
||
...Record<unknown>; | ||
} | ||
|
||
@doc("Represents an image with optional text.") | ||
model ImageEmbeddingInput { | ||
@doc(""" | ||
The input image encoded in base64 string as a data URL. Example: `data:image/{format};base64,{data}`. | ||
""") | ||
image: string; | ||
|
||
@doc(""" | ||
Optional. The text input to feed into the model (like DINO, CLIP). | ||
Returns a 422 error if the model doesn't support the value or parameter. | ||
""") | ||
text?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ModelInference/preview/2024-05-01-preview/examples/GetImageEmbeddings_MaximumSet_Gen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...ModelInference/preview/2024-05-01-preview/examples/GetImageEmbeddings_MinimumSet_Gen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"title": "minimum set image embeddings", | ||
"operationId": "GetImageEmbeddings", | ||
"parameters": { | ||
"api-version": "2024-05-01-preview", | ||
"body": { | ||
"input": [ | ||
{ | ||
"image": "gvmojtfooxixxzayrditjlyymg" | ||
} | ||
] | ||
} | ||
}, | ||
"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 | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.