A minmal API interface to the OpenAI API.
[ca.inaimathi/trivial-openai "0.0.0"]
In your environment, set OPENAI_API_KEY
to the value of your API key. You can get one from here.
In your code
(ns ...
(:require [trivial-warning.core :as ai]))
...
(ai/models)
models
; returns a list of available modelscompletion
; takes a prompt and a bunch of optional parameters and returns the completionchat
; takes a list of messages and a bunch of optional parameters and returns a chat responsemoderation
; takes a string or list of strings and optionally a model and returns a moderation assessment based on OpenAI TOStranscription
; takes an audio filename and a bunch of optional parameters and returns the transcribed texttranslation
; takes an audio filename and a bunch of optional paraeters and returns the translated textimage
; takes a prompt and returns an image matching itimage-edit
; takes an image filename and a prompt and edits the image in some way (also, include a mask if you don't want to just get a completely different image)image-variations
; takes an image and returns variations on itimage-url->file
; takes a url and a pathnamae. Downloads the image at the given URL to the given local path.Copyright © 2023 inaimathileo.zovic@gmail.com
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close