Skip to content

Commit dd38f39

Browse files
authored
Update README.md
1 parent 7e24340 commit dd38f39

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

README.md

+35-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/zq99/openai-vba-framework/blob/main/LICENSE)
44

5-
OpenAI-VBA-Framework is a toolkit for developers looking to create applications in VBA that interact with OpenAI's large language models such as GPT-4 and ChatGPT. This framework provides a suite of classes to facilitate smooth integration with OpenAI's API.
5+
OpenAI-VBA-Framework is a toolkit for developers looking to create applications in VBA that interact with OpenAI's large language models such as GPT-4, ChatGPT and DALL-E. This framework provides a suite of classes to facilitate smooth integration with OpenAI's API.
66

77
## Main Classes
88
1. `clsOpenAI` - Main class to interact with OpenAI
@@ -117,11 +117,35 @@ Public Function GETTEXTFROMOPENAI(ByVal strPrompt As String, ByVal strAPIKey As
117117
End Function
118118
```
119119

120+
### DALL-E Image Creation
121+
122+
```
123+
Public Sub TestDalleOpenAI()
124+
125+
Dim oOpenAI As clsOpenAI
126+
Dim oResponse As clsOpenAIResponse
127+
128+
Set oOpenAI = New clsOpenAI
129+
130+
oOpenAI.API_KEY = API_KEY
131+
132+
Set oResponse = oOpenAI.CreateImageFromText("A cat playing a banjo on a surfboard", 512, 512)
133+
134+
If Not oResponse Is Nothing Then
135+
Debug.Print ("The picture has been saved to: " & oResponse.SavedLocalFile)
136+
End If
137+
138+
Set oResponse = Nothing
139+
Set oOpenAI = Nothing
140+
141+
End Sub
142+
```
143+
120144
## Configuration
121145

122146
You can customize the OpenAI-VBA-Framework by adjusting properties in the `clsOpenAI` class:
123147

124-
```vba
148+
```
125149
' Specify the model
126150
oOpenAI.Model = "gpt-3.5-turbo"
127151
@@ -151,6 +175,15 @@ Dim apiKey As String
151175
apiKey = oOpenAI.GetReadAPIKeyFromFolder("<FolderPath>")
152176
```
153177

178+
## Troubleshooting
179+
180+
You can check the status of the OpenAI API [here](https://status.openai.com/).
181+
182+
For coding issues, use the following line, to go through the code.
183+
```
184+
oOpenAI.IsLogOutputRequired True
185+
```
186+
154187
## Contributing
155188
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
156189

0 commit comments

Comments
 (0)