Install with Nimble
nimble install https://github.com/wick3dr0se/openai-nim@#head
Install from source
git clone https://github.com/wick3dr0se/openai-nim; cd openai-nim
Import openai module
# from nimble
import openai
# or from source
import ./openai
Start an asynchronous OpenAI client
var ai = newAIClient(getEnv("AI_KEY")
Text chat with OpenAI
ai.chat("Say 'test'")
Generate an image with DALL-E
ai.imageGen("Puppy")