Skip to content

Commit bae48e5

Browse files
authored
Update embeddings.md
1 parent 4592a04 commit bae48e5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

articles/cognitive-services/openai/how-to/embeddings.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYM
2929
-H 'api-key: YOUR_API_KEY' \
3030
-d '{"input": "Sample Document goes here"}'
3131
```
32+
3233
# [python](#tab/python)
3334
```python
35+
import openai
36+
37+
openai.api_type = "azure"
38+
openai.api_key = YOUR_API_KEY
39+
openai.api_base = "https://YOUR_RESOURCE_NAME.openai.azure.com"
40+
openai.api_version = "2022-12-01"
41+
3442
response = openai.Embedding.create(
3543
input="Your text string goes here",
36-
model="YOUR_DEPLOYMENT_NAME"
44+
engine="YOUR_DEPLOYMENT_NAME"
3745
)
3846
embeddings = response['data'][0]['embedding']
3947
```

0 commit comments

Comments
 (0)