Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wick3dr0se/openai-nim
OpenAI API for Nim
https://github.com/wick3dr0se/openai-nim
nim nim-lang nim-library nimble openai openai-api
Last synced: 9 days ago
JSON representation
OpenAI API for Nim
- Host: GitHub
- URL: https://github.com/wick3dr0se/openai-nim
- Owner: wick3dr0se
- License: gpl-3.0
- Created: 2023-10-03T04:37:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-25T00:03:18.000Z (about 1 year ago)
- Last Synced: 2024-11-13T01:43:55.720Z (2 months ago)
- Topics: nim, nim-lang, nim-library, nimble, openai, openai-api
- Language: Nim
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
OpenAI-Nim
OpenAI API for Nim
## Acquisition
Install with Nimble
```bash
nimble install https://github.com/wick3dr0se/openai-nim@#head
```Install from source
```bash
git clone https://github.com/wick3dr0se/openai-nim; cd openai-nim
```## Getting Started
Import openai module
```nim
# from nimble
import openai
# or from source
import ./openai
```Start an asynchronous OpenAI client
```nim
var ai = newAIClient(getEnv("AI_KEY")
```Text chat with OpenAI
```nim
ai.chat("Say 'test'")
```Generate an image with DALL-E
```nim
ai.imageGen("Puppy")
```