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: README.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Large Language Models (LLMs) with MATLAB® [](https://matlab.mathworks.com/open/github/v1?repo=matlab-deep-learning/llms-with-matlab)
2
2
3
-
This repository contains example code to demonstrate how to connect MATLAB to the OpenAI™ Chat Completions API (which powers ChatGPT™) as well as OpenAI Images API (which powers DALL-E™). This allows you to leverage the natural language processing capabilities of large language models directly within your MATLAB environment.
3
+
This repository contains example code to demonstrate how to connect MATLAB to the OpenAI™ Chat Completions API (which powers ChatGPT™) as well as OpenAI Images API (which powers DALL·E™). This allows you to leverage the natural language processing capabilities of large language models directly within your MATLAB environment.
4
4
5
-
The functionality shown here serves as an interface to the ChatGPT and DALL-E APIs. To start using the OpenAI APIs, you first need to obtain the OpenAI API keys. You are responsible for any fees OpenAI may charge for the use of their APIs. You should be familiar with the limitations and risks associated with using this technology, and you agree that you shall be solely responsible for full compliance with any terms that may apply to your use of the OpenAI APIs.
5
+
The functionality shown here serves as an interface to the ChatGPT and DALL·E APIs. To start using the OpenAI APIs, you first need to obtain OpenAI API keys. You are responsible for any fees OpenAI may charge for the use of their APIs. You should be familiar with the limitations and risks associated with using this technology, and you agree that you shall be solely responsible for full compliance with any terms that may apply to your use of the OpenAI APIs.
6
6
7
7
Some of the current LLMs supported are:
8
8
- gpt-3.5-turbo, gpt-3.5-turbo-1106
@@ -127,6 +127,7 @@ You can specifying the streaming function when you create the chat assistant. Th
127
127
sf = @(x)fprintf("%s",x);
128
128
chat = openAIChat(StreamFun=sf);
129
129
txt = generate(chat,"What is Model-Based Design and how is it related to Digital Twin?")
130
+
% Should stream the response token by token
130
131
```
131
132
132
133
### Calling MATLAB functions with the API
@@ -280,6 +281,7 @@ image_path = "peppers.png";
280
281
messages = openAIMessages;
281
282
messages = addUserMessageWithImages(messages,"What is in the image?",image_path);
images = generate(mdl,"Create a 3D avatar of a whimsical sushi on the beach. He is decorated with various sushi elements and is playfully interacting with the beach environment.");
0 commit comments