Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zq99 authored May 20, 2023
1 parent 7e24340 commit dd38f39
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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.
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.

## Main Classes
1. `clsOpenAI` - Main class to interact with OpenAI
Expand Down Expand Up @@ -117,11 +117,35 @@ Public Function GETTEXTFROMOPENAI(ByVal strPrompt As String, ByVal strAPIKey As
End Function
```

### DALL-E Image Creation

```
Public Sub TestDalleOpenAI()
Dim oOpenAI As clsOpenAI
Dim oResponse As clsOpenAIResponse
Set oOpenAI = New clsOpenAI
oOpenAI.API_KEY = API_KEY
Set oResponse = oOpenAI.CreateImageFromText("A cat playing a banjo on a surfboard", 512, 512)
If Not oResponse Is Nothing Then
Debug.Print ("The picture has been saved to: " & oResponse.SavedLocalFile)
End If
Set oResponse = Nothing
Set oOpenAI = Nothing
End Sub
```

## Configuration

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

```vba
```
' Specify the model
oOpenAI.Model = "gpt-3.5-turbo"
Expand Down Expand Up @@ -151,6 +175,15 @@ Dim apiKey As String
apiKey = oOpenAI.GetReadAPIKeyFromFolder("<FolderPath>")
```

## Troubleshooting

You can check the status of the OpenAI API [here](https://status.openai.com/).

For coding issues, use the following line, to go through the code.
```
oOpenAI.IsLogOutputRequired True
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Expand Down

0 comments on commit dd38f39

Please sign in to comment.