Skip to content

Commit 056c557

Browse files
committed
Add vision support to the doc files
1 parent 8da8794 commit 056c557

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

doc/Azure.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ txt = generate(chat,"What is Model-Based Design and how is it related to Digital
115115
% Should stream the response token by token
116116
```
117117

118+
## Understanding the content of an image
119+
120+
You can use gpt-4o, gpt-4o-mini, or gpt-4-turbo to experiment with image understanding.
121+
```matlab
122+
chat = azureChat("You are an AI assistant.",Deployment="gpt-4o");
123+
image_path = "peppers.png";
124+
messages = messageHistory;
125+
messages = addUserMessageWithImages(messages,"What is in the image?",image_path);
126+
[txt,response] = generate(chat,messages,MaxNumTokens=4096);
127+
txt
128+
% outputs a description of the image
129+
```
130+
118131
## Calling MATLAB functions with the API
119132

120133
Optionally, `Tools=functions` can be used to provide function specifications to the API. The purpose of this is to enable models to generate function arguments which adhere to the provided specifications.

doc/Ollama.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,19 @@ txt = generate(chat,"What is Model-Based Design and how is it related to Digital
9696
% Should stream the response token by token
9797
```
9898

99+
## Understanding the content of an image
100+
101+
You can use multimodal models like `llava` to experiment with image understanding.
102+
```matlab
103+
chat = ollamaChat("llava");
104+
image_path = "peppers.png";
105+
messages = messageHistory;
106+
messages = addUserMessageWithImages(messages,"What is in the image?",image_path);
107+
[txt,response] = generate(chat,messages,MaxNumTokens=4096);
108+
txt
109+
% outputs a description of the image
110+
```
111+
99112
## Establishing a connection to remote LLMs using Ollama
100113

101114
To connect to a remote Ollama server, use the `Endpoint` name-value pair. Include the server name and port number. Ollama starts on 11434 by default.

doc/OpenAI.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,15 @@ You can extract the arguments and write the data to a table, for example.
250250

251251
## Understanding the content of an image
252252

253-
You can use gpt-4-turbo to experiment with image understanding.
253+
You can use gpt-4o, gpt-4o-mini, or gpt-4-turbo to experiment with image understanding.
254254
```matlab
255-
chat = openAIChat("You are an AI assistant.", ModelName="gpt-4-turbo");
255+
chat = openAIChat("You are an AI assistant.");
256256
image_path = "peppers.png";
257257
messages = messageHistory;
258258
messages = addUserMessageWithImages(messages,"What is in the image?",image_path);
259259
[txt,response] = generate(chat,messages,MaxNumTokens=4096);
260-
% Should output the description of the image
260+
txt
261+
% outputs a description of the image
261262
```
262263

263264
## Obtaining embeddings

0 commit comments

Comments
 (0)