We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4592a04 commit bae48e5Copy full SHA for bae48e5
articles/cognitive-services/openai/how-to/embeddings.md
@@ -29,11 +29,19 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYM
29
-H 'api-key: YOUR_API_KEY' \
30
-d '{"input": "Sample Document goes here"}'
31
```
32
+
33
# [python](#tab/python)
34
```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
42
response = openai.Embedding.create(
43
input="Your text string goes here",
- model="YOUR_DEPLOYMENT_NAME"
44
+ engine="YOUR_DEPLOYMENT_NAME"
45
)
46
embeddings = response['data'][0]['embedding']
47
0 commit comments