Skip to content

wick3dr0se/openai-nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI-Nim

OpenAI API for Nim

Acquisition

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

Getting Started

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")