Skip to content

Commit

Permalink
docs:OpenAIMode demo presentation slides.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Apr 2, 2023
1 parent e832399 commit 75d3b17
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions MarkdownDocuments/OpenAIMode-demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---

# OpenAIMode demo

**...for Mathematica notebooks**

**Anton Antonov
[MathematicaForPrediction at WordPress](https://mathematicaforprediction.wordpress.com)
[MathematicaForPrediction at GitHub](https://github.com/antononcube/MathematicaForPrediction)
April 2023**

***[Video recording](https://youtu.be/htUIOqcS9uA)***

---

## Setup

- It is assumed that the paclet [OpenAILink](https://resources.wolframcloud.com/PacletRepository/resources/ChristopherWolfram/OpenAILink/) is installed

- ... and the required setup steps are completed.

- Install the paclet [OpenAIMode](https://resources.wolframcloud.com/PacletRepository/resources/AntonAntonov/OpenAIMode/)

```mathematica
PacletInstall["AntonAntonov/OpenAIMode"]
```

![11og8fps5xhgk](./Diagrams/OpenAIMode-demo/11og8fps5xhgk.png)

```mathematica
Needs["AntonAntonov`OpenAIMode`"]
```

---

## Demo

Let us show how the notebook style works:

- Needs

- OpenAIMode

- Text completion cell (shortcut: "Shift-|")

- Tweak invocation parameters with SetOptions

- Image generation cell (shortcuts: "Tab")

### Screenshots

![06wybw0d8ntd6](./Diagrams/OpenAIMode-demo/06wybw0d8ntd6.png)

![1iqsuwy5jkmit](./Diagrams/OpenAIMode-demo/1iqsuwy5jkmit.png)

---

## How does it work?

Consider the following flowchart:

```mathematica
ResourceFunction["MermaidJS"]["flowchart TDOpenAI{{OpenAI}}OpenAILink[[\"OpenAILink\"]]TCC[\"Text completion cell\"]IGC[\"Image generation cell\"] OC[\"Output cell\"]UI[/\"User input\"/]UI --> TCCUI --> IGCTCC -.-> OpenAIInputExecuteToText -.-> OpenAILinkIGC -.-> OpenAIInputExecuteToImage -.-> OpenAILinkOpenAILink <-.-> OpenAIOpenAILink -.-> OCTCC --> OCIGC --> OCsubgraph NotebookTCC OpenAIInputExecuteToTextIGC OpenAIInputExecuteToImageOCend ", "PDF", ImageSize -> 1000]
```

![0wyc32bgh7gso](./Diagrams/OpenAIMode-demo/0wyc32bgh7gso.png)

---

## Concluding remarks

### Similar work

- DSLMode and [RakuMode](https://community.wolfram.com/groups/-/m/t/2434981)

- [DarkMode](https://resources.wolframcloud.com/FunctionRepository/resources/DarkMode/) and [DraculaTheme](https://resources.wolframcloud.com/FunctionRepository/resources/DraculaTheme/)

### Future plans (...maybe)

More documentation

Should this notebook style functions be part of [OpenAILink](https://resources.wolframcloud.com/PacletRepository/resources/ChristopherWolfram/OpenAILink/)?

Based on feedback:

- Better default options

- Additional OpenAI cells

0 comments on commit 75d3b17

Please sign in to comment.