Skip to content

Commit e6d7827

Browse files
committed
update
1 parent ffe2d63 commit e6d7827

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

articles/ai-services/openai/how-to/switching-endpoints.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ We recommend using environment variables. If you haven't done this before our [P
3434
from openai import OpenAI
3535

3636
client = OpenAI(
37-
api_key=os.environ['OPENAI_API_KEY']
37+
api_key=os.environ["OPENAI_API_KEY"]
3838
)
3939

4040

@@ -74,7 +74,7 @@ client = AzureOpenAI(
7474
from openai import OpenAI
7575

7676
client = OpenAI(
77-
api_key=os.environ['OPENAI_API_KEY']
77+
api_key=os.environ["OPENAI_API_KEY"]
7878
)
7979

8080

@@ -122,7 +122,7 @@ OpenAI uses the `model` keyword argument to specify what model to use. Azure Ope
122122

123123
```python
124124
completion = client.completions.create(
125-
model='gpt-3.5-turbo-instruct',
125+
model="gpt-3.5-turbo-instruct",
126126
prompt="<prompt>")
127127
)
128128

@@ -142,7 +142,7 @@ embedding = client.embeddings.create(
142142

143143
```python
144144
completion = client.completions.create(
145-
model=gpt-35-turbo-instruct, # This must match the custom deployment name you chose for your model.
145+
model="gpt-35-turbo-instruct", # This must match the custom deployment name you chose for your model.
146146
prompt=<"prompt">
147147
)
148148

articles/ai-services/openai/includes/create-resource-cli.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ az cognitiveservices account deployment create \
9595
--sku-name "Standard"
9696
```
9797

98+
> [!IMPORTANT]
99+
> When you access the model via the API you will need to refer to the deployment name rather than the underlying model name in API calls. This is one of the [key differences](../how-to/switching-endpoints.md) between OpenAI and Azure OpenAI. OpenAI only requires the model name, Azure OpenAI always requires deployment name, even when using the model parameter. In our docs we often have examples where deployment names is represented as identical to model names to help indicate which model works with a particular API endpoint. Ultimately your deployment names can follow whatever naming convention is best for your use case.
100+
98101
## Delete a model from your resource
99102

100103
You can delete any model deployed from your resource with the [az cognitiveservices account deployment delete](/cli/azure/cognitiveservices/account/deployment?view=azure-cli-latest&preserve-view=true#az-cognitiveservices-account-deployment-delete) command. In the following example, you delete a model named _MyModel_. When you try the example, update the code to use your values for the resource group, resource, and deployed model.

articles/ai-services/openai/includes/create-resource-portal.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ To deploy a model, follow these steps:
114114

115115
1. Select a model from the dropdown list.
116116

117-
1. Enter a deployment name to help you identify the model.
117+
1. Enter a deployment name to identify the model.
118+
119+
> [!IMPORTANT]
120+
> When you access the model via the API you will need to refer to the deployment name rather than the underlying model name in API calls. This is one of the [key differences](../how-to/switching-endpoints.md) between OpenAI and Azure OpenAI. OpenAI only requires the model name, Azure OpenAI always requires deployment name, even when using the model parameter. In our docs we often have examples where deployment names is represented as identical to model names to help indicate which model works with a particular API endpoint. Ultimately your deployment names can follow whatever naming convention is best for your use case.
118121
119122
1. For your first deployment, leave the **Advanced options** set to the defaults.
120123

articles/ai-services/openai/includes/create-resource-powershell.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ $sku = New-Object -TypeName "Microsoft.Azure.Management.CognitiveServices.Models
9090
New-AzCognitiveServicesAccountDeployment -ResourceGroupName OAIResourceGroup -AccountName MyOpenAIResource -Name MyModel -Properties $properties -Sku $sku
9191
```
9292

93+
> [!IMPORTANT]
94+
> When you access the model via the API you will need to refer to the deployment name rather than the underlying model name in API calls. This is one of the [key differences](../how-to/switching-endpoints.md) between OpenAI and Azure OpenAI. OpenAI only requires the model name, Azure OpenAI always requires deployment name, even when using the model parameter. In our docs we often have examples where deployment names is represented as identical to model names to help indicate which model works with a particular API endpoint. Ultimately your deployment names can follow whatever naming convention is best for your use case.
95+
9396
## Delete a model from your resource
9497

9598
You can delete any model deployed from your resource with the [Remove-AzCognitiveServicesAccountDeployment](/powershell/module/az.cognitiveservices/remove-azcognitiveservicesaccountdeployment) command. In the following example, you delete a model named _MyModel_. When you try the example, update the code to use your values for the resource group, resource, and deployed model.

0 commit comments

Comments
 (0)