Skip to content

Commit 193c652

Browse files
committed
fix
1 parent 4a6fab8 commit 193c652

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

articles/ai-foundry/model-inference/includes/use-image-embeddings/javascript.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ const client = new ModelClient(
5656

5757
If you configured the resource to with **Microsoft Entra ID** support, you can use the following code snippet to create a client.
5858

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+
5971
### Create embeddings
6072

6173
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.

articles/ai-foundry/model-inference/includes/use-image-embeddings/python.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ model = ImageEmbeddingsClient(
5656

5757
If you configured the resource to with **Microsoft Entra ID** support, you can use the following code snippet to create a client.
5858

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+
5971
### Create embeddings
6072

6173
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.

0 commit comments

Comments
 (0)