File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
articles/ai-foundry/model-inference/includes/use-image-embeddings Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,18 @@ const client = new ModelClient(
56
56
57
57
If you configured the resource to with ** Microsoft Entra ID** support, you can use the following code snippet to create a client.
58
58
59
+ ``` javascript
60
+ import ModelClient from " @azure-rest/ai-inference" ;
61
+ import { isUnexpected } from " @azure-rest/ai-inference" ;
62
+ import { DefaultAzureCredential } from " @azure/identity" ;
63
+
64
+ const client = new ModelClient (
65
+ process .env .AZURE_INFERENCE_ENDPOINT ,
66
+ new DefaultAzureCredential (),
67
+ " Cohere-embed-v3-english"
68
+ );
69
+ ```
70
+
59
71
### Create embeddings
60
72
61
73
To create image embeddings, you need to pass the image data as part of your request. Image data should be in PNG format and encoded as base64.
Original file line number Diff line number Diff line change @@ -56,6 +56,18 @@ model = ImageEmbeddingsClient(
56
56
57
57
If you configured the resource to with ** Microsoft Entra ID** support, you can use the following code snippet to create a client.
58
58
59
+ ``` python
60
+ import os
61
+ from azure.ai.inference import ImageEmbeddingsClient
62
+ from azure.identity import DefaultAzureCredential
63
+
64
+ model = ImageEmbeddingsClient(
65
+ endpoint = os.environ[" AZURE_INFERENCE_ENDPOINT" ],
66
+ credential = DefaultAzureCredential(),
67
+ model = " Cohere-embed-v3-english"
68
+ )
69
+ ```
70
+
59
71
### Create embeddings
60
72
61
73
To create image embeddings, you need to pass the image data as part of your request. Image data should be in PNG format and encoded as base64.
You can’t perform that action at this time.
0 commit comments