Skip to content

Commit ef09944

Browse files
Merge pull request #36218 from AV25242/main
updated parameter examples
2 parents d9c9493 + 01e3602 commit ef09944

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

docs/t-sql/functions/ai-generate-embeddings-transact-sql.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ FROM myTable AS t;
163163
The following example shows how to use the `AI_GENERATE_EMBEDDINGS` function with a select statement and passing optional parameters to the endpoint, which returns vector array results.
164164

165165
```sql
166+
DECLARE @params JSON = N'{"dimensions":768}'
166167
SELECT id,
167-
AI_GENERATE_EMBEDDINGS(large_text USE MODEL MyAzureOpenAIModel PARAMETERS TRY_CONVERT (JSON, N'{"dimensions":768}'))
168+
AI_GENERATE_EMBEDDINGS(large_text USE MODEL MyAzureOpenAIModel PARAMETERS @params)
168169
FROM myTable;
169170
```
170171

@@ -178,8 +179,9 @@ To specify the number of retries, add the following JSON to the `PARAMETERS` opt
178179
> If a `retry_count` value is specified in the `AI_GENERATE_EMBEDDINGS` query, it overrides the `retry_count` (if defined) in the external model's configuration.
179180
180181
```sql
182+
DECLARE @params JSON = N'{"sql_rest_options":{"retry_count":10}} '
181183
SELECT id,
182-
AI_GENERATE_EMBEDDINGS(large_text USE MODEL MyAzureOpenAIModel PARAMETERS TRY_CONVERT (JSON, N'{"retry_count":10}'))
184+
AI_GENERATE_EMBEDDINGS(large_text USE MODEL MyAzureOpenAIModel PARAMETERS @params)
183185
FROM myTable;
184186
```
185187

0 commit comments

Comments
 (0)