Skip to content

Commit 48574d9

Browse files
committed
fixes
1 parent 9e96dd2 commit 48574d9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

articles/ai-foundry/model-inference/includes/how-to-prerequisites-javascript.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ author: santiagxf
1212
```bash
1313
npm install @azure-rest/ai-inference
1414
```
15+
16+
* Import the following modules:
17+
18+
```javascript
19+
import ModelClient, { isUnexpected } from "@azure-rest/ai-inference";
20+
import { AzureKeyCredential } from "@azure/core-auth";
21+
import { DefaultAzureCredential } from "@azure/identity";
22+
import { createRestError } from "@azure-rest/core-client";
23+
```
24+

articles/ai-foundry/model-inference/includes/use-chat-multi-modal/javascript.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ const client = new ModelClient(
5757

5858
Some models can reason across text and images and generate text completions based on both kinds of input. In this section, you explore the capabilities of some models for vision in a chat fashion.
5959

60-
> [!IMPORTANT]
61-
> Some models support only one image for each turn in the chat conversation and only the last image is retained in context. If you add multiple images, it results in an error.
62-
6360
To see this capability, download an image and encode the information as `base64` string. The resulting data should be inside of a [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs):
6461

6562
```javascript
@@ -130,13 +127,18 @@ Usage:
130127
Total tokens: 2506
131128
```
132129

130+
> [!IMPORTANT]
131+
> Some models support only one image for each turn in the chat conversation and only the last image is retained in context. If you add multiple images, it results in an error.
132+
133133
## Use chat completions with audio
134134

135135
Some models can reason across text and audio inputs. The following example shows how you can send audio context to chat completions models that also supports audio.
136136

137137
In this example, we create a function `getAudioData` to load the content of the audio file encoded in `base64` data as the model expects it.
138138

139139
```javascript
140+
import fs from "node:fs";
141+
140142
/**
141143
* Get the Base 64 data of an audio file.
142144
* @param {string} audioFile - The path to the image file.

0 commit comments

Comments
 (0)