You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/migration.md
+111-2Lines changed: 111 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.author: mbullwin
7
7
ms.service: azure-ai-openai
8
8
ms.custom:
9
9
ms.topic: how-to
10
-
ms.date: 11/06/2023
10
+
ms.date: 11/09/2023
11
11
manager: nitinme
12
12
---
13
13
@@ -30,7 +30,7 @@ OpenAI has just released a new version of the [OpenAI Python API library](https:
30
30
31
31
- The latest release of the [OpenAI Python library](https://pypi.org/project/openai/) doesn't currently support DALL-E when used with Azure OpenAI. DALL-E with Azure OpenAI is still supported with `0.28.1`. For those who can't wait for native support for DALL-E and Azure OpenAI we're providing [two code examples](#dall-e-fix) which can be used as a workaround.
32
32
-`embeddings_utils.py` which was used to provide functionality like cosine similarity for semantic text search is [no longer part of the OpenAI Python API library](https://github.com/openai/openai-python/issues/676).
33
-
- You should also check the active [GitHub Issues](https://github.com/openai/openai-python/issues/703) for the OpenAI Python library.
33
+
- You should also check the active [GitHub Issues](https://github.com/openai/openai-python/issues/) for the OpenAI Python library.
For the full configuration steps that are required to make these code examples work, please consult the [use your data quickstart](../use-your-data-quickstart.md).
258
+
# [OpenAI Python 0.28.1](#tab/python)
259
+
260
+
```python
261
+
import os
262
+
import openai
263
+
import dotenv
264
+
import requests
265
+
266
+
dotenv.load_dotenv()
267
+
268
+
openai.api_base = os.environ.get("AOAIEndpoint")
269
+
openai.api_version ="2023-08-01-preview"
270
+
openai.api_type ='azure'
271
+
openai.api_key = os.environ.get("AOAIKey")
272
+
273
+
defsetup_byod(deployment_id: str) -> None:
274
+
"""Sets up the OpenAI Python SDK to use your own data for the chat endpoint.
275
+
276
+
:param deployment_id: The deployment ID for the model to use with your own data.
277
+
278
+
To remove this configuration, simply set openai.requestssession to None.
"content": "How is Azure machine learning different than Azure OpenAI?",
130
+
},
131
+
],
132
+
extra_body={
133
+
"dataSources": [
134
+
{
135
+
"type": "AzureCognitiveSearch",
136
+
"parameters": {
137
+
"endpoint": os.environ["SearchEndpoint"],
138
+
"key": os.environ["SearchKey"],
139
+
"indexName": os.environ["SearchIndex"]
140
+
}
141
+
}
142
+
]
143
+
}
144
+
)
145
+
146
+
print(completion.model_dump_json(indent=2))
147
+
```
148
+
149
+
---
150
+
92
151
> [!IMPORTANT]
93
152
> For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](../../../key-vault/general/overview.md). For more information about credential security, see the Azure AI services [security](../../security-features.md) article.
0 commit comments