Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fancellu/openai-scala-models
A collection of case classes that work against the OpenAI API
https://github.com/fancellu/openai-scala-models
openai scala
Last synced: 8 days ago
JSON representation
A collection of case classes that work against the OpenAI API
- Host: GitHub
- URL: https://github.com/fancellu/openai-scala-models
- Owner: fancellu
- License: mit
- Created: 2022-12-08T18:34:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-12T20:47:38.000Z (about 2 years ago)
- Last Synced: 2024-11-10T17:12:27.912Z (2 months ago)
- Topics: openai, scala
- Language: Scala
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAI-Scala-Models
This is simply a collection of case classes that work against the OpenAI API: v 1.1.0
This is framework-agnostic, and you will have to supply your own encoders/decoders
This is an **unofficial library** and is **community-maintained**.
You can either just copy the source files to your repo or use as a library
[![](https://jitpack.io/v/fancellu/openai-scala-models.svg)](https://jitpack.io/#fancellu/openai-scala-models)You can see example usage of these models here, with ZIO
[OpenAICompletionApp](https://github.com/fancellu/zio-restful-webservice/blob/main/src/main/scala/com/felstar/restfulzio/openai/OpenAICompletionApp.scala)Also here with http4s
https://github.com/fancellu/http4s-circe-example/blob/master/src/main/scala/MyMain.scala
## OpenAI docs
https://beta.openai.com/docs/api-reference
Root for all API calls ```https://api.openai.com/v1```
## Completions
https://beta.openai.com/docs/api-reference/completions
POST ```CreateCompletionRequest``` to /completions and receive ```CreateCompletionResponse```
## Models
https://beta.openai.com/docs/api-reference/models
GET /models to receive ```ListModelsResponse```
GET /models/{modelName} to receive ```Model```
## Edits
https://beta.openai.com/docs/api-reference/edits
POST ```CreateEditRequest``` and receive ```CreateEditResponse```
## Images
https://beta.openai.com/docs/api-reference/images
POST ```CreateImageRequest``` to /images/generations and receive ```ImagesResponse```
POST ```CreateImageEditRequest``` to /images/edits and receive ```ImagesResponse```
POST ```CreateImageVariationRequest``` to /images/variations and receive ```ImagesResponse```
## Moderations
https://beta.openai.com/docs/api-reference/moderations
POST ```CreateModerationRequest``` to /moderations and receive ```CreateModerationResponse```