Skip to content

Commit

Permalink
Merge pull request #2 from matlab-deep-learning/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
debymf authored Oct 24, 2023
2 parents 6a91fed + 6163037 commit 99a49a8
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 282 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ history = addUserMessage(history,"Generate MATLAB code that computes that");
### Calling MATLAB functions with the API
The optional parameter `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.
Note that the API is not able to directly call any function, so you should call the function and pass the values to the API directly. This process can be automated as shown in [ExampleFunctionCalling.m](/examples/ExampleFunctionCalling.m), but it's important to consider that ChatGPT can hallucinate function names, so avoid executing any arbitrary generated functions and only allow the execution of functions that you have defined.
Note that the API is not able to directly call any function, so you should call the function and pass the values to the API directly. This process can be automated as shown in [ExampleFunctionCalling.mlx](/examples/ExampleFunctionCalling.mlx), but it's important to consider that ChatGPT can hallucinate function names, so avoid executing any arbitrary generated functions and only allow the execution of functions that you have defined.

For example, if you want to use the API for mathematical operations such as `sind`, instead of letting the model generate the result and risk running into hallucinations, you can give the model direct access to the function as follows:

Expand Down Expand Up @@ -237,9 +237,9 @@ You can extract the arguments and write the data to a table, for example.
## Examples
To learn how to use this in your workflows, see [Examples](/examples/).

- [ExampleSummarization.m](/examples/ExampleSummarization.m): Learn to create concise summaries of long texts with ChatGPT. (Requires Text Analytics Toolbox™)
- [ExampleChatBot.m](/examples/ExampleChatBot.m): Build a conversational chatbot capable of handling various dialogue scenarios using ChatGPT. (Requires Text Analytics Toolbox)
- [ExampleFunctionCalling.m](/examples/ExampleFunctionCalling.m): Learn how to create agents capable of executing MATLAB functions.
- [ExampleSummarization.mlx](/examples/ExampleSummarization.mlx): Learn to create concise summaries of long texts with ChatGPT. (Requires Text Analytics Toolbox™)
- [ExampleChatBot.mlx](/examples/ExampleChatBot.mlx): Build a conversational chatbot capable of handling various dialogue scenarios using ChatGPT. (Requires Text Analytics Toolbox)
- [ExampleFunctionCalling.mlx](/examples/ExampleFunctionCalling.mlx): Learn how to create agents capable of executing MATLAB functions.

## License

Expand Down
74 changes: 0 additions & 74 deletions examples/ExampleChatBot.m

This file was deleted.

Binary file added examples/ExampleChatBot.mlx
Binary file not shown.
108 changes: 0 additions & 108 deletions examples/ExampleFunctionCalling.m

This file was deleted.

Binary file added examples/ExampleFunctionCalling.mlx
Binary file not shown.
96 changes: 0 additions & 96 deletions examples/ExampleSummarization.m

This file was deleted.

Binary file added examples/ExampleSummarization.mlx
Binary file not shown.

0 comments on commit 99a49a8

Please sign in to comment.