Skip to content

Commit 12bd325

Browse files
MiriamScharnkeccreutzi
authored andcommitted
Minor documentation fixes
1 parent 31a53b1 commit 12bd325

15 files changed

+15
-15
lines changed

examples/AnalyzeSentimentinTextUsingChatGPTinJSONMode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Define the expected output JSON Schema.
3030
jsonSchema = '{"sentiment": "string (positive, negative, neutral)","confidence_score": "number (0-1)"}';
3131
```
3232

33-
Define the the system prompt, combining your instructions and the JSON Schema. In order for the model to output JSON, you need to specify that in the prompt, for example, adding *"designed to output to JSON"* to the prompt.
33+
Define the system prompt, combining your instructions and the JSON Schema. In order for the model to output JSON, you need to specify that in the prompt, for example, adding *"designed to output to JSON"* to the prompt.
3434

3535
```matlab
3636
systemPrompt = "You are an AI designed to output to JSON. You analyze the sentiment of the provided text and " + ...

examples/AnalyzeTextDataUsingParallelFunctionCallwithChatGPT.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Function calls allow you to describe a function to ChatGPT in a structured way.
1212
This example contains four steps:
1313

1414
- Create an unstructured text document containing fictional customer data.
15-
- Create a prompt, asking ChatGPT to extract information about different types customers.
15+
- Create a prompt, asking ChatGPT to extract information about different types of customers.
1616
- Create a function that extracts information about customers.
1717
- Combine the prompt and the function. Use ChatGPT to detect how many function calls are included in the prompt and to generate a JSON object with the function outputs.
1818

@@ -37,7 +37,7 @@ record = ["Customer John Doe, 35 years old. Email: [email protected]";
3737
"Sofia Russo, 24 years old, email: [email protected]"];
3838
```
3939

40-
Define the function that extract data from the customer record.
40+
Define the function that extracts data from the customer record.
4141

4242
```matlab
4343
f = openAIFunction("extractCustomerData", "Extracts data from customer records");
@@ -54,7 +54,7 @@ messages = messageHistory;
5454
messages = addUserMessage(messages,"Extract data from the record: " + record);
5555
```
5656

57-
Create a chat object with a latest model. Only the new models support the parallel function calling.
57+
Create a chat object. Specify the model to be `"gpt-3.5-turbo"`, which supports parallel function calls.
5858

5959
```matlab
6060
model = "gpt-3.5-turbo";
@@ -169,7 +169,7 @@ txt =
169169
```
170170
# Helper functions
171171

172-
Function that searches specific customer based on age range
172+
Function that searches specific customers based on age range
173173

174174
```matlab
175175
function json = searchCustomerData(data, minAge, maxAge)

examples/CreateSimpleChatBot.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ while true
5353
disp("User: " + query)
5454
```
5555

56-
If the you input the stop word, display a farewell message and exit the loop.
56+
If you input the stop word, display a farewell message and exit the loop.
5757

5858
```matlab
5959
if query == stopWord

examples/DescribeImagesUsingChatGPT.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ messages = messageHistory;
3535
messages = addUserMessageWithImages(messages,"What is in the image?", string(image_url));
3636
```
3737

38-
Generate a response. By default, the model returns a very short response. To override it, set `MaxNumTokens` to 4096.
38+
Generate a response.
3939

4040
```matlab
41-
[txt,~,response] = generate(chat,messages,MaxNumTokens=4096);
41+
[txt,~,response] = generate(chat,messages);
4242
if response.StatusCode == "OK"
4343
wrappedText = wrapText(txt)
4444
else
@@ -48,10 +48,10 @@ end
4848

4949
```matlabTextOutput
5050
wrappedText =
51-
"The image depicts a serene landscape featuring a wooden pathway that runs
52-
through a lush, green marsh or meadow. The path is bordered by tall grass and
53-
some shrubs, with a clear blue sky overhead dotted with clouds. The scene
54-
evokes a sense of tranquility and natural beauty."
51+
"The image depicts a scenic outdoor landscape featuring a wooden pathway or
52+
boardwalk extending through a lush green field. The field is filled with tall
53+
grass and bordered by greenery, including trees and shrubbery. Above, the sky
54+
is bright and cloudy, creating a serene and tranquil atmosphere."
5555
5656
```
5757
# Helper function
Loading

examples/InformationRetrievalUsingOpenAIDocumentEmbedding.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The example consists of four steps:
1010

1111
- Download and preprocess text from several MATLAB® documentation pages.
1212
- Embed query document and document corpus using the "text\-embedding\-3\-small" document embedding.
13-
- Find the most documentation page most relevant to the query using cosine similarity scores.
13+
- Find the documentation page most relevant to the query using cosine similarity scores.
1414
- Generate an answer to the query based on the most relevant documentation page.
1515

1616
This process is sometimes referred to as Retrieval\-Augmented Generation (RAG), similar to the application found in the example [ExampleRetrievalAugmentedGeneration.mlx](./ExampleRetrievalAugmentedGeneration.mlx).

examples/ProcessGeneratedTextInRealTimeByUsingOllamaInStreamingMode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ generate(chat,history);
117117

118118
1. Adds the basic HTML structure and the JavaScript that process the data change in MATLAB.
119119
2. The JavaScript gets a reference to the table and changed data and if the 3rd element in the data is "new", adds a new row.
120-
3. It populates the new row with two cells and update the cells from the first two elements of the data.
120+
3. It populates the new row with two cells and updates the cells from the first two elements of the data.
121121
4. The new row is then appended to the table.
122122
5. Otherwise, the JavaScript gets reference to the last cell of the last row of the table, and update it with the 2nd element of the data.
123123
```matlab

examples/ProcessGeneratedTextinRealTimebyUsingChatGPTinStreamingMode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ addChat(h,"assistant",txt,"current")
9797

9898
1. Adds the basic HTML structure and the JavaScript that process the data change in MATLAB.
9999
2. The JavaScript gets a reference to the table and changed data and if the 3rd element in the data is "new", adds a new row.
100-
3. It populates the new row with two cells and update the cells from the first two elements of the data.
100+
3. It populates the new row with two cells and updates the cells from the first two elements of the data.
101101
4. The new row is then appended to the table.
102102
5. Otherwise, the JavaScript gets reference to the last cell of the last row of the table, and update it with the 2nd element of the data.
103103
```matlab
Binary file not shown.
Binary file not shown.
2 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)