Skip to content

Commit 47261b7

Browse files
committed
minor fixes
1 parent d23b097 commit 47261b7

3 files changed

Lines changed: 51 additions & 53 deletions

File tree

learn-pr/wwl-data-ai/get-started-generative-ai-azure-database-postgresql/includes/4-explore-azure-openai-schema.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ With the `azure_openai` schema, you can call the `create_embeddings()` function,
88

99
The function requires you to:
1010

11-
- specify the embedding deployment name,
12-
- supply the input text or array of text,
13-
- let the function return the embedding vector as `vector` or `vector[]`.
11+
- Specify the embedding deployment name.
12+
- Supply the input text or array of text.
13+
- Let the function return the embedding vector as `vector` or `vector[]`.
1414

1515
Example:
1616

learn-pr/wwl-data-ai/get-started-generative-ai-azure-database-postgresql/includes/6-explore-semantic-operators.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Work with semantic operators
2-
31
The `azure_ai` extension includes a small set of semantic operators that allow you to work with generative AI models directly in SQL. These operators help you generate text, evaluate statements, extract structured information, and rank documents. Each operator calls a model you configured in the `azure_ai.settings` table.
42

53
The semantic operators are:

learn-pr/wwl-data-ai/get-started-generative-ai-azure-database-postgresql/includes/7-examine-azure-machine-learning-schema.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -44,57 +44,57 @@ The following example shows the full flow for sending input to an Azure Machine
4444

4545
1. Send the input payload
4646

47-
```sql
48-
SELECT azure_ml.invoke(
49-
'{
50-
"input_data": {
51-
"columns": [
52-
"host_is_superhost",
53-
"host_has_profile_pic",
54-
"host_identity_verified",
55-
"neighbourhood_group_cleansed",
56-
"zipcode",
57-
"property_type",
58-
"room_type",
59-
"accommodates",
60-
"bathrooms",
61-
"bedrooms",
62-
"beds"
63-
],
64-
"index": [0],
65-
"data": [
66-
["False","False","False","Central Area","98122","House","Entire home/apt",4,1.5,3,3]
67-
]
68-
}
69-
}'::jsonb,
70-
'rental-price-deployment'
71-
) AS prediction;
72-
```
73-
74-
The result is returned as a `jsonb` value that contains the models output. You can extract fields from this result using standard PostgreSQL JSON functions.
47+
```sql
48+
SELECT azure_ml.invoke(
49+
'{
50+
"input_data": {
51+
"columns": [
52+
"host_is_superhost",
53+
"host_has_profile_pic",
54+
"host_identity_verified",
55+
"neighbourhood_group_cleansed",
56+
"zipcode",
57+
"property_type",
58+
"room_type",
59+
"accommodates",
60+
"bathrooms",
61+
"bedrooms",
62+
"beds"
63+
],
64+
"index": [0],
65+
"data": [
66+
["False","False","False","Central Area","98122","House","Entire home/apt",4,1.5,3,3]
67+
]
68+
}
69+
}'::jsonb,
70+
'rental-price-deployment'
71+
) AS prediction;
72+
```
73+
74+
The result is returned as a `jsonb` value that contains the model's output. You can extract fields from this result using standard PostgreSQL JSON functions.
7575
7676
1. Working with the output
7777
78-
For example, if the model returns an array of predicted values:
79-
80-
```sql
81-
WITH result AS (
82-
SELECT azure_ml.invoke(
83-
'{
84-
"input_data": {
85-
"columns": ["neighbourhood","bedrooms","bathrooms"],
86-
"index": [0],
87-
"data": [["Queen Anne", 2, 1]]
88-
}
89-
}'::jsonb,
90-
'rental-price-deployment'
91-
) AS output
92-
)
93-
SELECT jsonb_array_elements(output) AS predicted_value
94-
FROM result;
95-
```
96-
97-
You can incorporate this solution into views, functions, and reporting queries as needed.
78+
For example, if the model returns an array of predicted values:
79+
80+
```sql
81+
WITH result AS (
82+
SELECT azure_ml.invoke(
83+
'{
84+
"input_data": {
85+
"columns": ["neighbourhood","bedrooms","bathrooms"],
86+
"index": [0],
87+
"data": [["Queen Anne", 2, 1]]
88+
}
89+
}'::jsonb,
90+
'rental-price-deployment'
91+
) AS output
92+
)
93+
SELECT jsonb_array_elements(output) AS predicted_value
94+
FROM result;
95+
```
96+
97+
You can incorporate this solution into views, functions, and reporting queries as needed.
9898
9999
## Configure a connection to Azure Machine Learning
100100

0 commit comments

Comments
 (0)