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
For consistency between the constructor NVP and the property name. This does
not break existing code, because the constructor NVP has partial matching.
Copy file name to clipboardExpand all lines: +llms/+utils/errorMessageCatalog.m
+1-1
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@
45
45
catalog("llms:removeFromEmptyHistory") ="Unable to remove message from empty message history.";
46
46
catalog("llms:stopSequencesMustHaveMax4Elements") ="Number of stop sequences must be less than or equal to 4.";
47
47
catalog("llms:endpointMustBeSpecified") ="Unable to find endpoint. Either set environment variable AZURE_OPENAI_ENDPOINT or specify name-value argument ""Endpoint"".";
48
-
catalog("llms:deploymentMustBeSpecified") ="Unable to find deployment name. Either set environment variable AZURE_OPENAI_DEPLOYMENT or specify name-value argument ""Deployment"".";
48
+
catalog("llms:deploymentMustBeSpecified") ="Unable to find deployment name. Either set environment variable AZURE_OPENAI_DEPLOYMENT or specify name-value argument ""DeploymentID"".";
49
49
catalog("llms:keyMustBeSpecified") ="Unable to find API key. Either set environment variable {1} or specify name-value argument ""APIKey"".";
50
50
catalog("llms:mustHaveMessages") ="Message history must not be empty.";
51
51
catalog("llms:mustSetFunctionsForCall") ="When no functions are defined, ToolChoice must not be specified.";
Copy file name to clipboardExpand all lines: doc/Azure.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ loadenv(".env")
31
31
32
32
## Establishing a connection to Chat Completions API using Azure
33
33
34
-
To connect MATLAB® to Chat Completions API via Azure, you will have to create an `azureChat` object. See [the Azure documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart) for details on the setup required and where to find your key, endpoint, and deployment name. As explained above, the endpoint, deployment, and key should be in the environment variables `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENYT`, and `AZURE_OPENAI_API_KEY`, or provided as `Endpoint=…`, `Deployment=…`, and `APIKey=…` in the `azureChat` call below.
34
+
To connect MATLAB® to Chat Completions API via Azure, you will have to create an `azureChat` object. See [the Azure documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart) for details on the setup required and where to find your key, endpoint, and deployment name. As explained above, the endpoint, deployment, and key should be in the environment variables `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENYT`, and `AZURE_OPENAI_API_KEY`, or provided as `Endpoint=…`, `DeploymentID=…`, and `APIKey=…` in the `azureChat` call below.
35
35
36
36
In order to create the chat assistant, use the `azureChat` function, optionally providing a system prompt:
37
37
```matlab
@@ -119,7 +119,7 @@ txt = generate(chat,"What is Model-Based Design and how is it related to Digital
119
119
120
120
You can use gpt-4o, gpt-4o-mini, or gpt-4-turbo to experiment with image understanding.
121
121
```matlab
122
-
chat = azureChat("You are an AI assistant.",Deployment="gpt-4o");
122
+
chat = azureChat("You are an AI assistant.",DeploymentID="gpt-4o");
123
123
image_path = "peppers.png";
124
124
messages = messageHistory;
125
125
messages = addUserMessageWithImages(messages,"What is in the image?",image_path);
Copy file name to clipboardExpand all lines: doc/functions/azureChat.md
+15-25
Original file line number
Diff line number
Diff line change
@@ -59,18 +59,6 @@ For more information on connecting to the Azure OpenAI API, see [Azure OpenAI Se
59
59
For more information on keeping sensitive information out of code, see [Keep Sensitive Information Out of Code](https://www.mathworks.com/help/matlab/import_export/keep-sensitive-information-out-of-code.html).
60
60
61
61
62
-
### `Deployment` — Deployment ID
63
-
64
-
character vector | string scalar
65
-
66
-
67
-
Select a deployed model by specifying the corresponding deployment ID. Specifying the deployment ID also sets the `DeploymentID` property.
68
-
69
-
70
-
Instead of using the `Deployment` name\-value argument, you can also set the environment variable AZURE\_OPENAI\_DEPLOYMENT. For more information, see [Azure OpenAI Services API](../Azure.md).
71
-
72
-
73
-
**Example**: `"my-gpt-35-turbo-deployment"`
74
62
75
63
### `Tools` — Functions to call during output generation
76
64
@@ -112,6 +100,21 @@ Instead of using the `Endpoint` name\-value argument, you can also set the envir
112
100
113
101
For more information on how to obtain an Azure endpoint, see [https://learn.microsoft.com/en\-us/azure/ai\-services/openai/chatgpt\-quickstart?tabs=command\-line%2Cpython\-new&pivots=rest\-api\#set\-up](https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart?tabs=command-line%2Cpython-new&pivots=rest-api#set-up).
114
102
103
+
### `DeploymentID` — Deployment ID
104
+
105
+
character vector | string scalar
106
+
107
+
108
+
After construction, this property is read\-only.
109
+
110
+
111
+
The deployment ID, also known as deployment name, specifies the Azure OpenAI deployment to use for generation.
112
+
113
+
114
+
Instead of using the `DeploymentID` name\-value argument, you can also set the environment variable AZURE\_OPENAI\_DEPLOYMENT. For more information, see [Azure OpenAI Services API](../Azure.md).
Names of the custom functions specified in the `Tools` name\-value argument.
229
232
230
-
### `DeploymentID` — Deployment ID
231
-
232
-
character vector | string scalar
233
-
234
-
235
-
This property is read\-only.
236
-
237
-
238
-
The deployment ID specifies the model to use for generation.
239
-
240
-
241
-
Set the `DeploymentID` property at construction either by using the `Deployment` name\-value argument, or by setting the environment variable AZURE\_OPENAI\_DEPLOYMENT. For more information, see [Azure OpenAI Services API](../Azure.md).
242
-
243
233
# Object Functions
244
234
245
235
[`generate`](generate.md) — Generate output from large language models
0 commit comments